\n `}},{key:"toDebugLog",value:function(){return d.log("toDebugLog"),this.messagesStore.store}}]),e}();t.MessagesFormatter=f},33069:function(e,t,n){"use strict";var a=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.formatLabelText=void 0,t.formatPeriodsToSelectModel=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0;return e.map(((n,a)=>{const o=e[a+1],r=A(n,o,t);return r?{label:r,value:n}:r})).filter((e=>"object"==typeof e))},t.formatPeriodsToUserStoreModel=O,t.formatWorkTimeToServerModel=C,t.isErrorStatusCode=function(e){return[p.DelayedCallStatus.MAX_REQUESTS_LIMIT,p.DelayedCallStatus.NOT_WORK_TIME,p.DelayedCallStatus.BAD_CALLBACK_TIME,p.DelayedCallStatus.BLOCKED,p.DelayedCallStatus.BAD_DIRECTION].some((t=>e===t))},t.onDelayedCallAvailable=E,t.redirectAfterRequestDelayedCall=function(){const e=n(21476).Router,t=n(47060).RouterEvent;e.next(t.ToCall)},t.removePeriod=T,t.requestDelayedCall=function(e){const t=e.dateTime,n=e.phone,a=n.replace(/( |\-)/gi,"").replace(/\D+/g,""),o=C(t),m=o.date,b=o.time,O=(0,g.getClient)(),S=O.clientId?O.clientId.split(".")[0]:"0",w=`/sites/${i.default.site_id}/widgets/${i.default.widget_id}/clients/${S}/telephony/callback/delayed`,I={phone:a,callback_date:m,callback_time:b};l.callbackDispatchers.setDelayedCallbackStatus(p.DelayedCallStatus.WAIT),l.clientDispatchers.setClientPhone(`+${a}`),v.xhrRequest.post((0,u.telephonyUrl)(w),((e,a)=>{if(e||a&&!a.data)return!e&&l.callbackDispatchers.setDelayedCallbackStatus(p.DelayedCallStatus.NOT_WORK_TIME),f.Monitoring.telemetry(d.TelemetryName.DELAYED_ERR,{param1:null!=e?e:"No data"});const o=a.data,i=o.work_time,h=o.error_list;if(o.ok){const e="as_soon_as_possible"===b&&o.callback_started,a={asSoonAsPossibleMessage:`${(0,r.default)("cw_call_to")} ${(0,u.getMaskedPhone)(n)}`,defaultMessage:`${(0,r.default)("callback_delayed_submit_success")}\n${A(t)}`};e&&(l.callbackDispatchers.setCallbackIsDelayed(!1),l.callbackDispatchers.setCallbackStatus(p.CallStatus.WAIT),s.messageActions.handleContactsForm()),s.messageActions.systemCallMessage(e?a.asSoonAsPossibleMessage:a.defaultMessage,_.MessageName.DELAYED_CALL_SUCCESS),l.callbackDispatchers.setDelayedCallbackStatus(p.DelayedCallStatus.SUCCESS),c.default.trackCallWidgetRequested()}if(i&&E(i),h){const e=(0,g.getCallback)();h.includes("max_requests_limit")&&l.callbackDispatchers.setDelayedCallbackStatus(p.DelayedCallStatus.MAX_REQUESTS_LIMIT),h.includes("bad_callback_time")&&(l.callbackDispatchers.setDelayedCallbackStatus(p.DelayedCallStatus.BAD_CALLBACK_TIME),T(I.callback_date+y+I.callback_time));const t=h.some((e=>/client_blacklist|global_blacklist|rate_limiter/.test(e)));t&&l.callbackDispatchers.setDelayedCallbackStatus(p.DelayedCallStatus.BLOCKED),e.delayedStatus===p.DelayedCallStatus.WAIT&&l.callbackDispatchers.setDelayedCallbackStatus(p.DelayedCallStatus.NOT_WORK_TIME),l.callbackDispatchers.setCallbackStatus(!1)}}),{headers:{"Content-Type":h.CONTENT_TYPE.X_WWW_FORM},body:I})},t.resetDelayedCallStatus=function(){l.callbackDispatchers.setDelayedTimezone(null),l.callbackDispatchers.setDelayedPeriods([]),l.callbackDispatchers.setCallbackIsDelayed(null),l.callbackDispatchers.setDelayedCallbackStatus(null)};var o=a(n(67375)),r=a(n(84726)),i=a(n(1039)),s=n(65465),l=n(26932),u=n(31984),c=a(n(138)),d=n(83170),f=n(54415),p=n(47138),h=n(31343),g=n(44145),m=a(n(4855)),_=n(81152),v=n(95911);m.default.name("DelayedCall");const y="|";const b="function"==typeof(new Date).toLocaleString&&function(){try{(new Date).toLocaleString("i")}catch(e){return"RangeError"===e.name}return!1}();function E(e){l.callbackDispatchers.setCallbackAvailable(!0),l.callbackDispatchers.setDelayedTimezone(e.timezone_diff),l.callbackDispatchers.setCallbackIsDelayed(!0),l.callbackDispatchers.setDelayedPeriods(O(e.schedule))}function T(e){const t=(0,g.getCallback)();if(t.delayedPeriods&&t.delayedPeriods.length){const n=t.delayedPeriods;l.callbackDispatchers.setDelayedPeriods(n.filter((t=>t!==e)))}}function C(e){const t=e.split(y),n=(0,o.default)(t,2);return{date:n[0],time:n[1]}}function O(e){const t=[];return e.forEach((e=>{const n=e.date;e.intervals.forEach((e=>{t.push(`${n}|${e}`)}))})),t}l.callbackDispatchers.setDelayedCallbackStatus(null);const S=e=>{const t=e.replace(/\-/g,"/"),n=new Date(t).getTime();if(isNaN(n))return e;const a=(0,g.getCallback)(),o=-(new Date).getTimezoneOffset(),r=a.delayedTimezone,i=60*(o-r)*1e3;const s=new Date(n+i),l=s.getHours(),u=s.getMinutes(),c=s.getDate(),d=s.getMonth(),f=e=>e>9?e:`0${e}`,p=f(u);let h=`${f(l)}:${p}`;b&&"en"==w()&&(h=s.toLocaleString(w(),{hour:"numeric",minute:"numeric",hour12:!0}));return{time:h,date:c,month:d,dateDetail:s}};function w(){const e=i.default.locale;return"no"==e?"nb":e.search("_")?e.split("_")[0]:e}const A=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{month:"long",day:"numeric",hour:"numeric",minute:"numeric"};const a=new Date,i=a.getDate(),s=(0,r.default)("today"),l=new Date((new Date).setDate(i+1)).getDate(),u=(0,r.default)("callback_delayed_period_tomorrow"),c=(0,r.default)("callback_delayed_period_as_possible").toLowerCase(),d="as_soon_as_possible",f=",",p=t.split(y),h=(0,o.default)(p,2),g=h[1],m=e.split(y),_=(0,o.default)(m,2),v=_[0],E=_[1],T=E===d,C=g&&g!==d,O=T&&C?g:E,A=`${v} ${O}`,I=S(A),M=I.time,P=I.date,R=I.month,k=I.dateDetail;if(T)return c.charAt(0).toUpperCase()+c.slice(1);if(b&&P!==i&&P!==l){return k.toLocaleString(w(),n)}{const e=`${f} ${M}`;return P===i?`${s}${e}`:P===l?`${u}${e}`:`${P}.${R} ${e}`}};t.formatLabelText=A},74603:function(e,t,n){"use strict";var a=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.designerApiInit=function(){v.isDesignerEditor&&(T._dAPI=S)};var o=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=b(t);if(n&&n.has(e))return n.get(e);var a={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var r in e)if("default"!==r&&Object.prototype.hasOwnProperty.call(e,r)){var i=o?Object.getOwnPropertyDescriptor(e,r):null;i&&(i.get||i.set)?Object.defineProperty(a,r,i):a[r]=e[r]}a.default=e,n&&n.set(e,a);return a}(n(1039)),r=n(42908),i=a(n(14264)),s=a(n(14762)),l=a(n(27104)),u=a(n(26754)),c=a(n(75686)),d=n(47245),f=n(26932),p=n(65465),h=n(31694),g=a(n(4855)),m=n(81152),_=n(44145),v=n(52028),y=n(69882);function b(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(b=function(e){return e?n:t})(e)}const E=g.default.name("DesignerApi"),T=(0,y.getPageWindow)(),C=(e,t)=>{window.parent._desingerConfig[e]=t},O=()=>{const e=c.default.getComponent(d.Component.ROOT_COMPONENT);e&&e.forceUpdate()},S={showChat(){E.log("showChat"),r.api.open()},showLabel(){E.log("closeChat"),r.api.close()},setAgent(e){E.log("setAgent",{params:e}),s.default.destroy(),s.default.push({agent_id:1,display_name:e.name,title:e.title,avatar_url:e.avatarUrl,body:{state:"join",unsave:!0}}),Object.assign(u.default,{agent_id:1,display_name:e.name,title:e.title,avatar_url:e.avatarUrl}),f.agentsDispatchers.addAgent({id:1,name:e.name,title:e.title,avatarUrl:e.avatarUrl,isBot:!1}),f.chatsDispatchers.setJoinedAgents([{agent_id:1,display_name:e.name,title:e.title,avatar_url:e.avatarUrl}]),f.chatsDispatchers.addJoinedAgent(1),O()},addMessages(e){E.log("addMessages",{messages:e});const t=[];e.forEach((e=>{t.push({from:e.from,from_id:"agent"===e.from?1:null,text:e.text,type:"message",status:"read",created_ts:(new Date).getTime(),body:{unsave:!0}})})),f.messagesDispatchers.addMessages(t)},updateAgent(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;E.log("updateAgent",{params:e,id:t}),Object.assign(u.default,{agent_id:t,display_name:e.name,title:e.title,avatar_url:e.avatarUrl});const n=s.default.getAgentById(t);n&&(n.set("display_name",e.name),n.set("title",e.title),n.set("avatar_url",e.avatar_url)),f.agentsDispatchers.updateAgent({id:t,name:e.name,title:e.title,avatarUrl:e.avatarUrl})},editLastMessage(e){E.log("editLastMessage",{text:e});const t=i.default.getAgentMessages();if(t.length){t[t.length-1].set("text",e);const n=c.default.getComponent(d.Component.SCROLL_CONTAINER);n&&n.forceUpdate()}},cleanMessages(){E.log("cleanMessages"),i.default.destroy(),i.default.trigger("update")},setWidgetColor(e,t){E.log("setWidgetColor",{color:e,color2:t}),f.userDispatchers.setWidgetColor(e),f.userDispatchers.setWidgetColor2(t),O()},setDesktopSettings(e){E.log("setDesktopSettings",e),f.userDispatchers.setPowerGradient(e)},setMobileWidgetColor(e){E.log("setMobileWidgetColor",e),f.userDispatchers.setPowerButtonColor(e)},setCallbackColor(e){E.log("setCallbackColor",{color:e}),(0,o.setConfigParam)("callback_btn_color",e),f.userDispatchers.setCallbackButtonColor(e),O()},setBubbleColor(e){E.log("setBubbleColor",{color:e}),f.userDispatchers.setBubbleColor(e),(0,o.setConfigParam)("bubble_color",e),(0,v.runBind)("setBubbleColor"),O()},setPattern(e){E.log("setPattern",{pattern:e}),f.userDispatchers.setPattern(e),(0,o.setConfigParam)("pattern",e),O()},setWidgetPosition(e,t){E.log("setWidgetPosition",{orientation:e,padding:t});const n=+t;f.userDispatchers.setWidgetOrientation(e),f.userDispatchers.setWidgetPadding(n),(0,o.setConfigParam)("widget_orientation",e),(0,o.setConfigParam)("widget_padding",n),(0,v.runBind)("setWidgetPosition",{orientation:e,padding:n}),O()},setMobileWidgetOrientation(e){E.log("setMobileWidgetOrientation",e),f.userDispatchers.setWidgetMobileOrientation(e)},setMobileBottomOffset(e){E.log("setMobileBottomOffset",e);const t=e||null;f.userDispatchers.setMobileOffsetBottom(t)},setFontColor(e){E.log("setFontColor",{type:e}),"auto"===e&&(e=l.default.isLightColor(o.default.widget_color)?"dark":"light"),(0,o.setConfigParam)("widget_font_color",e),f.userDispatchers.setWidgetFontColor(e),O()},setFontSize(e){E.log("setFontSize",{size:e}),f.userDispatchers.setWidgetFontSize(e),(0,o.setConfigParam)("font_size",e),O()},setFontFamily(e){E.log("setFontFamily",{family:e}),f.userDispatchers.setWidgetFontFamily(e),(0,o.setConfigParam)("font_family",e),O()},setFontType(e){E.log("setFontType",{type:e}),f.userDispatchers.setWidgetFontType(e),(0,o.setConfigParam)("font_type",e),O()},setLabelBubble(e){E.log("setLabelBubble",{bool:e});const t=e?1:0;f.userDispatchers.setWidgetLabelBubble(t),(0,o.setConfigParam)("label_bubble",t)},setOnlineText(e){E.log("setOnlineText",{text:e}),f.userDispatchers.setOnlineLabel(e),(0,o.setConfigParam)("online_widget_label",e),(0,v.runBind)("setOnlineText",e)},setLabelText(e){E.log("setLabelText",{text:e}),"online"===o.default.chat_mode?(f.userDispatchers.setOnlineLabel(e),(0,o.setConfigParam)("online_widget_label",e)):(f.userDispatchers.setOfflineLabel(e),(0,o.setConfigParam)("offline_widget_label",e)),(0,v.runBind)("setLabelText",e)},setOfflineFormText(e){E.log("setOfflineFormText",{text:e});const t=(0,_.getLastMessageByType)(m.MessageType.FOR_TEST);t&&(f.messagesDispatchers.updateMessage({privateId:t.private_id},{text:e}),f.userDispatchers.setOfflineFormText(e),(0,o.setConfigParam)("offline_form_text",e),(0,v.runBind)("setOfflineFormText",e))},setChatOnline(){E.log("setChatOnline"),C("chat_mode","online"),(0,o.setConfigParam)("chat_mode","online"),(0,v.runBind)("setChatOnline"),O()},setChatOffline(){E.log("setChatOffline"),C("chat_mode","offline"),(0,o.setConfigParam)("chat_mode","offline"),(0,v.runBind)("setChatOffline"),O()},addPrechat(e){S.cleanPrechat(),E.log("addPrechat",{prechats:e}),(0,o.setConfigParam)("prechat",e),(0,o.setConfigParam)("enable_prechat",1),p.messageActions.pushPrechat(),f.featuresDispatchers.enablePrechat(!0),f.userDispatchers.setPrechat(e)},updatePrechats(e){if(E.log("updatePrechats",{prechats:e}),!e)return;c.default.getComponent(d.Component.PRECHAT)&&h.PrechatEmitter.emit("updatePrechatText",e)},cleanPrechat(){E.log("cleanPrechat"),p.messageActions.deletePrechatMsg(),i.default.trigger("update")},setMobileView(e){let t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).target;e?f.designerDispatchers.updateDesignerSettings({isMobileView:e,mobileRenderTarget:t}):f.designerDispatchers.updateDesignerSettings({isMobileView:!1,mobileRenderTarget:""})}}},52028:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.designerBind=function(e,t){if(!r)return;void 0!==o[e]||(o[e]=[]),o[e].push(t)},t.isDesignerEditor=void 0,t.runBind=function(e,t){void 0!==o[e]&&o[e].forEach((e=>{e(t)}))};var a=n(97615);const o={},r=a.EnvironmentManager.isDesignerEditor();t.isDesignerEditor=r},19955:function(e,t,n){"use strict";var a=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=a(n(33119)),r=a(n(92664));a(n(4855)).default.name("Device");let i=function(){function e(t){(0,o.default)(this,e),this.userAgent=t,this._find=function(e){const t={};return function(){const n=arguments.length<=0?void 0:arguments[0];if(n in t)return t[n];{const a=e(n);return t[n]=a,a}}}(this._find.bind(this)),this.initialize(),this.initializeSupportedFeatures()}return(0,r.default)(e,[{key:"initialize",value:function(){this.isWindows=this._find("windows"),this.isOpera=this._find("opera")||this._find("opr")||this._find("presto"),this.isOperaMini=this.isOpera&&(this._find("mini")||this._find("opios")),this.isFirefox=this._find("firefox"),this.isChrome=this._find("chrome"),this.isChromeIOS=this._find("crios"),this.isHeyTap=this._find("heytapbrowser"),this.isSafari=this._find("safari")&&!this.isChrome&&!this.isChromeIOS&&!this.isHeyTap,this.isEdge=this._find("edge"),this.isIe=this._find("msie")||this._find("trident")||this.isEdge,this.isIeOrEdge=this.isIe||this._find("lumia"),this.isIpod=this._find("ipod"),this.isIpad=this._find("ipad")||this._find("macintosh")&&"ontouchend"in window,this.isIphone=!this.isWindows&&this._find("iphone"),this.isIos=this.isIphone||this.isIpod||this.isIpad,this.isAndroid=!this.isWindows&&this._find("android"),this.isAndroidPhone=this.isAndroid&&this._find("mobile"),this.isAndroidTablet=this.isAndroid&&!this._find("mobile"),this.isBlackberry=this._find("blackberry")||this._find("bb10")||this._find("rim"),this.isBlackberryPhone=this.isBlackberry&&!this._find("tablet"),this.isBlackberryTablet=this.isBlackberry&&this._find("tablet"),this.isWindowsPhone=this.isWindows&&this._find("phone"),this.isWindowsTablet=this.isWindows&&this._find("touch")&&!this.isWindowsPhone&&!this._find("trident"),this.isMobile=this.isAndroidPhone||this.isIphone||this.isIpod||this.isWindowsPhone||this.isBlackberryPhone,this.isTablet=this.isIpad||this.isAndroidTablet||this.isBlackberryTablet||this.isWindowsTablet,this.isMobileOrTablet=this.isMobile||this.isTablet,this.isDesktop=!this.isMobile&&!this.isTablet,this.isYandexBot=-1!==this.userAgent.search(/\+http:\/\/yandex\.com\/bots/gi),this.isGoogleBot=-1!==this.userAgent.search(/google/gi),this.isOperaMobile=this.isOperaMini||this.isOpera&&this.isMobileOrTablet;let e=/OS (\d+)_(\d+)_?(\d+)?/.exec(window.navigator.appVersion);e||(e=/version\/(\d+).(\d+)?/.exec(this.userAgent)),this.iosVer=e?parseFloat(e[1]+"."+e[2]):null,this.isMac=window.navigator.platform.includes("Mac");let t=/OS X (\d+)_(\d+)_?(\d+)?/.exec(window.navigator.appVersion);window.navigator.oscpu&&(t=/OS X (\d+)[._](\d+)([._])?(\d+)?/.exec(window.navigator.oscpu)),this.macVer=t?parseFloat(t[1]+"."+t[2]):null,this.device=null,this.isDesktop?this.device="desktop":this.isMobile?this.device="mobile":this.isTablet&&(this.device="tablet")}},{key:"initializeSupportedFeatures",value:function(){try{localStorage.setItem("testLocalStorage","ok"),localStorage.removeItem("testLocalStorage"),this.isLocalStorageSupported=!0}catch(e){this.isLocalStorageSupported=!1}try{new File([],""),this.isImageResizeSupported="FileReader"in window&&"File"in window&&"Blob"in window}catch(e){this.isImageResizeSupported=!1}this.isCssVariablesSupported=window.CSS&&CSS.supports&&CSS.supports("color","var(--fake-var)")||!1,this.isWebAnimationApiSupported=!!window.KeyframeEffect,this.isPassiveListenersSupported=!1;try{var e=Object.defineProperty({},"passive",{get:()=>(this.isPassiveListenersSupported=!0,this.isPassiveListenersSupported)});window.addEventListener("test",null,e)}catch(e){this.isPassiveListenersSupported=!1}}},{key:"operaMini",value:function(){return this.isOperaMini}},{key:"firefox",value:function(){return this.isFirefox}},{key:"safari",value:function(){return this.isSafari}},{key:"chrome",value:function(){return this.isChrome}},{key:"ieOrEdge",value:function(){return this.isIeOrEdge}},{key:"ie",value:function(){return this.isIe}},{key:"edge",value:function(){return this.isEdge}},{key:"ios",value:function(){return this.isIos}},{key:"ipad",value:function(){return this.isIpad}},{key:"chromeIOS",value:function(){return this.isChromeIOS}},{key:"android",value:function(){return this.isAndroid}},{key:"windowsPhone",value:function(){return this.isWindowsPhone}},{key:"mobile",value:function(){return this.isMobile}},{key:"tablet",value:function(){return this.isTablet}},{key:"mobileOrTablet",value:function(){return this.isMobileOrTablet}},{key:"desktop",value:function(){return this.isDesktop}},{key:"iosVersion",value:function(){return this.iosVer}},{key:"macVersion",value:function(){return this.macVer}},{key:"getDevice",value:function(){return this.device}},{key:"supportsPassiveListeners",value:function(){return this.isPassiveListenersSupported}},{key:"supportsCssVariables",value:function(){return this.isCssVariablesSupported}},{key:"supportsWebAnimationApi",value:function(){return this.isWebAnimationApiSupported}},{key:"supportsImageResize",value:function(){return this.isImageResizeSupported}},{key:"supportsLocalStorage",value:function(){return this.isLocalStorageSupported}},{key:"supportsIMessage",value:function(){return(this.ios()||this.ipad())&&this.iosVersion()>=11.3}},{key:"isMacintosh",value:function(){return this.isMac}},{key:"supportsAbc",value:function(){return this.isMacintosh()&&this.macVersion()>=10.15}},{key:"yandexBot",value:function(){return this.isYandexBot}},{key:"googleBot",value:function(){return this.isGoogleBot}},{key:"isPointerEnabled",value:function(){return"PointerEvent"in window}},{key:"isTouchEnabled",value:function(){return"ontouchstart"in window}},{key:"_find",value:function(e){return-1!==this.userAgent.indexOf(e)}}]),e}();var s=new i(window.navigator.userAgent.toLowerCase());t.default=s},43025:function(e,t,n){"use strict";var a=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.addClass=function(e,t){if(p)(0,i.each)(g(t),(function(t){e&&e.classList.add(t)})),e&&h(e);else{const n=m(e),a=(0,l.union)(n,g(t));_(e,a)}},t.addNewLine=function(e,t){if(!e)return!1;const n=e.selectionStart,a=t.substring(0,n),o=t.substring(n,t.length);n!==e.value.length?(e.value=`${a}\r\n${o}`,e.setSelectionRange(n,n)):(e.value+="\r\n",e.scrollTop=e.scrollHeight);return e.value},t.addNoTranslateClass=function(e){return e.className+=" notranslate",e},t.blurActiveElement=function(){const e=(0,d.getPageWindow)().document.activeElement;e&&"function"==typeof e.blur&&e.blur()},t.getComputedStyleAll=v,t.getElementPosition=function(e){if(!e)return{width:0,height:0,top:0,left:0,windowWidth:0,windowHeight:0};const t=e.ownerDocument,n=t.defaultView||t.parentWindow;let a={left:0,top:0,width:0,height:0,minLeft:0};if(e.getBoundingClientRect){const t=e.getBoundingClientRect();a=t.toJSON?(0,u.extend)(a,t.toJSON()):t}return a.width=e.offsetWidth,a.height=e.offsetHeight,a.windowWidth=n.innerWidth,a.windowHeight=n.innerHeight,a},t.getInnerHeight=function(e){const t=e.clientHeight,n=v(e,"paddingTop"),a=v(e,"paddingBottom");return t-parseFloat(n)-parseFloat(a)},t.getInnerWidth=function(e){const t=e.clientWidth,n=getComputedStyle(e),a=n.paddingLeft,o=n.paddingRight;return t-parseFloat(a)-parseFloat(o)},t.getNextSiblingNodeFocus=function(e){if(e.keyCode&&13==e.keyCode){const t=e.currentTarget.parentNode.nextElementSibling;let n=t.querySelector("input");if(n||(n=t.querySelector("jdiv")||t.querySelector("textarea")),!n)return;if(-1!==["INPUT","TEXTAREA"].indexOf(n.tagName)&&n.focus)n.focus();else{const e=o.default.tablet()?"touchstart":"click",t=document.createEvent("MouseEvents");t.initEvent(e,!0,!0),n.dispatchEvent(t)}}},t.getScrollBarWidth=function(){if(o.default.mobileOrTablet())return 0;if(void 0!==f)return f;const e=document.createElement("div");if(e.style.visibility="hidden",e.style.width="100px",!document||!document.body)return f;document.body.appendChild(e);const t=e.offsetWidth;e.style.overflow="scroll";const n=document.createElement("div");n.style.width="100%",e.appendChild(n);const a=n.offsetWidth;return e.parentNode.removeChild(e),f=t-a,f},t.hasClass=function(e,t){return p?e.classList.contains(t):""!==e.className&&m(e).includes(t)},t.isInput=function(e){if(!e)return;return-1!==["INPUT","TEXTAREA"].indexOf(e.tagName)},t.isNoScroll=function(e,t){if(e&&e.base&&t){return e.getScrollHeight()e.getClientHeight()}},t.isParentA=function(e){return e&&e.target&&e.target.parentNode&&"A"===e.target.parentNode.tagName},t.isScrolledIntoView=function(e,t){if(e&&t&&t.base){if(t.getScrollTop()<100)return!0;const n=t.base,a=e.getBoundingClientRect(),o=a.top,r=a.bottom,i=a.height,s=n.getBoundingClientRect();return o<=s.top?s.top-o<=i:r-s.bottom<=i}return!1},t.isTextArea=function(e){if(!e)return;return"TEXTAREA"==e.tagName},t.isVisible=function(e){return e&&e.offsetWidth>0&&e.offsetHeight>0},t.pageVisible=function(){if("visibilityState"in document)return"visible"===document.visibilityState;if("webkitVisibilityState"in document)return"visible"===document.webkitVisibilityState;return!1},t.removeClass=function(e,t){if(p)(0,i.each)(g(t),(function(t){e&&e.classList.remove(t)})),e&&h(e);else{const n=m(e),a=(0,s.difference)(n,g(t));_(e,a)}};var o=a(n(19955)),r=n(90872),i=n(9393),s=n(34548),l=n(76784),u=n(60277),c=a(n(4855)),d=n(69882);c.default.name("DomUtils");let f;const p="classList"in document.documentElement;function h(e){e.offsetHeight}function g(e){return(0,r.isArray)(e)?e:e.replace(/^\s+|\s+$/g,"").split(/\s+/)}function m(e){return g(e.className)}function _(e,t){const n=t.join(" ");e.className!==n&&(e.className=n,h(e))}function v(e,t){if(e)return e.currentStyle?e.currentStyle[t]:window.getComputedStyle&&window.getComputedStyle(e,null)?window.getComputedStyle(e,null)[t]:e.style[t]}},26411:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;const a=n(97615).EnvironmentManager.getAllowedFileTypes();var o=a&&a.length?a:[{extension:"rar",mimeType:"application/vnd.rar"},{extension:"tar",mimeType:"application/x-tar"},{extension:"7z",mimeType:"application/x-7z-compressed"},{extension:"djvu",mimeType:"image/vnd.djvu"},{extension:"json",mimeType:"application/json"},{extension:"log",mimeType:"text/plain"},{extension:"ppt",mimeType:"application/vnd.ms-powerpoint"},{extension:"xls",mimeType:"application/vnd.ms-excel"},{extension:"doc",mimeType:"application/msword"},{extension:"docx",mimeType:"application/vnd.openxmlformats-officedocument.wordprocessingml.document"},{extension:"rtf",mimeType:"application/rtf"},{extension:"ttf",mimeType:"font/ttf"},{extension:"psd",mimeType:"image/vnd.adobe.photoshop"},{extension:"odt",mimeType:"application/vnd.oasis.opendocument.text"},{extension:"pdf",mimeType:"application/pdf"},{extension:"aac",mimeType:"audio/aac"},{extension:"avi",mimeType:"video/x-msvideo"},{extension:"csv",mimeType:"text/csv"},{extension:"epub",mimeType:"application/epub+zip"},{extension:"gz",mimeType:"application/gzip"},{extension:"gif",mimeType:"image/gif"},{extension:"ics",mimeType:"text/calendar"},{extension:"jpeg",mimeType:"image/jpeg"},{extension:"jpg",mimeType:"image/jpeg"},{extension:"mp3",mimeType:"audio/mpeg"},{extension:"mpeg",mimeType:"video/mpeg"},{extension:"oga",mimeType:"audio/ogg"},{extension:"ogv",mimeType:"video/ogg"},{extension:"png",mimeType:"image/png"},{extension:"svg",mimeType:"image/svg+xml"},{extension:"txt",mimeType:"text/plain"},{extension:"vsd",mimeType:"application/vnd.visio"},{extension:"wav",mimeType:"audio/wav"},{extension:"weba",mimeType:"audio/webm"},{extension:"webm",mimeType:"video/webm"},{extension:"webp",mimeType:"image/webp"},{extension:"zip",mimeType:"application/zip"},{extension:"zip",mimeType:"application/x-zip-compressed"},{extension:"mp4",mimeType:"application/mp4"},{extension:"mp4",mimeType:"video/mp4"},{extension:"mp4a",mimeType:"audio/mp4"},{extension:"mov",mimeType:"video/quicktime"},{extension:"html",mimeType:"text/html"},{extension:"htm",mimeType:"text/html"},{extension:"css",mimeType:"text/css"},{extension:"ods",mimeType:"application/vnd.oasis.opendocument.spreadsheet"},{extension:"odp",mimeType:"application/vnd.oasis.opendocument.presentation"},{extension:"pptx",mimeType:"application/vnd.openxmlformats-officedocument.presentationml.presentation"},{extension:"xlsx",mimeType:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"}];t.default=o},2439:function(e,t,n){"use strict";var a=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=a(n(33119)),r=a(n(92664)),i=n(12494),s=n(21434),l=n(52274),u=a(n(26411));let c=function(){function e(t){(0,o.default)(this,e),this.file=t,this.fileExtension=(0,s.fileName)(t.name).ext,this.fileMimeType=t.type,this.fileSize=t.size,this.reason=null}return(0,r.default)(e,[{key:"isValid",value:function(){return this.isAllowedFileSize()&&this.isAllowedExtensionAndMime()}},{key:"getReason",value:function(){return this.reason}},{key:"isAllowedExtensionAndMime",value:function(){if(!this.fileExtension)return this.reason=i.FileUploadError.NO_EXTENSION,!1;for(let e=0;el.MAX_FILE_SIZE)||(this.reason=i.FileUploadError.FILE_SIZE_EXCEEDED,!1)}}]),e}();t.default=c},69625:function(e,t,n){"use strict";var a=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.mediaUploader=void 0;var o=a(n(61125)),r=a(n(33119)),i=a(n(92664)),s=n(54415),l=n(83170),u=n(44145),c=a(n(2439)),d=n(12494),f=n(52274),p=n(83778),h=n(58271),g=n(53489),m=n(21434),_=a(n(84726)),v=n(77294),y=n(81152),b=n(26932),E=n(95911),T=n(82956);function C(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function O(e){for(var t=1;t{const t=e.data;return this.metadata=t.metadata,this.sign=t.sign,this.ts=t.ts,this.media_server_url=t.url,s.Monitoring.telemetry(l.TelemetryName.MEDIA_SIGN,{param1:JSON.stringify(O(O({},t),{},{sign:t.sign[0]})),param2:this.file_name||"none"}),t})).catch((e=>{S.error("Upload file error",e),s.Monitoring.telemetry(l.TelemetryName.MEDIA_SIGN_ERROR),this.setMessageError(d.FileUploadError.REQUEST_FAILED)}))}},{key:"onUploadProgress",value:function(e){const t=this.mediaMessage;if(t){var n;if(t.body.status===y.MediaStatus.ERROR)null===(n=this.currentQuery)||void 0===n||n.call(this);b.messagesDispatchers.updateMessage({privateId:t.private_id},{body:O(O({},t.body),{},{loadedSize:e.loaded})})}}},{key:"uploadFile",value:async function(){var e;S.warn("uploadFile");const t=(0,h.bytesToMB)(null!==(e=this.file.size)&&void 0!==e?e:5),n=3e4*Math.ceil(t),a=(0,T.createCancelablePromise)(E.promisedRequest.put(`${this.media_server_url}/${this.file_name}?ts=${this.ts}&sign=${this.sign}&public`,{timeout:n,headers:{"Content-Type":this.file.type,"X-Metadata":this.metadata},body:this.file,onUpload:e=>this.onUploadProgress(e)})),o=a.promise,r=a.cancel,i=a.isCanceled;this.currentQuery=r,await o.then((e=>{const t=e.headers.location||e.headers.Location;S.warn("uploadFile",t,e);const n=this.mediaMessage;if(b.messagesDispatchers.updateMessage({privateId:n.private_id},{body:O(O({},n.body),{},{unsave:null})}),!t)return b.messagesDispatchers.updateMessage({privateId:n.private_id},{body:O(O({},n.body),{},{status:y.MediaStatus.ERROR,error:(0,_.default)("file_upl_error")})}),void s.Monitoring.telemetry(l.TelemetryName.FILE_UPLOAD_NO_LOCATION,{param1:this.file_name,param2:JSON.stringify(e.headers),param3:e.status});this.onSuccess({fullUrl:this.media_server_url+e.headers.location})})).catch((e=>{i?(S.warn("Upload canceled"),this.setMessageError(d.FileUploadError.UPLOAD_CANCELED)):(S.error("Upload file error",e),this.setMessageError(d.FileUploadError.REQUEST_FAILED))}))}},{key:"getError",value:function(e){if(e){let t=(0,_.default)("file_upl_error"),n=null;switch(e){case d.FileUploadError.FILE_SIZE_EXCEEDED:t=(0,_.default)("file_upl_error_max_size").replace("_FILESIZE_",(0,h.fileSize)(f.MAX_FILE_SIZE)),n={param1:d.FileUploadError.FILE_SIZE_EXCEEDED};break;case d.FileUploadError.UPLOAD_CANCELED:t=(0,_.default)("file_upl_cancel"),n={param1:d.FileUploadError.UPLOAD_CANCELED};break;case d.FileUploadError.NO_EXTENSION:t=(0,_.default)("file_upl_error_no_ext"),n={param1:d.FileUploadError.NO_EXTENSION};break;case d.FileUploadError.RESTRICTED_FILE_TYPE:t=(0,_.default)("file_upl_error"),n={param1:(0,m.fileName)(this.file.name).ext,param2:d.FileUploadError.RESTRICTED_FILE_TYPE};break;case d.FileUploadError.REQUEST_FAILED:n={param1:d.FileUploadError.REQUEST_FAILED}}return n&&s.Monitoring.telemetry(l.TelemetryName.FILE_UPLOAD_ERROR,n),t}}},{key:"setMessageError",value:function(e){const t=this.getError(e),n=this.mediaMessage;n&&(b.messagesDispatchers.updateMessage({privateId:n.private_id},{body:O(O({},n.body),{},{status:"error"}),status:y.MessageStatus.DELIVERED}),t&&b.messagesDispatchers.updateMessage({privateId:n.private_id},{body:O(O({},n.body),{},{error:t})}))}},{key:"checkIfFileReadIsNeeded",value:function(e){if(S.warn("checkIfFileReadIsNeeded",e.type),"photo"===(0,p.detectType)(e.type)&&"FileReader"in window)try{return this.readFileContent(e),!0}catch(e){return this.setMessageError(),!1}}},{key:"checkFileInfo",value:function(e){const t=new c.default(e);if(t.isValid())return this.checkIfFileReadIsNeeded(e),!0;{const e=t.getReason();return this.setMessageError(e),!1}}},{key:"readFileContent",value:function(e){const t=new FileReader;t.onload=function(){const n=new Image;n.onload=function(){e.width=n.width,e.height=n.height,S.warn("readFileContent",e)},n.onerror=e=>{S.log("FileReader error",e),s.Monitoring.telemetry(l.TelemetryName.FILE_UPLOAD_ERROR,{param1:"image_generate_failed"})},n.src=t.result},t.onprogress=function(){},t.readAsDataURL(e)}},{key:"startUpload",value:async function(e,t,n){if(!t)return!1;if(this.file=t,this.file_name=(0,g.sanitize)(t.name),this.onSuccess=n,this.mediaMessage=e,this.checkFileInfo(t)){await this.getSign()&&await this.uploadFile()}}}]),e}());t.mediaUploader=w},99012:function(e,t,n){"use strict";var a=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.initCallTouch=function(){if(o.default.enable_calltouch){const e=(0,r.getPageWindow)(),t=(0,i.getClient)();if("function"==typeof e.ct){s.log("init");try{const n=e.ct("calltracking_params");n&&n.length&&n.forEach((n=>{const a=`{"site_id": ${o.default.site_id}, "widget_id": "${o.default.widget_id}", "visitor_id": "${t.visitorId}"}`;s.log("set attr:",a),e.ct(n.modId,"set_attrs",a)}))}catch(e){s.error("Fail to sync with calltouch",e)}}}};var o=a(n(1039)),r=n(69882),i=n(44145);const s=a(n(4855)).default.name("CallTouch","color: grey")},22618:function(e,t,n){"use strict";var a=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.initVideoForce=function(){const e=o.default.integrations;if(e&&e.videoforce){const t="https://widget.videoforce.io/";try{const n=document.createElement("script");n.src=t+e.videoforce,n.crossorigin="anonymous",n.async="true";const a=(0,r.getPageWindow)().jivo_cspNonce;a&&n.setAttribute("nonce",a);const o=(0,r.getPageWindow)().document.getElementsByTagName("script")[0];o.parentNode.insertBefore(n,o)}catch(e){i.Monitoring.reportException(e)}}};var o=a(n(1039)),r=n(69882),i=n(54415)},55908:function(e,t,n){"use strict";var a=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=a(n(33119)),r=a(n(92664)),i=n(44733),s=n(99040);const l=a(n(4855)).default.name("AbTestManager");let u=null,c=function(){function e(){if((0,o.default)(this,e),u)return u;this.activeTest=null,this.storeName="abTests",this._initialize(),this._cleanUp(),u=this}return(0,r.default)(e,[{key:"testIsActive",value:function(e){return this.activeTest&&this.activeTest.name===e}},{key:"getActiveTest",value:function(){return this.activeTest?this.activeTest:null}},{key:"getGroup",value:function(e){return this.testIsActive(e)?this.activeTest.chosenGroup:null}},{key:"getNumberOfGroupsInTest",value:function(e){return this.testIsActive(e)?this.activeTest.numberOfGroups:null}},{key:"isInTestGroup",value:function(e,t){return this.getGroup(e)===t}},{key:"getActiveTestAsString",value:function(){return this.activeTest?`${this.activeTest.name},${this.activeTest.chosenGroup}`:null}},{key:"getActiveTestName",value:function(){return this.activeTest?this.activeTest.name:null}},{key:"getActiveTestGroup",value:function(){return this.activeTest?this.activeTest.chosenGroup:null}},{key:"_initialize",value:function(){if(s.ACTIVE_TEST){const e=this._getSavedTestGroup(s.ACTIVE_TEST.name);this.activeTest={name:s.ACTIVE_TEST.name,numberOfGroups:s.ACTIVE_TEST.groups,chosenGroup:e||this._getRandomGroupNumber(s.ACTIVE_TEST.groups)},i.StorageProvider.set(this.storeName,this.activeTest),l.log("Ab-testing is ebabled.",`TestName: ${this.getActiveTestName()}.`,`Group: ${this.getActiveTestGroup()}.`)}}},{key:"_getRandomGroupNumber",value:function(e){return Math.floor(Math.random()*e)+1}},{key:"_getSavedTestGroup",value:function(e){const t=i.StorageProvider.get(this.storeName);return t&&t.name===e?t.chosenGroup:null}},{key:"_cleanUp",value:function(){this.activeTest||i.StorageProvider.remove(this.storeName)}}],[{key:"getInstance",value:function(){return u}}]),e}();t.default=c},97615:function(e,t,n){"use strict";var a=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.EnvironmentManager=void 0;var o=a(n(33119)),r=a(n(92664)),i=n(87884),s=n(68403);const l=new(function(){function e(){(0,o.default)(this,e),this.env="production",this.version="102.11.0",this.loaderVersion="0.1",this.branch="HEAD_3eaff2a",this.allowedFiles=JSON.parse("[]")||null,this.isDesigner=this._checkIfDesignerEditor(),this.isCampaignPopupConstructor=this._checkIfCampaignPopupConstructor()}return(0,r.default)(e,[{key:"isProduction",value:function(){return this.env===i.Environment.PRODUCTION}},{key:"isTesting",value:function(){return this.env===i.Environment.TESTING}},{key:"isDevelopment",value:function(){return this.env===i.Environment.DEVELOPMENT}},{key:"isSelfhosted",value:function(){return Boolean(!1)}},{key:"getVersion",value:function(){return this.version}},{key:"getLoaderVersion",value:function(){return this.loaderVersion}},{key:"getBranch",value:function(){return this.branch}},{key:"getAllowedFileTypes",value:function(){return this.allowedFiles}},{key:"getWindow",value:function(){return window.parent||window}},{key:"isPartnerApp",value:function(){return this.getWindow().jivo_partner||!1}},{key:"isDesignerEditor",value:function(){return this.isDesigner}},{key:"isPopupConstructor",value:function(){return this.isCampaignPopupConstructor}},{key:"isApp",value:function(){return new RegExp(/^(app|app3|app3alpha|app3beta)\.(jivosite\.com|jivo\.ru)$/i).test(this.getPageHost())}},{key:"getPageHost",value:function(){return this.getWindow().location.host}},{key:"isSignUpPage",value:function(){return new RegExp(/.*\/signup\.html/i).test(this.getWindow().location.pathname)}},{key:"isRegPage",value:function(){return this.isProduction()?this.isApp()&&this.isSignUpPage():this.isSignUpPage()}},{key:"isDesignerPage",value:function(){return this.getWindow()._jivoDesigner}},{key:"isCampaignPopupConstructorPage",value:function(){return this.getWindow()._jivoCampaignPopupConstructor}},{key:"isJsApiAvaiable",value:function(){return!!(0,s.isPaidCustomer)()||(this.isApp()||this.isRegPage()||this.isSignUpPage()||this.isDesignerEditor()||this.isPopupConstructor()||this.isPartnerApp())}},{key:"_checkIfCampaignPopupConstructor",value:function(){const e=this.isProduction(),t=e&&this.isApp();return Boolean(this.isCampaignPopupConstructorPage())&&(t||!e)}},{key:"_checkIfDesignerEditor",value:function(){const e=this.isProduction(),t=e&&this.isApp();return!(!this.isDesignerPage()||!t&&e&&!this.isSelfhosted())}}]),e}());t.EnvironmentManager=l},71323:function(e,t,n){"use strict";var a=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=a(n(33119)),r=a(n(92664)),i=a(n(1039)),s=a(n(19955)),l=n(54415),u=n(83170),c=a(n(35802)),d=n(41504),f=n(26932);a(n(4855)).default.name("EulaManager");var p=new(function(){function e(){(0,o.default)(this,e),this.context=null,this.eulaLink=null}return(0,r.default)(e,[{key:"showEula",value:function(e,t,n){i.default.eula&&(f.appDispatchers.setShowEula(e),t&&(this.eulaLink=t),s.default.desktop()&&document.activeElement&&"function"==typeof document.activeElement.blur&&document.activeElement.blur(),n&&(this.context=n,l.Monitoring.telemetry(u.TelemetryName.EULA_SHOWN,{param1:n})))}},{key:"acceptEula",value:function(){if(f.clientDispatchers.setEulaAccepted(!0),"cb"===this.context){const e=new d.AcceptEula,t=c.default.getInstance();if(t){const n=t.managers.connection;n&&n.isOpen()&&n.send(e)}}l.Monitoring.telemetry(u.TelemetryName.EULA_ACCEPTED,{param1:this.context})}}]),e}());t.default=p},69144:function(e,t,n){"use strict";var a=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=a(n(33119)),r=a(n(92664)),i=a(n(1039)),s=a(n(4855)),l=n(3571);s.default.name("FeatureManager");var u=function(){function e(){(0,o.default)(this,e),this.features={[l.Feature.RECAPTCHA]:i.default.enable_antispam&&i.default.recaptcha}}return(0,r.default)(e,[{key:"isEnabled",value:function(e){return this.features[e]||!1}}]),e}();t.default=u},32149:function(e,t,n){"use strict";var a=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=a(n(33119)),r=a(n(92664)),i=a(n(4855)),s=n(47060),l=n(21476),u=n(54415),c=n(83170),d=a(n(19955)),f=n(31802),p=n(44145),h=n(69882);const g=i.default.name("HistoryManager");let m=null;var _=function(){function e(){if((0,o.default)(this,e),m)return m;this.initHash=this.getLocation().hash,this.initHref=this.getLocationWithoutHash(),m=this}return(0,r.default)(e,[{key:"setHistoryState",value:function(){g.log("setHistoryState");const e=(0,h.getPageWindow)(),t=e.history,n=e.location;(!t.state||t.state&&"number"!=typeof t.state.jmobile)&&t.pushState({jmobile:1},n.title,n.href),t.replaceState({jmobile:1},n.title,n.href)}},{key:"checkPopState",value:function(){g.log("checkPopState");const e=(0,p.getApp)().route;this.initHash!==this.getLocation().hash&&this.initHref===this.getLocationWithoutHash()||(this.initHash=this.getLocation().hash,this.initHref=this.getLocationWithoutHash(),d.default.mobileOrTablet()&&e!==s.Route.LABEL&&((0,f.closeWidget)(),l.Router.next(s.RouterEvent.CloseWindow),u.Monitoring.telemetry(c.TelemetryName.MOBILE_CHAT_CLOSE,{param1:"byBack"})))}},{key:"getLocation",value:function(){return(0,h.getPageWindow)().location}},{key:"getLocationWithoutHash",value:function(){const e=this.getLocation();return e.href.replace(e.hash,"")}}],[{key:"getInstance",value:function(){return m}}]),e}();t.default=_},45493:function(e,t,n){"use strict";var a=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=a(n(33119)),r=a(n(92664)),i=a(n(19955));a(n(4855)).default.name("LoaderContextManager");let s=null;var l=function(){function e(t,n){if((0,o.default)(this,e),s)return s;this.appStore=n,this.appStore.addListener((()=>{this.updateChatStarted()})),this.storeName="jv_loader_info_"+t,this.store={},i.default.supportsLocalStorage()&&(this.store=JSON.parse(localStorage.getItem(this.storeName))||{}),s=this}return(0,r.default)(e,[{key:"setInStore",value:function(e,t){this.store[e]=t,this.saveStore()}},{key:"saveStore",value:function(){i.default.supportsLocalStorage()&&localStorage.setItem(this.storeName,JSON.stringify(this.store))}},{key:"updateChatStarted",value:function(){this.store.isChatStarted!==this.appStore.chat_started&&(this.store.isChatStarted=this.appStore.chat_started,this.saveStore())}}],[{key:"getInstance",value:function(){return s}}]),e}();t.default=l},16500:function(e,t,n){"use strict";var a=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=a(n(33119)),r=a(n(92664)),i=n(21951),s=n(43025);const l=a(n(4855)).default.name("PageVisibilityManager");var u=new(function(){function e(){(0,o.default)(this,e),this.pageVisible=(0,s.pageVisible)(),this.subscribers=[],(0,i.listenVisibility)((()=>{this.pageVisible=(0,s.pageVisible)(),l.log("Page visibility changed to:",this.pageVisible),this.fireSubscriptions(this.pageVisible)}))}return(0,r.default)(e,[{key:"fireSubscriptions",value:function(e){this.subscribers.forEach((t=>{t(e)}))}},{key:"subscribe",value:function(e){this.subscribers.push(e)}},{key:"unsubscribe",value:function(e){this.subscribers=this.subscribers.filter((t=>{if(t!==e)return t}))}}]),e}());t.default=u},51094:function(e,t,n){"use strict";var a=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=a(n(33119)),r=a(n(92664)),i=n(26932),s=n(62168);const l=a(n(4855)).default.name("PermissionManager");var u=function(){function e(){(0,o.default)(this,e),this.allowedMics=[],this.allMics=[],this.allSpeakers=[],this.getAllDevices()}return(0,r.default)(e,[{key:"checkAudio",value:async function(){if(!navigator.mediaDevices)return l.warn("can't check mic access - old browser"),i.permissionsDispatchers.updatePermission(s.Permission.AUDIO,s.PermissionStatus.BLOCKED),s.PermissionStatus.BLOCKED;{await this.getAllDevices(),l.log("start check mic access");let e=null;try{e=await navigator.mediaDevices.getUserMedia({audio:!0}),l.log("mic is allowed");const t=e.getTracks();return t.forEach((e=>e.stop())),this.allowedMics=t,i.permissionsDispatchers.updatePermission(s.Permission.AUDIO,s.PermissionStatus.ALLOWED),s.PermissionStatus.ALLOWED}catch(e){return l.warn("mic is not allowed",e),i.permissionsDispatchers.updatePermission(s.Permission.AUDIO,s.PermissionStatus.BLOCKED),s.PermissionStatus.BLOCKED}}}},{key:"getAllDevices",value:async function(){if(navigator.mediaDevices&&navigator.mediaDevices.enumerateDevices){const e=await navigator.mediaDevices.enumerateDevices();this.allMics=e.filter((e=>"audioinput"===e.kind)),this.allSpeakers=e.filter((e=>"audiooutput"===e.kind))}}}]),e}();t.default=u},50216:function(e,t,n){"use strict";var a=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=a(n(33119)),r=a(n(92664)),i=n(83170),s=n(26932),l=n(64123),u=n(95911),c=n(69882);const d=a(n(4855)).default.name("RecaptchaManager");let f=function(){function e(t,n){(0,o.default)(this,e),this.application=t,this.token=n,this.recaptchaWidgetIndex=null,this.grecaptcha=null,this.blocked=null}return(0,r.default)(e,[{key:"isBlocked",value:function(){return this.blocked}},{key:"addRecaptchaToPage",value:function(){d.log("Insertion of reCaptcha code",this.token);const e=(0,c.getPageWindow)(),t=e.document.head,n=e.document.createElement("script");n.async=!0,n.src="//google.com/recaptcha/api.js?render=explicit&onload=jivo_onRecaptchaLoadCallback",e.jivo_onRecaptchaLoadCallback=this.onLoadCallback.bind(this),t.appendChild(n)}},{key:"onLoadCallback",value:function(){d.log("onLoadCallback"),this.grecaptcha=(0,c.getPageWindow)().grecaptcha,this.recaptchaWidgetIndex=this.grecaptcha.render({sitekey:this.token,badge:"bottomleft"}),this.application.managers.connection.open()}},{key:"getToken",value:function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"startup";d.log("getToken",n),this.grecaptcha.ready((()=>{d.log("Get recaptcha token"),this.grecaptcha.execute(this.recaptchaWidgetIndex,{action:n}).catch((e=>{this.onTokenFailure(e,t)})).then((n=>{this.onTokenSuccess(n,e,t)}))}))}},{key:"getRecaptchaHandleUrl",value:function(e){const t=this.application.reduxStore.getState();return(0,c.getProtocol)()+this.application.config.base_url+`/script/recaptcha-token/${encodeURIComponent(this.application.config.widget_id)}?visitor_id=${encodeURIComponent(t.client.visitorId)}&token=${encodeURIComponent(e)}`}},{key:"onTokenSuccess",value:function(e,t,n){e&&(d.log("Recaptcha token received",e),u.xhrRequest.get(this.getRecaptchaHandleUrl(e),((e,a)=>{if(e)return this.application.managers.monitoring.telemetry(i.TelemetryName.RECAPTCHA_ERROR,{param1:"Server error: "+JSON.stringify(e)});const o=a.data;return o.ok&&o.token?(s.clientDispatchers.setCaptchaToken(o.token),this.application.managers.monitoring.telemetry(i.TelemetryName.RECAPTCHA_SUCCESS,{param1:o.score}),d.log("Recaptcha request is successful"),t&&t()):o.ok?void 0:(this.application.managers.monitoring.telemetry(i.TelemetryName.RECAPTCHA_FAILURE,{param1:o.score,param2:null===(r=o.reason)||void 0===r?void 0:r.join(",")}),d.log("Recaptcha request is unsuccessful"),this.block(),setTimeout((()=>{(0,l.enableRecaptchaAntispam)()}),1500),n&&n());var r})))}},{key:"onTokenFailure",value:function(e,t){d.log("Execution error",e),this.application.managers.monitoring.telemetry(i.TelemetryName.RECAPTCHA_ERROR,{param1:"Client error: "+JSON.stringify(e)}),t&&t(e)}},{key:"block",value:function(){this.blocked=!0}}]),e}();var p=f;t.default=p},75686:function(e,t,n){"use strict";var a=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=a(n(33119)),r=a(n(92664));var i=new(function(){function e(){(0,o.default)(this,e),this.refs={},this.observers={}}return(0,r.default)(e,[{key:"set",value:function(e,t){e&&t&&(this.refs[e]=t,this._fire(e))}},{key:"get",value:function(e){if(e&&this.refs[e])return this.refs[e].base?this.refs[e].base:this.refs[e]}},{key:"getComponent",value:function(e){return this.refs[e]}},{key:"subscribe",value:function(e,t){this.observers[e]||(this.observers[e]=[]),this.observers[e].push(t)}},{key:"unsubscribe",value:function(e,t){this.observers[e]=this.observers[e].filter((e=>{if(e!==t)return e}))}},{key:"_fire",value:function(e){this.observers[e]||(this.observers[e]=[]),this.observers[e].forEach((e=>{e()}))}}]),e}());t.default=i},46902:function(e,t,n){"use strict";var a=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.AudioBufferStore=void 0;var o=a(n(33119)),r=a(n(92664));const i=new(function(){function e(){(0,o.default)(this,e),this.audioBuffers={},this.mp3BuffersLengths={notification:5808,agent_message:3760,outgoing_message:5014},this.oggBufferLengths={notification:6140,agent_message:6464,outgoing_message:7165}}return(0,r.default)(e,[{key:"set",value:function(e,t){this.audioBuffers[e]=t}},{key:"get",value:function(e){return this.audioBuffers[e]||null}},{key:"getReadyAudioBuffersCount",value:function(){return Object.keys(this.audioBuffers).length}},{key:"getReferenceBufferLength",value:function(e,t){switch(t){case"mp3":return this.mp3BuffersLengths[e];case"ogg":return this.oggBufferLengths[e]}}}]),e}());t.AudioBufferStore=i},39933:function(e,t,n){"use strict";var a=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.HTMLAudioSoundManager=void 0;var o=a(n(33119)),r=a(n(92664)),i=a(n(7819)),s=a(n(84827)),l=a(n(85299)),u=a(n(55536)),c=n(14433),d=n(21951),f=n(54415),p=a(n(19955)),h=a(n(75686)),g=n(47245);function m(e){var t=function(){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}}();return function(){var n,a=(0,u.default)(e);if(t){var o=(0,u.default)(this).constructor;n=Reflect.construct(a,arguments,o)}else n=a.apply(this,arguments);return(0,l.default)(this,n)}}const _=a(n(4855)).default.name("HTMLAudioSoundManager");let v=function(e){(0,s.default)(n,e);var t=m(n);function n(e){var a;let r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return(0,o.default)(this,n),(a=t.call(this,e,r)).touchListenerTimeout=null,a.soundNodes={},a._windowOnClicked,a._mobileHackHandler=a._mobileHackHandler.bind((0,i.default)(a)),a}return(0,r.default)(n,[{key:"initSoundPlayer",value:function(){_.log("Initialization started"),this.disabled||(this.soundNodes={agent_message:h.default.get(g.Component.SOUND_AGENT_MESSAGE),notification:h.default.get(g.Component.SOUND_NOTIFICATION),outgoing_message:h.default.get(g.Component.SOUND_OUTGOING_MESSAGE)},p.default.mobileOrTablet()&&this._addHackListeners([window.parent,window],"click",this._mobileHackHandler))}},{key:"play",value:function(e,t){if(this.disabled)return void _.log(`Cannot play sound "${e}". SoundManager is disabled.`);const n=this.soundNodes[e];if(n&&void 0!==n.play)try{(p.default.ios()||p.default.safari())&&n.load();const a=n.play();this._promisesSupported(a)?t?a.then((()=>{this._pause(e)})):a.catch((t=>{this.touchListenerTimeout||(this._windowOnClicked=this._windowOnClicked.bind(this,e),p.default.mobileOrTablet()&&this._removeHackListeners([window.parent,window],"click",this._mobileHackHandler),this._addHackListeners([window.parent,window],"click",this._windowOnClicked),this.touchListenerTimeout=setTimeout((()=>{this._removeHackListeners([window.parent,window],"click",this._windowOnClicked)}),3e3))})).then():t&&this._pause(e)}catch(e){f.Monitoring.reportException(e)}}},{key:"_pause",value:function(e){if(this.disabled)return;const t=this.soundNodes[e];void 0!==t.pause&&t.pause()}},{key:"_promisesSupported",value:function(e){return("object"==typeof e||"function"==typeof e)&&e.then&&"function"==typeof e.then}},{key:"_windowOnClicked",value:function(e){this.play(e),clearTimeout(this.touchListenerTimeout),this._removeHackListeners([window.parent,window],"click",this._windowOnClicked),this.touchListenerTimeout=null}},{key:"_mobileHackHandler",value:function(){this._mobileHack(),this._removeHackListeners([window.parent,window],"click",this._mobileHackHandler)}},{key:"_mobileHack",value:function(){this.play(this.sounds[1],!0)}},{key:"_addHackListeners",value:function(e,t,n){e.forEach((e=>(0,d.addListener)(e,t,n)))}},{key:"_removeHackListeners",value:function(e,t,n){e.forEach((e=>(0,d.removeEvent)(e,t,n)))}}]),n}(c.SoundManagerBase);t.HTMLAudioSoundManager=v},21201:function(e,t,n){"use strict";var a=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.SoundDownloader=void 0;var o=a(n(33119)),r=a(n(92664)),i=n(83778),s=n(67597),l=n(54415),u=n(69479),c=n(46902),d=n(97615),f=n(95911);const p=a(n(4855)).default.name("SoundDownloader");let h=function(){function e(t){(0,o.default)(this,e),this.audioContext=t,this.soundValidator=new u.SoundValidator,this.exceptionReported=!1}return(0,r.default)(e,[{key:"downloadSounds",value:function(e,t){e.forEach((e=>{this.download(e,t)}))}},{key:"download",value:function(e,t){f.xhrRequest.get(this._getUrl(e,t),((n,a)=>{if(n)return this._handleDownloadError(n,e,t);const o=this.soundValidator.validate(e,t,a.data);if(o.success)this._decodeBuffer(a.data,e,t);else if(o.error){this._fallback(e,t)||(l.Monitoring.telemetryWithProbability("sound_fallback",{param1:e,param2:t,param3:"validation"},5),p.warn(o.error))}}),{responseType:"arraybuffer"})}},{key:"_getUrl",value:function(e,t){const n=(d.EnvironmentManager.isDevelopment()?"/public":"")+`/sounds/${e}.`;return(0,s.staticUrl)(n+t,!0)}},{key:"_decodeBuffer",value:function(e,t,n){this.audioContext.decodeAudioData(e,(e=>{c.AudioBufferStore.set(t,e)}),(e=>{this._handleDecodeBufferError(e,t,n)}))}},{key:"_handleDownloadError",value:function(e,t,n){this._fallback(t,n)||(l.Monitoring.telemetryWithProbability("sound_fallback",{param1:t,param2:n,param3:"download"},5),p.warn(`Error downloading arrayBuffer for sound "${t}.${n}". Reason: ${e.code} ${e.text}`))}},{key:"_handleDecodeBufferError",value:function(e,t,n){this._fallback(t,n)||(l.Monitoring.telemetryWithProbability("sound_fallback",{param1:t,param2:n,param3:"decode"},5),p.warn(`Error decoding arrayBuffer for sound "${t}.${n}". Reason: ${e}`))}},{key:"_fallback",value:function(e,t){const n=this._getFallbackExtension(t);return!!n&&(l.Monitoring.telemetryWithProbability("sound_fallback",{param1:e,param2:t,param3:"fallback"},5),this.download(e,n),!0)}},{key:"_getFallbackExtension",value:function(e){return"mp3"===e?"ogg":null}},{key:"_reportErrorMessageOnce",value:function(e){this.exceptionReported||((0,i.reportException)(e),this.exceptionReported=!0)}}]),e}();t.SoundDownloader=h},14433:function(e,t,n){"use strict";var a=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.SoundManagerBase=void 0;var o=a(n(33119)),r=a(n(92664));const i=a(n(4855)).default.name("SoundManagerBase");let s=function(){function e(t,n){(0,o.default)(this,e),this.disabled=n,this.sounds=t}return(0,r.default)(e,[{key:"initSoundPlayer",value:function(){i.log("initSoundPlayer method is NOT implemented!")}},{key:"enableSoundPlayer",value:function(){this.disabled=!1}},{key:"disableSoundPlayer",value:function(){this.disabled=!0}},{key:"play",value:function(e){i.log("play method is NOT implemented!")}}]),e}();t.SoundManagerBase=s},69479:function(e,t,n){"use strict";var a=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.SoundValidator=void 0;var o=a(n(33119)),r=a(n(92664)),i=n(46902);let s=function(){function e(){(0,o.default)(this,e)}return(0,r.default)(e,[{key:"validate",value:function(e,t,n){let a;return n?n instanceof ArrayBuffer?this._isValidBufferLength(e,t,n)?{success:!0,error:null}:(a=new Error(`ArrayBuffer byteLength for sound "${e}.${t}" is ${n.byteLength}, should be ${i.AudioBufferStore.getReferenceBufferLength(e,t)}.`),{success:!1,error:a}):(a=new Error(`ArrayBuffer for sound "${e}.${t}" is not an instance of ArrayBuffer.`),{success:!1,error:a}):(a=new Error(`No arrayBuffer for sound "${e}.${t}"`),{success:!1,error:a})}},{key:"_isValidBufferLength",value:function(e,t,n){return n.byteLength===i.AudioBufferStore.getReferenceBufferLength(e,t)}}]),e}();t.SoundValidator=s},50725:function(e,t,n){"use strict";var a=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.WebAudioSoundManager=void 0;var o=a(n(33119)),r=a(n(92664)),i=a(n(84827)),s=a(n(85299)),l=a(n(55536)),u=n(14433),c=n(54415),d=a(n(19955)),f=a(n(4855)),p=n(21201),h=n(46902);function g(e){var t=function(){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}}();return function(){var n,a=(0,l.default)(e);if(t){var o=(0,l.default)(this).constructor;n=Reflect.construct(a,arguments,o)}else n=a.apply(this,arguments);return(0,s.default)(this,n)}}const m=f.default.name("WebAudioSoundManager");let _=function(e){(0,i.default)(n,e);var t=g(n);function n(e){var a;let r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return(0,o.default)(this,n),(a=t.call(this,e,r)).audioContext=null,a.soundDownloader=null,a}return(0,r.default)(n,[{key:"initSoundPlayer",value:function(){if(m.log("Initialization started"),this.disabled||this._checkIfIsInitialized())return;const e=d.default.firefox()?"ogg":"mp3";this.audioContext=this._createAudioContext(),this.soundDownloader=new p.SoundDownloader(this.audioContext),this.soundDownloader.downloadSounds(this.sounds,e)}},{key:"play",value:function(e){!this.disabled&&this._checkIfIsInitialized()?(this.audioContext||(m.log("AudioContext was created on play"),this.audioContext=this._createAudioContext()),"suspended"===this.audioContext.state?this.audioContext.resume().then((()=>{m.log("AudioContext was resumed"),this._startBufferAudio(e)})):this._startBufferAudio(e)):m.log(`Cannot play sound "${e}". SoundManager is either disabled or is not initialized.`)}},{key:"_createAudioContext",value:function(){m.log("Creating AudioContext");try{let e=window.AudioContext||window.webkitAudioContext;if(e){return new e}}catch(e){let t=new Error(`Exception during the creation of audio context. ${e.message}`);return c.Monitoring.reportException(t),this.disableSoundPlayer(),null}}},{key:"_startBufferAudio",value:function(e){let t=h.AudioBufferStore.get(e);if(t){let n=this.audioContext.createBufferSource();if(n)n.buffer=t,n.connect(this.audioContext.destination),n.start();else{let t=new Error(`Error creating buffer source for sound "${e}".`);c.Monitoring.reportException(t),this.disableSoundPlayer()}}else{let t=new Error(`Error there is no audiobuffer for sound "${e}".`);c.Monitoring.reportException(t),this.disableSoundPlayer()}}},{key:"_checkIfIsInitialized",value:function(){return this.sounds.length===h.AudioBufferStore.getReadyAudioBuffersCount()&&(this.soundDownloader=null,!0)}}]),n}(u.SoundManagerBase);t.WebAudioSoundManager=_},25528:function(e,t,n){"use strict";var a=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.isSoundPlayerDisabled=void 0;var o=a(n(73687)),r=n(47060),i=a(n(19955)),s=n(44145);t.isSoundPlayerDisabled=()=>i.default.operaMini()||(0,s.getApp)().route===r.Route.HIDDEN||o.default.get("is_blacklisted")||(0,s.getFeatures)().disableSounds},71277:function(e,t,n){"use strict";var a=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.isSoundDisabled=t.default=t.WebAudioDisabled=t.Sounds=void 0;var o=a(n(19955)),r=n(50725),i=n(39933),s=n(25528);const l=["agent_message","notification","outgoing_message"];t.Sounds=l;const u=!function(){if(!o.default.mobileOrTablet()||!window.AudioContext&&!window.webkitAudioContext||o.default.ieOrEdge())return!1;{const e=window.AudioContext||window.webkitAudioContext;try{return(new e).close(),!0}catch(e){return!1}}}();t.WebAudioDisabled=u;const c=(0,s.isSoundPlayerDisabled)();t.isSoundDisabled=c;var d=u?new i.HTMLAudioSoundManager(l,c):new r.WebAudioSoundManager(l,c);t.default=d},22541:function(e,t,n){"use strict";var a=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=a(n(33119)),r=a(n(92664)),i=a(n(84726)),s=n(69882);const l=a(n(4855)).default.name("TitleManager");var u=new(function(){function e(t,n){(0,o.default)(this,e),this.originalTitle=t,this.jivoTitle=n,this.titleShown=!1,this.timer=null}return(0,r.default)(e,[{key:"getTitle",value:function(){return(0,s.getPageWindow)().document.title}},{key:"startBlinking",value:function(){clearInterval(this.timer),this.timer=setInterval((()=>{let e;this.titleShown?e=this.originalTitle:(this.originalTitle=this.getTitle(),e=this.jivoTitle),this.changeTitle(e),this.titleShown=!this.titleShown}),1e3)}},{key:"stopBlinking",value:function(){clearInterval(this.timer);const e=this.getTitle();e!==this.originalTitle&&e!==this.jivoTitle&&(this.originalTitle=e),this.changeTitle(this.originalTitle),this.titleShown=!1}},{key:"changeTitle",value:function(e){(0,s.getPageWindow)().document.title=e,l.log("Title changed to:",e)}}]),e}())((0,s.getPageWindow)().document.title,(0,i.default)("lblNewMessage"));t.default=u},40202:function(e,t,n){"use strict";var a=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=a(n(33119)),r=a(n(92664)),i=a(n(1039)),s=a(n(38121));a(n(4855)).default.name("TransitionManager");let l=function(){function e(){(0,o.default)(this,e)}return(0,r.default)(e,null,[{key:"getEmptyTransition",value:function(){return s.default.NoTransition}},{key:"getTransitionByName",value:function(e){return"function"==typeof s.default[e]?s.default[e]((()=>{let e=window.parent.document.getElementById("jvlabelWrap");if(e){if("bottom"===i.default.widget_orientation)return{marginRight:e.style.marginRight,width:e.offsetWidth,height:e.offsetHeight};if("right"===i.default.widget_orientation)return{marginBottom:e.style.marginBottom,height:e.offsetWidth,width:e.offsetWidth};if("left"===i.default.widget_orientation)return{marginBottom:e.style.marginBottom,height:e.offsetWidth,width:e.offsetWidth}}return 0})()):s.default[e]}}]),e}();t.default=l},47914:function(e,t,n){"use strict";var a=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=a(n(33119)),r=a(n(92664)),i=n(21951),s=n(69882),l=n(43374),u=n(26932),c=a(n(75686)),d=n(47245),f=n(2982),p=a(n(19955)),h=n(52274);const g=a(n(4855)).default.name("WindowResizeManager");let m=null,_=function(){function e(t){if((0,o.default)(this,e),m)return m;this.handler=(0,l.throttle)(this.resizeHandler.bind(this),100),(0,i.addListener)((0,s.getPageWindow)(),"resize",this.handler),m=this,this.onResize=t,this.lastHeight=null,this.container=null}return(0,r.default)(e,[{key:"destroy",value:function(){(0,i.removeEvent)((0,s.getPageWindow)(),"resize",this.handler)}},{key:"resizeHandler",value:function(){const e=c.default.get(d.Component.WIDGET_CONTAINER);if(g.log("resizeHandler"),!e)return;if(e&&!e.style)return;this.container=e;const t=parseInt((0,f.getProperty)("right",e))||0,n=parseInt((0,f.getProperty)("left",e))||0,a=parseInt((0,f.getProperty)("height",e))||0,o=t+n+h.CHAT_WIDTH+28,r=(0,s.getPageWindow)().document.body.clientWidth,i=(0,s.getPageWindow)().innerHeight-30;if(o>r)u.positionDispatchers.initializePositionStore({height:a>i?ii){const e=i{var n;const a=(0,s.toCodePoint)(e),l=document.createElement("jdiv");return r.default.render(o.default.createElement(i.default,{icon:a,alone:t,className:"emojiMessages",style:{}}),l),(null===(n=l.childNodes[0])||void 0===n?void 0:n.outerHTML)||""}))};var o=a(n(98661)),r=a(n(98661)),i=(a(n(1039)),a(n(3501))),s=(n(63621),n(66488));n(11413);function l(e){let t=!1,n=0;const a=(0,s.replace)(e,(()=>(n++,""))).match(/\S/gu);return 1!==n||a||(t=!0),t}},49594:function(e,t,n){"use strict";var a=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.deleteMessagesFromHistory=C,t.getMsgHistory=T,t.updateEditedMessages=O,t.updateHistory=function(e){const t=(0,v.getApp)(),n=!!e.jv_client_id;if((e&&t.lastMsgId!==e.last_msg_id||n)&&e.last_msg_id){b.warn("updateHistory",e);T(e,(()=>{t.started||E()}))}else t.started||E()};var o=n(96879),r=n(47060),i=a(n(14264)),s=a(n(86961)),l=n(81152),u=n(54415),c=n(83170),d=a(n(91275)),f=a(n(4855)),p=n(26932),h=a(n(35802)),g=a(n(19955)),m=n(33180),_=n(15787),v=n(44145),y=a(n(22866));const b=f.default.name("MessageHistory"),E=()=>{m.cssLoader.subscribe((()=>{h.default.getInstance().start()}),(()=>{h.default.getInstance().stop()}))};function T(e,t){b.log("getMsgHistory",e);const n=(0,v.getApp)(),a=e&&e.last_msg_id>n.lastMsgId;e.jv_client_id||a?(b.log("start get new history",a),s.default.getHistoryMessages("messages",{},((n,a)=>{if(n)return function(e,t){b.log("handleError",e),t(),u.Monitoring.telemetry(c.TelemetryName.API_GET_MESSAGES_ERROR,{param1:e.code}),b.log("error: ",e)}(n,t);const s=a.data;if(b.log("receive new history",s),y.default.getInstance().saveMessageHistory("lastMessageHistoryRequest",a),s.result){const n=s.result;!function(e){b.log("setWidgetStatus",e);const t=(0,v.getApp)().chatStarted,n=(0,v.getClient)().departmentId;t&&!e&&n&&p.clientDispatchers.updateClient({departmentId:null});p.appDispatchers.setChatStarted(e||!1),e||(i.default.closeChat(),p.appDispatchers.setChatAccepted(!1))}(n.chat_opened),function(e,t,n){if(b.log("handleMessages",e),e&&e.length){const a=function(){b.log("getLastMessage");const e=i.default.filter((e=>{const t=e.get("from");return(t===l.MessageInitiator.CLIENT||t===l.MessageInitiator.AGENT)&&e.get("msg_id")}));return e[e.length-1]}(),s=function(e){b.log("getLastMessageId",e);let t=e?e.get("msg_id"):null;e||(e=i.default.getLastProactive())&&(t=e.get("msg_id"));return t}(a),f=e.filter((e=>{const t=(0,o.filterMessage)(e);return e.type===l.MessageType.PROACTIVE&&a&&a.get("type")===l.MessageType.PROACTIVE&&a.destroy(),t&&s!==e.msg_id}));if(f.forEach((e=>{if(e.deleted)e.status=l.MessageStatus.DELETED;else{b.log("add item from history",e);const t=1e3*e.created_ts,n=1e3*e.updated_ts;e.created_ts=t,e.updated_ts&&(e.updated_ts=n),e.status=l.MessageStatus.DELIVERED,e.type===l.MessageType.EMAIL&&(e.type=l.MessageType.MESSAGE),e.media&&(e.media.status=l.MediaStatus.COMPLETE)}})),"resume_ok"===n&&!g.default.mobileOrTablet()&&f.length&&(p.appDispatchers.setAppRoute(r.Route.CHAT),d.default.syncRouter()),p.messagesDispatchers.addMessages(f),t){const t=!!f.length;let n=(t?f:e).slice(-1)[0],a=n.chat_id,o=n.created_ts;t||(o*=1e3),(0,_.needToRateForm)(a,o)}u.Monitoring.telemetry(c.TelemetryName.API_GET_MESSAGES_RECEIVED)}}(n.messages,n.chat_rate_requested,e.name),C(n.messages),O(n.messages),e&&p.appDispatchers.setLastMsgId(e.last_msg_id),t(n)}else b.error("Empty history data")}))):t()}function C(e){const t=e.filter((e=>e.deleted));t.length&&t.forEach((e=>{const t=i.default.getMessageById(e.msg_id);t&&t.set({status:l.MessageStatus.DELETED,type:l.MessageType.MESSAGE,body:null})}))}function O(e){const t=e.filter((e=>!e.deleted));t.length&&t.forEach((e=>{const t=i.default.getMessageById(e.msg_id);t&&e.updated_ts&&(b.warn("message edited: ",t.toJSON()),t.set({updated_ts:1e3*e.updated_ts,text:e.text}))}))}},82726:function(e,t,n){"use strict";var a=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.addMessagesOnChatOpen=void 0,t.cleanTempProactive=function(){w.log("cleanTempProactive");const e=i.default.getTmpProactive(),t=i.default.getLastMessage(),n=t?t.get("from"):null,a=u.MessageInitiator.AGENT,o=u.MessageInitiator.CLIENT,r=u.MessageInitiator.FORM;t&&e&&e.get("body")&&e.get("body").unsave&&-1!==[a,o,r].indexOf(n)&&e!==t&&(e.destroy(),s.default.reload(),s.default.agent_id=0);(0,l.prechatEnabled)()&&i.default.getClientMessages()&&i.default.getClientMessages().length&&c.messageActions.deletePrechatMsg()},t.getMessagesGroup=A,t.getScrollToFormState=function(e){const t=(0,O.getFormMessage)(),n=(0,O.getFormIntroduceText)();if(t){if(n){const t=e?(0,o.default)("lblIntroduceRequest"):(0,o.default)("offlineIntroductionText");m.messagesDispatchers.updateMessage({privateId:n.private_id},{created_ts:(new Date).getTime(),text:t})}return m.messagesDispatchers.updateMessage({privateId:t.private_id},{created_ts:(new Date).getTime()}),i.default.sort(),d.Monitoring.telemetry(f.TelemetryName.CHAT_INTRODUCE,{param1:"btnform"}),{hideScrollButton:!0,messagesGroups:A()}}},t.onWrapTouch=function(e){if(r.default.mobileOrTablet()){if(r.default.safari())return;const t=(0,b.getPageWindow)().document.activeElement,n=h.Component.CHAT_INPUT,a=T.default.get(n);(0,E.isTextArea)(t)&&function(e){if(!e)return;return"none"!==e.style.display}(a)&&!(0,E.isParentA)(e)&&(w.log("onWrapTouch",t),setTimeout((()=>{t.blur()}),300))}},t.readMessages=void 0;var o=a(n(84726)),r=a(n(19955)),i=a(n(14264)),s=a(n(26754)),l=n(55329),u=n(81152),c=n(65465),d=n(54415),f=n(83170),p=n(9393),h=n(47245),g=a(n(4855)),m=n(26932),_=n(79641),v=a(n(23116)),y=n(15787),b=n(69882),E=n(43025),T=a(n(75686)),C=n(91225),O=n(44145),S=n(81722);const w=g.default.name("MessagesMainUtils");function A(){const e=[];let t,n,a,o,r=0;if((0,p.each)(i.default.getAll(),(i=>{const s=i.toJSON(),l=new Date(s.created_ts);let c=!1;!n||n.getMonth()===l.getMonth()&&n.getDate()===l.getDate()||(c=!0),s.type!==u.MessageType.MESSAGE||-1!==[u.MessageType.COBROWSE,u.MessageType.MEDIA,u.MessageType.INVOICE,u.MessageType.SYSTEM,u.MessageType.WEB_RTC_CALL].indexOf(a)||s.from!==t||s.from_id!==o||c?(c&&(e.push([{type:u.MessageType.SEPARATOR,time:l.getTime(),from:u.MessageInitiator.SYSTEM}]),r++),e.push([i])):e[e.length-1].push(i),t=s.from,a=s.type,o=s.from_id,n=l})),i.default.store.length>0&&e.length>0){const t=e[0][0].get("created_ts"),n=(s=t,Math.round(Math.abs((s-(new Date).getTime())/864e5)));(r>0||n>=1)&&e.unshift([{type:u.MessageType.SEPARATOR,time:t,from:u.MessageInitiator.SYSTEM}])}var s;return e}t.readMessages=()=>{if(v.default.isActive){const e=(0,O.getChats)(),t=e[e.length?e.length-1:0],n=(0,O.getUnreadMessages)(),a=(0,O.getOfflineUnreadProactive)(),o=[];if(n.forEach((e=>{const t=e.msg_id;(0,_.isNumber)(t)&&!o.includes(t)&&o.push(t)})),o.length&&m.messagesDispatchers.updateMessages({messageIds:o},{status:u.MessageStatus.READ}),a.length){const e=a.map((e=>e.private_id));m.messagesDispatchers.updateMessages({privateIds:e},{status:u.MessageStatus.READ})}if(o.length&&(0,C.isChatInputRoute)((0,O.getApp)().route)){const e=t.id?t.id:o[0].chat_id;(0,y.agentMessageRead)(o,e)}}};t.addMessagesOnChatOpen=()=>{const e=(0,O.getApp)().maintenance;!e&&(0,S.isOfflineCanSend)()&&0===i.default.getFormMessage().length&&c.messageActions.startFormSequence((0,o.default)("offlineIntroductionText")),e&&c.messageActions.addMaintenanceMessage()}},54415:function(e,t,n){"use strict";var a=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.Monitoring=void 0;var o=a(n(33119)),r=a(n(92664)),i=n(75048),s=n(97615),l=n(67597),u=n(83170),c=n(44733);let d=function(){function e(){(0,o.default)(this,e),this.reportedTelemetry={},this.provider=new i.MonitoringProvider}return(0,r.default)(e,[{key:"init",value:function(){window.onerror=(e,t,n,a,o)=>{!o&&(o={}),(window||arguments||"function"==typeof this.reportException)&&this.reportException({message:e,lineNumber:n,fileName:(0,l.getBundleSrc)()+"&v="+s.EnvironmentManager.getVersion(),columnNumber:a,stack:JSON.stringify(o.stack||o.stacktrace||o)})};const e=t=>{const n=this.reportedTelemetry[u.TelemetryName.CHAT_INVITE]||this.reportedTelemetry[u.TelemetryName.OFFLINE_INVITE];t.persisted||!n||c.StorageProvider.get("hide_reported")||(c.StorageProvider.set("hide_reported",!0),this.telemetryOnce(u.TelemetryName.PAGE_HIDE,{param1:"has_proactive"})),window.removeEventListener("unload",e),window.removeEventListener("pagehide",e)};window.addEventListener("unload",e,!1),window.addEventListener("pagehide",e,!1)}},{key:"reportException",value:function(e){this.provider.reportException(e)}},{key:"telemetry",value:function(e,t){this.provider.telemetry(e,t),!0!==this.reportedTelemetry[e]&&(this.reportedTelemetry[e]=!0)}},{key:"telemetryOnce",value:function(e,t){!0!==this.reportedTelemetry[e]&&this.telemetry(e,t)}},{key:"telemetryWithProbability",value:function(e,t,n){this._invokeWithProbability((()=>{this.telemetry(e,t)}),n)}},{key:"_invokeWithProbability",value:function(e,t){Math.random()<=.01*t&&e()}},{key:"isTelemetryReported",value:function(e){return!0===this.reportedTelemetry[e]}},{key:"getTelemetryNames",value:function(){return u.TelemetryName}},{key:"reportStats",value:function(e,t){this.provider.reportStats(e,t)}}]),e}();const f=new d;t.Monitoring=f},75048:function(e,t,n){"use strict";var a=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.MonitoringProvider=void 0;var o=a(n(33119)),r=a(n(92664)),i=a(n(4855)),s=a(n(19955)),l=a(n(22866)),u=n(97615),c=n(44145),d=n(31343),f=n(95911),p=n(69882),h=a(n(1039)),g=a(n(55908)),m=n(21733),_=n(32100);const v=i.default.name("MonitoringProvider");let y=function(){function e(){(0,o.default)(this,e),this.lastTelemetry=[],this.errorSentCnt=0}return(0,r.default)(e,[{key:"isNotSearchSpider",value:function(){const e=navigator.userAgent.toLowerCase();return-1==e.search(/google/gi)&&-1==e.search(/\+http:\/\/yandex\.com\/bots/gi)&&-1==e.search(/\+http:\/\/www\.cloudflare\.com\/always-online/gi)&&-1==e.search(/linespider\//gi)}},{key:"reportException",value:function(e){if(l.default.getInstance()&&l.default.getInstance().saveException(e),!h.default.disable_error_reporting&&this.isNotSearchSpider()){if(++this.errorSentCnt>3)return;try{this.reportError(e)}catch(e){v.error(e.message)}}else v.warn("REPORT",e)}},{key:"reportError",value:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3;const n=`${(0,p.getProtocol)()}//${h.default.err_host}/widget`,a=(0,c.getClient)(),o={body:{widget:"true",widget_id:h.default.widget_id,widget_version:u.EnvironmentManager.getVersion(),level:t,url:this.getUrl(),client_id:a.clientId?a.clientId.split(".")[0]:null,lineNumber:e.lineNumber,fileName:e.fileName,column:e.columnNumber,full_message:this.getStack(e.message,e.stack),short_message:e.message,device:s.default.getDevice(),shard:this.getShard()},headers:{"Content-Type":d.CONTENT_TYPE.APP_JSON},responseType:"json",monitoring:!0};this.ignoreMessage(o.body.full_message,"chrome://internal")||f.xhrRequest.post(n,((e,t)=>{v.log("Error reported:",e,t)}),o)}},{key:"ignoreMessage",value:function(e,t){return e.includes(t)}},{key:"getUrl",value:function(){const e=(0,p.getPageWindow)().location;return e.protocol+"//"+e.host+e.pathname}},{key:"telemetry",value:function(e,t){if(!e||!(0,m.isString)(e))return void v.warn("EventName is empty");if(e=(0,_.replaceAll)(e," ","_"),this.saveTelemetry(e),h.default.disable_telemetry||!this.isNotSearchSpider())return;"object"==typeof t&&t||(t={});const n=(0,c.getClient)();t.event=e,t.widget_id=h.default.widget_id,t.chat_mode=h.default.chat_mode,t.site_id=h.default.site_id,t.device=s.default.getDevice(),t.visitor_id=n.visitorId,t.widget_version=u.EnvironmentManager.getVersion(),t.shard=this.getShard();const a=g.default.getInstance();a&&a.getActiveTest()&&(t.abtest_name=a.getActiveTestName(),t.abtest_group=a.getActiveTestGroup()),n.clientId&&(t.client_id=parseInt(n.clientId.split(".")[0])||0);for(let e=1;e<5;e++){const n=t[`param${e}`];null!=n&&n.toString&&(t[`param${e}`]=n.toString())}v.log("TELEMETRY",t);try{let e=(0,p.getProtocol)();h.default.telemetry_host&&(e+="//"+h.default.telemetry_host+"/w"),window.navigator.sendBeacon&&navigator.sendBeacon(e,JSON.stringify(t))}catch(e){v.warn(e)}}},{key:"saveTelemetry",value:function(e){5===this.lastTelemetry.length&&this.lastTelemetry.shift(),this.lastTelemetry.push(e.substr(0,60))}},{key:"getStack",value:function(e,t){if("Script error."==e)return t;const n=i.default.lastLog.join("\r\n");return"{}"!=t&&""!=t&&t?"Uncaught TypeError: undefined is not a function"==e||"t.set is not a function"==e||"Uncaught TypeError: Cannot read property 'set' of undefined"==e?`${t} \r\n ${n}`:t.replace(/(?:\\[n])+/,"\r\n"):`Custom stack: \r\n${n}\r\n\r\n${this.lastTelemetry.join("\r\n")}`}},{key:"getShard",value:function(){return h.default.shard_id||"main"}},{key:"reportStats",value:function(e,t){if(e&&(0,m.isString)(e)){if(this.isNotSearchSpider()){v.log("stats",e,t);try{let n=(0,p.getProtocol)();const a=(0,c.getSystemSettings)(),o=a.siteId,r=a.widgetId;n+=`${h.default.base_url}/script/stat/campaign/${e}/${o}/${t}/${r}`,f.xhrRequest.get(n,(()=>{v.warn("stat posted",e,t)}),{})}catch(e){v.warn(e)}}}else v.warn("EventName is empty")}}]),e}();t.MonitoringProvider=y},74890:function(e,t,n){"use strict";var a=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;a(n(4855)).default.name("Polyfill");var o={init:function(){Element.prototype.matches||(Element.prototype.matches=Element.prototype.matchesSelector||Element.prototype.mozMatchesSelector||Element.prototype.msMatchesSelector||Element.prototype.oMatchesSelector||Element.prototype.webkitMatchesSelector||function(e){for(var t=(window.document||window.ownerDocument).querySelectorAll(e),n=t.length;--n>=0&&t.item(n)!==this;);return n>-1}),Element.prototype.closest||(Element.prototype.closest=function(e){for(var t=this;t;){if(t.matches(e))return t;t=t.parentElement}return null})}};t.default=o},2833:function(e,t,n){"use strict";var a=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=a(n(33119)),r=a(n(92664)),i=n(54415),s=a(n(86961)),l=n(44145),u=n(83170),c=n(35967);const d=a(n(4855)).default.name("Proactive");var f=new(function(){function e(){(0,o.default)(this,e),this.agents=null,this.departments=null,this.proactiveDepartmentId=null}return(0,r.default)(e,[{key:"getActiveAgent",value:function(e,t){d.log("getActiveAgent"),t&&(this.proactiveDepartmentId=t),s.default.getStatus(((t,n)=>{this.parseStatus(t,n,e)}))}},{key:"parseStatus",value:function(e,t,n){if(e)return i.Monitoring.telemetry(u.TelemetryName.WIDGET_STATUS,{param1:e.code}),this.agents=null,this.departments=null,n(!1);const a=(0,l.getClient)(),o=a.assignedAgentId||a.priorityAgentId;n(this.getAgent(t.data,o,this.proactiveDepartmentId))}},{key:"getAgent",value:function(e,t,n){const a=e.departments;if(d.log("parseStatus",e,t,n),e.bots)return e.bots[0];if(this.agents=e.bots||e.agents,this.departments=a,this.agents.length){if(n&&"object"==typeof a&&n in a){const e=this.departments[n],a=this.getOnlineAgentInDep(t,e.agents);if(a)return a;const o=this.getRandomOnlineAgentFromDep(e.agents);return o||(d.log("no online agents from proactive department."),!1)}const e=this.getAgentById(t);if(e)return e;const o=this.getRandomAgent(this.agents.length-1);return o||!1}return!1}},{key:"getRandomAgent",value:function(e){return this.agents[this.randomInt(0,e)]}},{key:"randomInt",value:function(e,t){const n=e+Math.random()*(t+1-e);return Math.floor(n)}},{key:"getAgentById",value:function(e){return this.agents.find((t=>t.agent_id===e))}},{key:"getRandomAgentIdByArray",value:function(e){return e[1===e.length?0:this.randomInt(0,e.length-1)]}},{key:"getOnlineIds",value:function(){return this.agents.map((e=>e.agent_id))}},{key:"getOnlineInDep",value:function(e){const t=this.getOnlineIds();return(0,c.intersection)(t,e)}},{key:"getOnlineAgentInDep",value:function(e,t){const n=this.getOnlineInDep(t);if(n.length&&-1!==n.indexOf(e))return this.getAgentById(e)}},{key:"getRandomOnlineAgentFromDep",value:function(e){const t=this.getOnlineInDep(e);if(t.length){const e=this.getRandomAgentIdByArray(t);return this.getAgentById(e)}return!1}}]),e}());t.default=f},90361:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.withLocator=void 0;var a=n(97615);t.withLocator=e=>e&&!a.EnvironmentManager.isProduction()?{"data-qa-id":e}:{}},21476:function(e,t,n){"use strict";var a=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.Router=void 0;var o=a(n(84633)),r=a(n(1039)),i=a(n(95003)),s=a(n(14264)),l=a(n(19955)),u=n(47060),c=n(80161),d=n(54415),f=n(83170),p=n(26932),h=a(n(47914)),g=a(n(75686)),m=n(2982),_=n(47245),v=a(n(71323)),y=n(44145),b=n(69882),E=n(47138),T=a(n(4855)),C=n(94537),O=n(68403);const S=T.default.name("Router"),w=new o.default({namespace:"ROUTER",initialState:(0,y.getApp)().route||i.default.route||u.Route.LABEL,eulaContext:{},debugClicks:0,clickTimer:null,getCurrentRoute:function(){return this.state},getPrevRoute:function(){return this.priorState},setNext:function(e){S.warn("setNext route:",e),this.transition(e)},getPrevEvent:function(){return this._priorAction},next:function(e,t){S.warn("next",e,"from",this.state),e&&this.handle(e,t)},_navToChat:function(){if((0,y.getCallback)().status==E.CallStatus.WAIT)return void this.transition(u.Route.CHAT_CALL);const e=(0,y.getApp)().isOnline,t=c.RouterUtils.showDepartmentsIfPossible();e&&(0,y.needToShowIntroduceForm)()?this.transition(u.Route.INTRODUCE):t?this.transition(u.Route.DEPARTMENTS):this.transition(u.Route.CHAT)},_navToChatFromChatMin:function(){this.priorState===u.Route.CHAT_EULA&&!(0,y.getClient)().eulaAccepted?this.transition(u.Route.CHAT_EULA):this.transition(u.Route.CHAT)},_debugClicked:function(){clearTimeout(this.clickTimer),this.debugClicks++,this.debugClicks>7&&(this.debugClicks=0,this.transition(u.Route.DEBUG),d.Monitoring.telemetryOnce(f.TelemetryName.DEBUG_PANEL_OPENED)),this.clickTimer=setTimeout((()=>{this.debugClicks=0}),1e3)},states:{[u.Route.HIDDEN]:{_onEnter:function(){this.trigger("route_change",u.Route.HIDDEN);const e=h.default.getInstance();e&&e.destroy()}},[u.Route.LABEL]:{_onEnter:function(){this.trigger("route_change",u.Route.LABEL)},[u.RouterEvent.Hide]:function(){this.transition(u.Route.HIDDEN)},[u.RouterEvent.ToCall]:function(){this.transition(u.Route.CALL)},[u.RouterEvent.ToChat]:function(){this.transition(u.Route.CHAT)},[u.RouterEvent.ApiOpen]:function(){this._navToChat()},[u.RouterEvent.Navigate]:function(){this._navToChat()},[u.RouterEvent.ToLabelInvitation]:function(){this.transition(u.Route.LABEL_INVITATION)},[u.RouterEvent.ToMobileMenu]:function(){this.transition(u.Route.MOBILE_MENU)},[u.RouterEvent.ToCallPopup]:function(){this.transition(u.Route.CALL_POPUP)},[u.RouterEvent.ToSocial]:function(){this.transition(u.Route.CHAT_SOCIAL)}},[u.Route.LABEL_INVITATION]:{_onEnter:function(){this.trigger("route_change",u.Route.LABEL_INVITATION)},[u.RouterEvent.Hide]:function(){this.transition(u.Route.HIDDEN)},[u.RouterEvent.ToCall]:function(){this.transition(u.Route.CALL)},[u.RouterEvent.ApiOpen]:function(){this._navToChat()},[u.RouterEvent.Navigate]:function(){this._navToChat()},[u.RouterEvent.CloseWindow]:function(){this.transition(u.Route.LABEL)}},[u.Route.DEPARTMENTS]:{_onEnter:function(){this.trigger("route_change",u.Route.DEPARTMENTS)},[u.RouterEvent.CloseWindow]:function(){this.transition(u.Route.LABEL)},[u.RouterEvent.ToCall]:function(){l.default.mobileOrTablet()?this.transition(u.Route.CALL):this.transition(u.Route.CHAT_CALL),d.Monitoring.telemetry(f.TelemetryName.CW_ONLINE_HEADER_BUTTON)},[u.RouterEvent.Hide]:function(){this.transition(u.Route.HIDDEN)},[u.RouterEvent.Navigate]:function(){(0,y.needToShowIntroduceForm)()&&0===s.default.store.length?this.transition(u.Route.INTRODUCE):this._navToChat()},[u.RouterEvent.ToDebug]:function(){this._debugClicked()}},[u.Route.INTRODUCE]:{_onEnter:function(){this.trigger("route_change",u.Route.INTRODUCE),d.Monitoring.telemetry(f.TelemetryName.CHAT_INTRODUCE,{param1:"show",param2:(0,O.getContactSettingsInfo)()})},[u.RouterEvent.Submit]:function(){c.RouterUtils.needToShowEula()?this.transition(u.Route.CHAT_EULA):(this.transition(u.Route.CHAT),this.trigger("submit_eula_success",u.Route.INTRODUCE))},[u.RouterEvent.ToCall]:function(){(0,b.isChatPage)()?this.transition(u.Route.CHAT_CALL):this.transition(u.Route.CALL)},[u.RouterEvent.CloseWindow]:function(){this.transition(c.RouterUtils.getRouteChatMin())},[u.RouterEvent.Hide]:function(){this.transition(u.Route.HIDDEN)},[u.RouterEvent.ToDebug]:function(){this._debugClicked()}},[u.Route.MOBILE_MENU]:{_onEnter:function(){this.trigger("route_change",u.Route.MOBILE_MENU)},[u.RouterEvent.ToCall]:function(){this.transition(u.Route.CALL)},[u.RouterEvent.CloseWindow]:function(){this.transition(u.Route.LABEL)},[u.RouterEvent.Hide]:function(){this.transition(u.Route.HIDDEN)},[u.RouterEvent.ToChat]:function(){this._navToChat()},[u.RouterEvent.Navigate]:function(){(0,y.needToShowIntroduceForm)()?this.transition(u.Route.INTRODUCE):c.RouterUtils.showDepartmentsIfPossible()?this.transition(u.Route.DEPARTMENTS):this.transition(u.Route.CHAT)}},[u.Route.CHAT]:{_onEnter:function(){this.trigger("route_change",u.Route.CHAT)},[u.RouterEvent.Submit]:function(e){e&&e.from&&e.from!==this.state||(c.RouterUtils.needToShowEula()?(e&&(this.eulaContext={link:e.link,context:e.context}),this.transition(u.Route.CHAT_EULA)):this.trigger("submit_success"))},[u.RouterEvent.ToCall]:function(){l.default.mobileOrTablet()?this.transition(u.Route.CALL):this.transition(u.Route.CHAT_CALL),d.Monitoring.telemetry(f.TelemetryName.CW_ONLINE_HEADER_BUTTON)},[u.RouterEvent.ToIntroduce]:function(){(0,y.getClient)().isIntroduced||r.default.contacts_ask!==C.ContactsType.BEFORE_CHAT?this._navToChat():this.transition(u.Route.INTRODUCE)},[u.RouterEvent.ToSocial]:function(){this.transition(u.Route.CHAT_SOCIAL)},[u.RouterEvent.CloseWindow]:function(){this.transition(c.RouterUtils.getRouteChatMin())},[u.RouterEvent.Hide]:function(){this.transition(u.Route.HIDDEN)},[u.RouterEvent.ToEula]:function(e){e&&c.RouterUtils.needToShowEula()&&(this.eulaContext={link:e.link,context:e.context},this.transition(u.Route.CHAT_EULA))},[u.RouterEvent.ToDebug]:function(){this._debugClicked()},[u.RouterEvent.ToCallSetup]:function(){this.transition(u.Route.CHAT_SETUP_CALL)}},[u.Route.CHAT_MIN]:{_onEnter:function(){this.trigger("route_change",u.Route.CHAT_MIN)},[u.RouterEvent.ToChat]:function(){this.transition(u.Route.CHAT)},[u.RouterEvent.ToCall]:function(){this.transition(u.Route.CHAT_CALL)},[u.RouterEvent.Hide]:function(){this.transition(u.Route.HIDDEN)},[u.RouterEvent.ApiOpen]:function(){this._navToChatFromChatMin()},[u.RouterEvent.Navigate]:function(){this._navToChat()}},[u.Route.CHAT_EULA]:{_onEnter:function(){const e=this.eulaContext&&this.eulaContext.link?this.eulaContext.link:null,t=this.eulaContext&&this.eulaContext.context?this.eulaContext.context:"introduce";"cb"!==t&&w.getPrevRoute()!==u.Route.CHAT_CALL&&v.default.showEula(!0,e,t),this.eulaContext={},this.trigger("route_change",u.Route.CHAT_EULA)},[u.RouterEvent.Submit]:function(){const e=this.priorState;e?(this.trigger("submit_eula_success",w.getPrevRoute()),-1===[u.Route.INTRODUCE,u.Route.CHAT_MIN].indexOf(e)?this.transition(e):this.transition(u.Route.CHAT)):this.transition(u.Route.CHAT)},[u.RouterEvent.ToCall]:function(){l.default.mobileOrTablet()?this.transition(u.Route.CALL):this.transition(u.Route.CHAT_CALL)},[u.RouterEvent.Cancel]:function(){this.priorState&&this.priorState!==u.Route.CHAT_MIN?this.transition(this.priorState):this.transition(u.Route.CHAT)},[u.RouterEvent.CloseWindow]:function(){!l.default.mobileOrTablet()&&(0,y.getApp)().chatStarted&&(0,y.getApp)().isOnline?this.transition(u.Route.CHAT_MIN):this.transition(u.Route.LABEL)},[u.RouterEvent.Hide]:function(){this.transition(u.Route.HIDDEN)},[u.RouterEvent.ToDebug]:function(){this._debugClicked()}},[u.Route.CHAT_SOCIAL]:{_onEnter:function(){this.trigger("route_change",u.Route.CHAT_SOCIAL)},[u.RouterEvent.Submit]:function(){this.transition(u.Route.LABEL)},[u.RouterEvent.ToChat]:function(){this.transition(u.Route.CHAT)},[u.RouterEvent.ToCall]:function(){this.transition(u.Route.CALL)},[u.RouterEvent.Cancel]:function(){this.transition(u.Route.CHAT)},[u.RouterEvent.CloseWindow]:function(){this.transition(c.RouterUtils.getRouteChatMin())},[u.RouterEvent.Hide]:function(){this.transition(u.Route.HIDDEN)},[u.RouterEvent.ToEula]:function(e){e&&c.RouterUtils.needToShowEula()&&(this.eulaContext={link:e.link,context:e.context},this.transition(u.Route.CHAT_EULA))},[u.RouterEvent.ToDebug]:function(){this._debugClicked()}},[u.Route.CHAT_CALL]:{_onEnter:function(){this.trigger("route_change",u.Route.CHAT_CALL)},[u.RouterEvent.Submit]:function(){c.RouterUtils.needToShowEula()?this.transition(u.Route.CHAT_EULA):this.trigger("submit_success")},[u.RouterEvent.ToCall]:function(){const e=w.getPrevRoute();e&&this.transition(-1===[u.Route.CHAT_MIN,u.Route.CHAT_EULA].indexOf(e)?e:u.Route.CHAT)},[u.RouterEvent.ToSocial]:function(){this.transition(u.Route.CHAT_SOCIAL)},[u.RouterEvent.Cancel]:function(){this.transition(u.Route.CHAT)},[u.RouterEvent.CloseWindow]:function(){this.transition(c.RouterUtils.getRouteChatMin())},[u.RouterEvent.Hide]:function(){this.transition(u.Route.HIDDEN)},[u.RouterEvent.ToChat]:function(){this._navToChat()},[u.RouterEvent.ToEula]:function(e){e&&c.RouterUtils.needToShowEula()&&(this.eulaContext={link:e.link,context:e.context},this.transition(u.Route.CHAT_EULA))},[u.RouterEvent.ToIntroduce]:function(){r.default.contacts_ask===C.ContactsType.BEFORE_CHAT&&this.transition(u.Route.INTRODUCE)},[u.RouterEvent.ToDebug]:function(){this._debugClicked()}},[u.Route.CHAT_SETUP_CALL]:{_onEnter:function(){this.trigger("route_change",u.Route.CHAT_SETUP_CALL)},[u.RouterEvent.Cancel]:function(){this.transition(u.Route.CHAT)},[u.RouterEvent.Submit]:function(){this.transition(u.Route.CHAT)},[u.RouterEvent.Hide]:function(){this.transition(u.Route.HIDDEN)},[u.RouterEvent.ToDebug]:function(){this._debugClicked()},[u.RouterEvent.CloseWindow]:function(){c.RouterUtils.isChatMinAvailable()?this.transition(u.Route.CHAT_MIN):this.transition(u.Route.LABEL)}},[u.Route.CALL]:{_onEnter:function(){this.trigger("route_change",u.Route.CALL)},[u.RouterEvent.Submit]:function(){c.RouterUtils.needToShowEula()?this.transition(u.Route.CALL_EULA):this.trigger("submit_success")},[u.RouterEvent.ToEula]:function(){this.transition(u.Route.CALL_EULA)},[u.RouterEvent.CloseWindow]:function(){c.RouterUtils.isChatMinAvailable()?this.transition(u.Route.CHAT_MIN):this.transition(u.Route.LABEL)},[u.RouterEvent.Hide]:function(){this.transition(u.Route.HIDDEN)},[u.RouterEvent.ToChat]:function(){this._navToChat()},[u.RouterEvent.ToDebug]:function(){this._debugClicked()}},[u.Route.CALL_EULA]:{_onEnter:function(){this.trigger("route_change",u.Route.CALL_EULA)},[u.RouterEvent.Submit]:function(){if(w.getPrevRoute()===u.Route.CALL)return this.transition(u.Route.CALL),void this.trigger("submit_eula_success",w.getPrevRoute());this.trigger("submit_success")},[u.RouterEvent.Cancel]:function(){p.appDispatchers.setShowEula(!1),this.transition(u.Route.CALL)},[u.RouterEvent.ToChat]:function(){this.transition(u.Route.CHAT)},[u.RouterEvent.CloseWindow]:function(){p.appDispatchers.setShowEula(!1),this.transition(u.Route.LABEL)},[u.RouterEvent.Hide]:function(){this.transition(u.Route.HIDDEN)},[u.RouterEvent.ToDebug]:function(){this._debugClicked()}},[u.Route.CALL_POPUP]:{_onEnter:function(){this.trigger("route_change",u.Route.CALL_POPUP)},[u.RouterEvent.Submit]:function(){this.transition(u.Route.CALL)},[u.RouterEvent.CloseWindow]:function(){c.RouterUtils.isChatMinAvailable()?this.transition(u.Route.CHAT_MIN):this.transition(u.Route.LABEL)}},[u.Route.DEBUG]:{_onEnter:function(){this.trigger("route_change",u.Route.DEBUG)},[u.RouterEvent.CloseWindow]:function(){this.transition(c.RouterUtils.getRouteChatMin())},[u.RouterEvent.ToChat]:function(){this._navToChat()},[u.RouterEvent.ToCall]:function(){l.default.mobileOrTablet()?this.transition(u.Route.CALL):this.transition(u.Route.CHAT_CALL),d.Monitoring.telemetry(f.TelemetryName.CW_ONLINE_HEADER_BUTTON)}}}});t.Router=w,w.on("route_change",(e=>{if(p.appDispatchers.setAppRoute(e),l.default.safari()&&!l.default.mobileOrTablet()){const t=w.getPrevRoute();(e===u.Route.DEBUG&&t===u.Route.INTRODUCE||e===u.Route.INTRODUCE&&t===u.Route.DEBUG||e==u.Route.INTRODUCE&&t===u.Route.CHAT||t===u.Route.CHAT_EULA||e===u.Route.CHAT_EULA)&&setTimeout((()=>{const e=g.default.get(_.Component.WIDGET_CONTAINER);(0,m.updateKeyframes)(e,!0)}),50)}}))},80161:function(e,t,n){"use strict";var a=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.RouterUtils=void 0;var o=a(n(33119)),r=a(n(92664)),i=a(n(1039)),s=a(n(26754)),l=a(n(19955)),u=n(47060),c=n(44145),d=n(94537),f=n(47138);const p=new(function(){function e(){(0,o.default)(this,e)}return(0,r.default)(e,[{key:"showDepartmentsIfPossible",value:function(){const e=(0,c.getApp)(),t=(0,c.getClient)();return(0,c.getUserSettings)().departments&&!t.departmentId&&!s.default.agent_id&&!e.chatStarted&&e.isOnline}},{key:"needToShowEula",value:function(){return i.default.eula&&!(0,c.getClient)().eulaAccepted}},{key:"canShowIntroduceForm",value:function(){const e=(0,c.getApp)().isOnline,t=(0,c.getClient)().isIntroduced,n=(0,c.getUserSettings)().contactsAsk;return e&&!t&&n===d.ContactsType.BEFORE_CHAT}},{key:"getRouteChatMin",value:function(){return this.isChatMinAvailable()?u.Route.CHAT_MIN:(0,c.getCallback)().status===f.CallStatus.CONNECTED?u.Route.CALL:u.Route.LABEL}},{key:"callbackEnabled",value:function(){const e=i.default.callback_settings;return!!(e.time&&e.countries&&e.countries.length)}},{key:"isChatMinAvailable",value:function(){const e=(0,c.getUserSettings)().labelBubble,t=s.default.agent_id||s.default.bot_id,n="join"==s.default.state;return(0,c.getApp)().chatAccepted&&(0,c.getApp)().isOnline&&t&&n&&!l.default.mobileOrTablet()&&(0,c.getCallback)().status!==f.CallStatus.CONNECTED&&!e}}]),e}());t.RouterUtils=p},13077:function(e,t,n){"use strict";var a=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.addPageView=function(){const e=r.default.get("pages_count");e?r.default.set("pages_count",parseInt(e)+1):r.default.set("pages_count",1)},t.checkCondition=w,t.checkTimeConditions=function(e,t,n){let a=!1;for(let o=0;o{const t=y("goalElementClick");_.warn("onGoalClick",t),t[window.btoa(e)]=e,b("goalElementClick",t)},o=s.default.mobileOrTablet()&&s.default.isTouchEnabled()?"touchstart":"click";n?(0,m.addListener)(n,o,a,!0):_.info(`Element with selector: "${e}" is not found on page.`)}catch(e){_.info("Error click element",e)}},t.isAllStaticChecked=function(e){const t=e.filter((e=>e.isChecked));return e.filter((e=>e.isStatic)).length===t.length},t.isDefaultProactive=function(){if(!u.default.rules)return;const e=JSON.stringify([{value:!0,condition:d.RuleConditions.ONLINE},{value:10,condition:d.RuleConditions.TIME_ON_PAGE,comparator:"greater"},{value:120,condition:d.RuleConditions.TIME_AFTER_CLOSE,comparator:"greater"},{value:60,condition:d.RuleConditions.TIME_AFTER_INVITAION,comparator:"greater"}]);return u.default.rules.filter((t=>{if(t.conditions&&JSON.stringify(t.conditions)===e)return!0})).length>0},t.isGoalCondition=O,t.isPopupCommand=function(e){return-1!==[d.RuleTypes.PROACTIVE,d.RuleTypes.OPEN_OFFLINE,d.RuleTypes.SHOW_CALLFORM].indexOf(e)},t.isTimeCondition=function(e){return null==e?void 0:e.includes("time")},t.isYandexMarketClient=function(e){const t=1==i.default.get("visits_count"),n=r.default.get("pages_count")<10;return!s.default.mobileOrTablet()&&t&&n&&-1!==["market","YM"].indexOf(e.source)&&"cpc"==e.medium},t.reportInitCampaign=void 0,t.setInvitationTime=function(){r.default.set("invitation_time",(new Date).getTime())},t.setRuleLocal=b,t.timeDiff=E;var o=n(4425),r=a(n(66547)),i=a(n(73687)),s=a(n(19955)),l=a(n(4855)),u=a(n(1039)),c=n(69882),d=n(83907),f=n(60718),p=n(66139),h=n(44145),g=n(54415),m=n(21951);const _=l.default.name("RuleManagerUtils"),v={scrollPosition:!1,movedToCloseButton:!1,firstMessageTime:null,pageEnterTime:(new Date).getTime(),prechatUseTime:null,lastUpdateProactiveEvent:null,lastContactApiData:null,sendStartupTime:null,isVisitorInvite:null,goalElementClick:{}};function y(e){if(e in v)return v[e]}function b(e,t){e in v&&(v[e]=t)}function E(e){return Math.round(((new Date).getTime()-e)/1e3)}function T(e){var t,n;const a=(0,c.getCurrentPage)().url,l=(new Date).getDay(),u=r.default.get("close_time"),f=r.default.get("invitation_time"),p=(0,h.getUserSettings)().chatMode,g=(0,h.getSystemSettings)().geoIp;switch(e){case d.RuleConditions.ONLINE:return p===o.ChatMode.ONLINE;case d.RuleConditions.PAGE_URL:return a.replace(/^http(s?):\/\//i,"");case d.RuleConditions.PAGE_TITLE:return(0,c.getCurrentPage)().title;case d.RuleConditions.HOUR:return(new Date).getHours();case d.RuleConditions.WEEK_DAY:return 0===l?7:l;case d.RuleConditions.TIME_AFTER_CLOSE:return u?E(u):Number.MAX_VALUE;case d.RuleConditions.TIME_AFTER_FIRST_MSG:return v.firstMessageTime?E(v.firstMessageTime.getTime()):NaN;case d.RuleConditions.TIME_AFTER_INVITAION:return null===f||""===f?Number.MAX_VALUE:E(f);case d.RuleConditions.TIME_ON_PAGE:return E(v.pageEnterTime);case d.RuleConditions.TIME_ON_SITE:return E(r.default.get("enter_ts"));case d.RuleConditions.NUMBER_OF_VISITS:return i.default.get("visits_count");case d.RuleConditions.PAGES_COUNT:return parseInt(r.default.get("pages_count"));case d.RuleConditions.COUNTRY:return null==g?void 0:g.split(";")[0];case d.RuleConditions.CITY:return(null==g?void 0:g.split(";")[2])||null;case d.RuleConditions.ONCE_A_DAY:return!0;case d.RuleConditions.UTM_SOURCE:return(null===(t=(0,h.getClient)().utm)||void 0===t||null===(n=t.source)||void 0===n?void 0:n.toLowerCase().trim().replace("/(|)/i",""))||d.UtmSource.DIRECT;case d.RuleConditions.DEVICE:return s.default.mobileOrTablet()?d.DeviceType.MOBILE:d.DeviceType.DESKTOP;default:return r.default.get(e)}}function C(e){const t=e.condition,n=e.value,a=e.attr;switch(t){case d.RuleConditions.GOAL_CLOSE:return v.movedToCloseButton;case d.RuleConditions.GOAL_SCROLL:return v.scrollPosition;case d.RuleConditions.GOAL_CLICK:return!!n&&v.goalElementClick[window.btoa(n)];case d.RuleConditions.GOAL_CUSTOM_ATTR:return!!n&&A(a)}}function O(e){return null==e?void 0:e.includes("goal")}function S(e){const t=e.match(/^(?:https?:)?(?:\/\/)?([^\/\?]+)/gi);if(t&&t.length){const n={href:e,hostname:t[0]};e=(0,c.getUnicodeHref)(n).replace(/http(|s):\/\//,"")}else e=e.replace(/http(|s):\/\//,"");return e}function w(e,t){const n=O(e.condition)?C(e):T(e.condition);e.condition===d.RuleConditions.PAGE_URL&&(e.value=S(e.value)),e.condition===d.RuleConditions.PAGES_COUNT&&(e.value=parseInt(e.value));const a=(0,p.compareCondition)(n,e.value,e.comparator);let o=`${t||""}; ${a?"success":"failed"}`;return o+=` condition ${e.condition}; comparator=${e.comparator}`,_.info(`${o}; expected=${e.value}; actual=${n}`),"once_a_day"==e.condition||a}t.reportInitCampaign=e=>{g.Monitoring.reportStats(f.StatType.INIT,e)};const A=e=>{const t=(0,h.getClient)().customData;if(!t)return;const n=t.find((t=>t.key===e));return null==n?void 0:n.content};t.getCustomValue=A},79868:function(e,t,n){"use strict";var a=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=a(n(1039)),r=a(n(4855)),i=n(83170),s=n(26932),l=a(n(73687)),u=a(n(19955)),c=n(54034),d=n(97615),f=n(54415),p=n(44145),h=n(67597),g=n(21951);const m=r.default.name("Social"),_=new(0,n(89766).EventEmitter);let v={vk:!1,fb:!1,mode:!1},y=null,b=!1;const E={getSocial(){return y||v},setPopupMode(e){y=e,v.mode=y,s.socialDispatchers.initializeSocialStore(v),_.emit("update",v)},getPopupMode(){return y},setSocial(e){return v=e,v},isLoginned(){return v.vk||v.fb},getJoints(){let e=0;const t={};return c.CallbackUtils.isCallbackEnabled()?(t.callback=!0,e++):o.default.power_button_phone&&(t.cbUrl=o.default.power_button_phone,e++),o.default.joint?(o.default.joint.sb&&e++,o.default.joint.ig&&e++,o.default.joint.fb&&o.default.joint.fb.joint_id&&(t.fbUrl="https://m.me/"+o.default.joint.fb.joint_id,e++),o.default.joint.wa&&(t.waUrl="https://wa.me/"+o.default.joint.wa,e++),o.default.joint.vk&&o.default.joint.vk.joint_id&&(t.vkUrl="https://vk.me/club"+o.default.joint.vk.joint_id,e++),o.default.joint.vb&&o.default.joint.vb.botname&&(t.vbUrl="viber://pa?chatURI="+o.default.joint.vb.botname,e++),o.default.joint.tg&&o.default.joint.tg.botname&&(t.tgUrl=(0,h.getTgLink)(o.default.geoip)+o.default.joint.tg.botname,e++),this.isImVersion()&&o.default.joint.im&&o.default.joint.im.joint_id&&(t.imUrl=`sms://open?service=iMessage&recipient=urn:biz:${o.default.joint.im.joint_id}&biz-intent-id=click_in_jivo`,e++),{links:t,count:e}):{links:t,count:e}},startSocials(){m.log("startSocials"),b||u.default.mobileOrTablet()||!o.default.joint||!o.default.joint.vk&&!o.default.joint.fb||l.default.get("is_blacklisted")||(b=!0,this.initSocial(),(0,g.addListener)(window,"message",this.checkLogin.bind(this),!1))},initSocial(){const e=this.checkSocial();if(m.log("initSocial",e),e){const t=this.genSocialIframeUrl(e)+"#rand="+(new Date).getMilliseconds()+",lang="+o.default.locale,n=document.createElement("iframe");n.src=t,n.className="iframe-social",n.title="JivoSocial",document.body.appendChild(n)}},checkSocial(){if(!o.default.joint)return;let e="check";o.default.joint.vk&&!o.default.joint.fb&&(e="checkvk"),o.default.joint.fb&&!o.default.joint.vk&&(e="checkfb");const t=document.getElementsByClassName("check-iframe");return!(t&&t.length>0)&&(!(!o.default.joint.vk&&!o.default.joint.fb)&&e)},genSocialIframeUrl(e){m.log("getnSocialIframeUrl",e);const t=["mode="+e],n=(0,p.getClient)();o.default.joint.vk&&(t.push("vk_app_id="+o.default.joint.vk.app_id),t.push("vk_joint_id="+o.default.joint.vk.joint_id),t.push("vk_key="+this.genVkRandomKey())),o.default.joint.fb&&(t.push("fb_app_id="+o.default.joint.fb.app_id),t.push("fb_joint_id="+o.default.joint.fb.joint_id),t.push("fb_key="+n.clientId+"_"+o.default.widget_id)),t.push("logs="+(o.default.logs||0));const a=d.EnvironmentManager.isDevelopment()?"/public/social.html?":"/social.min.html?";return(0,h.staticUrl)(a+t.join("&"),!0)},genVkRandomKey(){return((0,p.getClient)().clientId+"="+o.default.widget_id).replace(/./g,(function(e){return e.charCodeAt(0).toString(16)}))},getIframeUrl(e){return this.genSocialIframeUrl(e)+"#rand="+(new Date).getMilliseconds()+",lang="+o.default.locale},checkLogin(e,t){if(m.log("checkLogin",e,t),e&&"object"==typeof e){if(t&&(e={data:{social:t}}),e.data&&e.data.social){const t={},n=e.data.social;return n.fb&&(t.fb=!0,t.vk=!1,t.mode="fb",f.Monitoring.telemetryOnce(i.TelemetryName.SOCIAL_SHOW_FACEBOOK)),n.vk&&(t.vk=!0,t.fb=!1,t.mode="vk",f.Monitoring.telemetryOnce(i.TelemetryName.SOCIAL_SHOW_VK)),n.fb||n.vk||(t.vk=!1,t.fb=!1,t.mode="email"),v={vk:t.vk,fb:t.fb,mode:t.mode},_.emit("update",v),s.socialDispatchers.initializeSocialStore(v),t}}else m.log("postMessage from social failed: ",e)},isImVersion(){return(u.default.ios()||u.default.ipad())&&u.default.iosVersion()>=11.3},ifIMessageEnabled(){const e=this.getJoints();return!!(this.isImVersion()&&e.links&&e.links.imUrl)}};var T=Object.assign(_,E);t.default=T},44145:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getAgentById=l,t.getAgentIdsByStatus=function(e){return i().reduce(((t,n)=>(n.state===e&&t.push(n.id),t)),[])},t.getAgentMessages=g,t.getAgents=i,t.getApp=function(){return r.reduxStore.getState().app},t.getBotById=function(e){return s().find((t=>t.id===e&&t.isBot))},t.getBotIdsByStatus=function(e){return s().reduce(((t,n)=>(n.state===e&&t.push(n.id),t)),[])},t.getBots=s,t.getCallback=function(){return r.reduxStore.getState().callback},t.getCallbackSettings=function(){return r.reduxStore.getState().settings.user.callback},t.getChatById=function(e){return u().find((t=>t.id===e))},t.getChats=u,t.getClient=c,t.getClientMessages=h,t.getFeatures=function(){return r.reduxStore.getState().settings.features},t.getFormIntroduceText=function(){return d().filter((e=>e.type===o.MessageType.PREFORM&&e.from===o.MessageInitiator.FORM))[0]},t.getFormMessage=function(){return m(d(),o.MessageType.FORM)[0]},t.getJoinedAgents=function(){const e=[],t=u();if(t&&t.length>0){const n=t[t.length-1];n.joinedAgents.forEach((t=>{e.push(l(t))}))}return e},t.getLastChatId=function(){const e=g(d()),t=h(d()),n=e.length?e[e.length-1].chat_id:null,a=t.length?t[t.length-1].chat_id:null;return a>n?a:n},t.getLastClientMessage=function(){const e=h(d());return e[e.length-1]},t.getLastMessageByName=function(e){const t=v(d(),e);return t[t.length-1]},t.getLastMessageByStatus=function(e){const t=_(d(),e);return t[t.length-1]},t.getLastMessageByType=function(e){const t=m(d(),e);return t[t.length-1]},t.getMessageByMessageId=function(e){return d().find((t=>t.msg_id===e))},t.getMessageByPrivateId=function(e){return d().find((t=>t.private_id===e))},t.getMessages=d,t.getMessagesByName=v,t.getMessagesByStatus=_,t.getMessagesByType=m,t.getOfflineUnreadProactive=function(){return d().filter((e=>e.from===o.MessageInitiator.AGENT&&e.status!==o.MessageStatus.READ&&e.type===o.MessageType.FOR_TEST))},t.getPosition=function(){return r.reduxStore.getState().position},t.getProactive=f,t.getRateFormMessage=function(){return m(d(),o.MessageType.RATE_FORM)[0]},t.getSettings=function(){return r.reduxStore.getState().settings},t.getState=function(){return r.reduxStore.getState()},t.getSystemSettings=function(){return r.reduxStore.getState().settings.system},t.getUnreadMessages=function(){return d().filter((e=>[o.MessageInitiator.AGENT,o.MessageInitiator.AGENT_BOT].includes(e.from)&&e.status!==o.MessageStatus.READ&&e.status!==o.MessageStatus.DELETED&&e.type!==o.MessageType.FOR_TEST))},t.getUserSettings=p,t.getZoom=function(){return r.reduxStore.getState().zoom},t.needToShowIntroduceForm=function(){const e=p().contactsAsk,t=c().isIntroduced,n=f().text;return e===a.ContactsType.BEFORE_CHAT&&!t&&!n};var a=n(94537),o=n(81152),r=n(62096);function i(){return r.reduxStore.getState().agents}function s(){return r.reduxStore.getState().bots}function l(e){return i().find((t=>t.id===e))}function u(){return r.reduxStore.getState().chats}function c(){return r.reduxStore.getState().client}function d(){return r.reduxStore.getState().messages}function f(){return r.reduxStore.getState().proactive}function p(){return r.reduxStore.getState().settings.user}function h(e){return e.filter((e=>e.from===o.MessageInitiator.CLIENT))}function g(e){return e.filter((e=>e.from===o.MessageInitiator.AGENT))}function m(e,t){return e.filter((e=>e.type===t))}function _(e,t){return e.filter((e=>e.status===t))}function v(e,t){return e.filter((e=>{var n;return(null===(n=e.body)||void 0===n?void 0:n.name)===t}))}},39976:function(e,t,n){"use strict";var a=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=a(n(84633)),r=n(32710),i=a(n(66547));const s=a(n(4855)).default.name("Timer");var l=new o.default({timer:0,seconds:0,timerText:!1,initialState:"unitialized",namespace:"Timer",setTimerNull:function(){clearInterval(this.timer),i.default.set("cw_timer",null)},initialize:function(){s.log("Timer initalized.")},states:{unitialized:{start_timer:"STARTTIMER"},STARTTIMER:{_onEnter:function(){this.handle("start_timer")},start_timer:function(){let e=1e3*this.seconds;const t=this.timerText;t&&(t.innerText=e/1e3);let n=this.seconds;clearInterval(this.timer),this.timer=setInterval((0,r.bind)((function(){const t=i.default.get("cw_timer");if(t){const n=parseInt((new Date).getTime())-parseInt(t);if(e=1e3*this.seconds-n,e=1e3*(e/1e3).toFixed(2),e<=0)return clearInterval(this.timer),this.timer=!1,void this.handle("timer_finished")}else i.default.set("cw_timer",(new Date).getTime());n=e/1e3,e-=100,e<=0&&(n=e,clearInterval(this.timer),this.timer=!1,this.handle("timer_finished")),this.emit("tick",n)}),this),10)},timer_finished:"STOP",cancel_timer:"unitialized"},STOP:{_onEnter:function(){s.log("STOP, timer_finished")},start_timer:"STARTTIMER"}}});t.default=l},2982:function(e,t,n){"use strict";var a=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.updateKeyframes=t.setProperty=t.saveLabelPosition=t.jivoCustomCSSProperty=t.isFallbackNeeded=t.getSavedLabelPosition=t.getProperty=void 0;var o=a(n(61125)),r=a(n(19955));function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}const s=a(n(4855)).default.name("TransitionUtils"),l=e=>`--j${e}`;t.jivoCustomCSSProperty=l;const u=(e,t)=>t&&t.style?c()?t.style[e]:t.style.getPropertyValue(l(e)):null;t.getProperty=u;t.setProperty=(e,t,n)=>{c()?n.style[e]=t:n.style.setProperty(l(e),t)};t.updateKeyframes=(e,t)=>{if(r.default.supportsWebAnimationApi()){const n=u("height",e),a=u("left",e),o=u("right",e),i=e&&e.getAnimations()[0];if(r.default.safari()&&r.default.iosVersion()>="15.4"&&!i.effect.composite&&!t)return;const l=i&&i.effect.getKeyframes(),c=l&&l[l.length-1];s.log("updateKeyframes",i),c&&(c.height=n,c.left=a,c.right=o,i.effect.setKeyframes(l),i.currentTime=300)}};const c=()=>!r.default.supportsCssVariables()||r.default.ieOrEdge()||r.default.safari()&&!r.default.supportsWebAnimationApi();t.isFallbackNeeded=c;let d={};t.saveLabelPosition=e=>{d={right:e.right||null,left:e.left||null,offsetWidth:e.offsetWidth||null}};t.getSavedLabelPosition=()=>function(e){for(var t=1;tt;case"greater_equal":return e>=t;case"lower":return e!(!e||!t)&&-1!==(null==e?void 0:e.toLowerCase().indexOf(null==t?void 0:t.toLowerCase()))},625:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getZoom=void 0;var a=n(69882);t.getZoom=e=>(0,a.isChatPage)()?"none":(0,a.isWixContext)()?1:e},43914:function(e,t,n){"use strict";var a=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t._callUserFunction=function(e,t){if(l.log("_callUserFunction",e,t),e="jivo_"+e,"function"==typeof(0,s.getPageWindow)().window[e])try{l.log("JIVO: calling user function "+e),(0,s.getPageWindow)().window[e](t),l.log("JIVO: user function "+e+" returned"),i.Monitoring.telemetryWithProbability(e,{},o.RateLimit.Low)}catch(e){l.log("ERROR: _callUserFunction",e)}};var o=n(83170),r=a(n(4855)),i=n(54415),s=n(69882);const l=r.default.name("callParent")},75901:function(e,t,n){"use strict";var a=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.formatText=function(e){if(!e)return"";e=e.replace("
","\n");const t=(e=(0,s.escape)(e).replace(/(?:\r\n|\r|\n)/g,"
")).replace((0,i.getEmojiRegExp)()," $& "),n=(0,r.replaceLinksWithAnchor)(t);return o.default.disable_emoji?n:(0,l.createEmoji)(n)};var o=a(n(1039)),r=n(63621),i=n(66488),s=n(11413),l=n(69845)},6987:function(e,t,n){"use strict";function a(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(a=function(e){return e?n:t})(e)}function o(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=a(t);if(n&&n.has(e))return n.get(e);var o={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var s=r?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(o,i,s):o[i]=e[i]}return o.default=e,n&&n.set(e,o),o}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r={common:o(n(83778)),callback:o(n(54034)),call:o(n(31984)),chat:o(n(81722)),config:o(n(94564)),dom:o(n(43025)),messageHistory:o(n(49594)),messagesMain:o(n(82726)),qa:o(n(90361)),router:o(n(80161)),ruleManager:o(n(13077)),store:o(n(44145)),transition:o(n(2982))};t.default=r},41168:function(e,t,n){"use strict";var a=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.getCallDefaultError=void 0;var o=a(n(84726));t.getCallDefaultError=()=>`${(0,o.default)("cw_unableToConnect")}\n${(0,o.default)("cw_errInfoText")}`},21951:function(e,t,n){"use strict";var a=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.addListener=void 0,t.listenVisibility=function(e){const t=(0,r.debounce)(e,50);let n,a,i="hidden";void 0!==document.hidden?(i="hidden",a="visibilitychange",n="visibilityState"):void 0!==document.mozHidden?(i="mozHidden",a="mozvisibilitychange",n="mozVisibilityState"):void 0!==document.msHidden?(i="msHidden",a="msvisibilitychange",n="msVisibilityState"):void 0!==document.webkitHidden&&(i="webkitHidden",a="webkitvisibilitychange",n="webkitVisibilityState");"addEventListener"in document&&void 0!==a&&(document.addEventListener(a,(0,o.bind)(t,this,n),!1),parent.document.addEventListener(a,(0,o.bind)(t,this,n),!1),parent.document.addEventListener("focus",(0,o.bind)(t,this,n),!1),parent.document.addEventListener("blur",(0,o.bind)(t,this,n),!1),parent.window.addEventListener("focus",(0,o.bind)(t,this,n),!1),parent.window.addEventListener("blur",(0,o.bind)(t,this,n),!1))},t.removeEvent=void 0;var o=n(32710),r=n(90991),i=a(n(19955));t.addListener=function(e,t,n){let a=arguments.length>3&&void 0!==arguments[3]&&arguments[3];var o;e.addEventListener?e.addEventListener(t,n,!!i.default.supportsPassiveListeners()&&{passive:a}):e.attachEvent&&(e.attachEvent("on"+t,(o=e,function(){n.call(o,window.event)})),e=null)};t.removeEvent=(e,t,n)=>{if(window.removeEventListener)e.removeEventListener(t,n,!1);else{if(!window.detachEvent)return!1;{const a=function(){n.call(e)};e.detachEvent("on"+t,a)}}}},91225:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isMinRoute=t.isIntroduceRoute=t.isContainerRoute=t.isChatRoute=t.isChatInputRoute=t.isChatClosedRoute=void 0;var a=n(47060);t.isContainerRoute=e=>![a.Route.LABEL,a.Route.LABEL_INVITATION,a.Route.HIDDEN].includes(e);t.isChatClosedRoute=e=>[a.Route.LABEL,a.Route.CHAT_MIN].includes(e);t.isMinRoute=e=>e===a.Route.CHAT_MIN;t.isIntroduceRoute=e=>e===a.Route.INTRODUCE;t.isChatRoute=e=>-1!==[a.Route.CHAT,a.Route.INTRODUCE,a.Route.DEPARTMENTS].indexOf(e);t.isChatInputRoute=e=>[a.Route.CHAT,a.Route.CHAT_CALL].includes(e)},68403:function(e,t,n){"use strict";var a=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.showAd=t.isPaidCustomer=t.isJivoSite=t.isEmailOrPhoneRequired=t.isChatContactForm=t.isAnyRequired=t.isAnalyticsDisabled=t.hasIntegration=t.getJoinedAgents=t.getContactSettingsInfo=t.fixOfflineSettings=void 0;var o=n(94537),r=n(9393),i=a(n(1039));t.showAd=()=>!(i.default.unverified||i.default.options&&i.default.hide_ad);t.isPaidCustomer=()=>16&i.default.options;t.hasIntegration=e=>-1!==["vk","fb","sb"].indexOf(e);t.fixOfflineSettings=e=>(!e.email.show&&e.phone.show?e.phone={show:!0,required:!0}:e.email={show:!0,required:!0},e);t.isEmailOrPhoneRequired=e=>{let t=!1;return!!e&&((e.phone.show&&e.phone.required||e.email.show&&e.email.required)&&(t=!0),t)};t.isAnyRequired=e=>{let t=!1;return!!e&&((e.phone.show&&e.phone.required||e.email.show&&e.email.required||e.name.show&&e.name.required)&&(t=!0),t)};t.getContactSettingsInfo=()=>{if(!i.default.contacts_settings)return"";const e=i.default.contacts_settings,t=Object.keys(e),n={name:0,phone:1,email:2},a=[];return(0,r.each)(t,(t=>{const o=e[t].show&&e[t].required?"*":"";e[t].show&&(a[n[t]]=t+o)})),a.filter((e=>e)).join(";")};t.isChatContactForm=()=>-1!==[o.ContactsType.DURING_CHAT,o.ContactsType.DURING_CHAT_NO_CLOSE].indexOf(i.default.contacts_ask);t.getJoinedAgents=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(e.length>t.length)return[];const a=[];return t.forEach((t=>{e.includes(t.id)&&t.isBot===n&&a.push(t)})),a};t.isAnalyticsDisabled=()=>!!i.default.disable_analytics;t.isJivoSite=()=>1===i.default.site_id},16016:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setSubstrTitle=t.getRandomString=t.generateGUIDCount=t.generateGUID=t.formatTextLen=void 0;const n=()=>{const e=Math.floor(65536*Math.random()).toString(16);return 4===e.length?e:n()};t.getRandomString=n;t.generateGUID=()=>{const e=n;return e()+e()+"-"+e()+"-"+e()+"-"+e()+"-"+e()+e()+e()};t.generateGUIDCount=e=>{let t="";for(;e--;)t+=n();return t};t.setSubstrTitle=e=>e.substring(0,255);t.formatTextLen=(e,t)=>e.length>t?e.substr(0,t)+"...":e},80598:function(e,t,n){"use strict";var a=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.getThemeColor=t.getTextSize=t.getTextColor=t.getPowerButtonDesktopPosition=t.getMobileBackgroundColor=t.getLineHeight=t.getBackground=void 0;var o=a(n(19955)),r=n(69882),i=a(n(27104)),s=a(n(2559));t.getTextSize=e=>{if(o.default.ios()&&(0,r.isWixContext)())return"normal";let t=null;return o.default.ios()?(1!==e&&(t=100*e+"%"),t||"none"):t};t.getLineHeight=(e,t)=>{let n=null;return 1!==t&&(n=(e||1.25)/t+"em"),n};t.getTextColor=e=>"dark"==e?"#222222":"#F0F1F1";t.getThemeColor=e=>{switch(e){case"grey":return s.default.STEEL_80;case"blue":return s.default.BLUE_90;default:return s.default.GREEN_90}};t.getBackground=(e,t,n,a,o)=>{let r=i.default.getGradientBg(e,t);return o&&(r=l(n,a,r)),r};const l=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"#44BB6E",n=arguments.length>2?arguments[2]:void 0;return e?n:t};t.getMobileBackgroundColor=l;t.getPowerButtonDesktopPosition=(e,t)=>{const n=+t;return"right"!==e&&"bottom"!==e||50!==n&&100!==n?"left":"right"}},67597:function(e,t,n){"use strict";var a=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.validateCustomDataLink=t.trackCallLogo=t.staticUrl=t.replaceServicezoneURL=t.replaceServicezoneTitle=t.isValidHttpURL=t.isServicezoneURL=t.getUtmLink=t.getTgLink=t.getIMessageLink=t.getHostURL=t.getEulaLink=t.getCopyrightSiteByLocale=t.getBundleSrc=t.getAvatarUrl=t.getAvatarApiUrl=t.fixUrl=t.fixTitle=t.cdnPatternUrl=t.cdnLinkToEmoji=void 0;var o=n(69882),r=n(28008),i=n(55004),s=n(97615),l=a(n(1039)),u=a(n(19955)),c=n(22271),d=n(51542),f=n(68403);const p=(e,t)=>t?`${(0,o.getProtocol)()}${e}/avatars/${t}`:null;t.getAvatarUrl=p;t.getAvatarApiUrl=(e,t)=>{if(t)return 0==t.indexOf("data:image")?t:p(e,t)};t.getIMessageLink=e=>`sms://open?service=iMessage&recipient=urn:biz:${e}&biz-intent-id=click_in_jivo`;const h=()=>l.default.base_url;t.getHostURL=h;const g=(e,t)=>(t||(e+="?rnd="+(new Date).getTime()),s.EnvironmentManager.isDevelopment()?e:(0,o.getProtocol)()+h()+e);t.staticUrl=g;t.cdnLinkToEmoji=e=>g((s.EnvironmentManager.isDevelopment()?"/public":"")+"/images/emoji/"+e+".svg",!0);const m=(e,t)=>{const n=_(e);return!(0,r.isUndefined)(n)&&((0,i.isFunction)(t)?t(n):/^https?:$/.test(n.protocol))};t.isValidHttpURL=m;t.validateCustomDataLink=(e,t)=>m(e,(e=>{const n=_(t);return n&&e.origin.includes(n.origin)}));const _=e=>{let t;try{t=new URL(e)}catch(e){return}return t},v=()=>{const e=l.default.locale;let t="https://www.jivochat.com";-1!=["ru_RU","be","kk","uk"].indexOf(e)?t="https://www.jivo.ru":-1!=["pt","pt_BR"].indexOf(e)?t="https://www.jivochat.com.br":-1!=["es"].indexOf(e)?t="https://www.jivochat.es":-1!=["de"].indexOf(l.default.locale)?t="https://www.jivochat.de":-1!=["tr"].indexOf(l.default.locale)?t="https://www.jivochat.com.tr":-1!=["id"].indexOf(l.default.locale)&&(t="https://www.jivochat.co.id");const n=(0,o.getPageWindow)().location.hostname.split("."),a=n[n.length-1];return"de"===a?t="https://www.jivochat.de":"cl"===a?t="https://www.jivochat.cl":"bo"===a?t="https://www.jivochat.com.bo":"co"===a?t="https://www.jivochat.com.co":"ve"===a?t="https://www.jivochat.com.ve":"pe"===a?t="https://www.jivochat.com.pe":"mx"===a?t="https://www.jivochat.mx":"ar"===a&&(t="https://www.jivochat.com.ar"),t};t.getCopyrightSiteByLocale=v;t.getUtmLink=e=>{const t="logo_on_popup"===e?"from_popup":"from_widget";return"chat"===e&&(e=u.default.mobile()?"chat_mobile":"chat_desktop"),v()+"/i_sa/?utm_source="+encodeURIComponent((0,o.getPageWindow)().location.hostname)+`&utm_medium=link&utm_content=${e}`+`&utm_campaign=${t}`};t.trackCallLogo=()=>v()+"/calls?utm_source="+(0,o.getPageWindow)().location.host+"&utm_medium=link&utm_content=callback_popup&utm_campaign=self_ad";t.cdnPatternUrl=()=>`url(${g((s.EnvironmentManager.isDevelopment()?"/public":"")+"/images/pattern/"+l.default.pattern+".svg",!0)})`;t.getBundleSrc=()=>(s.EnvironmentManager.isDevelopment()?"/public/js/bundle_":l.default.base_url+"/js/bundle_")+l.default.locale+".js?rand="+l.default.build_number;t.getEulaLink=(e,t)=>window.parent.location.protocol+e+"/script/eula/"+t;t.fixUrl=e=>{const t=l.default.shard_id;return(0,f.isJivoSite)()||!y(e)?e:t===d.Shards.SBER?b(e,"https://jivo.ru"):b(e,"https://jivochat.com")};t.fixTitle=(e,t)=>{const n=l.default.shard_id;return(0,f.isJivoSite)()||!y(t)?e:n===d.Shards.SBER?E(e,"Jivo"):E(e,"JivoChat")};const y=e=>c.Regexp.SERVICEZONE_DOMAIN.test(e);t.isServicezoneURL=y;const b=(e,t)=>e.replace(e,t);t.replaceServicezoneURL=b;const E=(e,t)=>e.replace(e,t);t.replaceServicezoneTitle=E;t.getTgLink=e=>{if(e){if("RU"===e.split(";")[0])return"tg://resolve/?domain="}return"https://t.me/"}},84727:function(e,t,n){"use strict";var a=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.validateCustomData=t.validateClientAnswer=void 0;var o=a(n(15687)),r=a(n(4855)),i=a(n(98960)),s=n(67597);const l=r.default.name("validators:","color: grey");t.validateCustomData=(e,t)=>{if(!Array.isArray(e))return"Data must be array.";if(0===e.length)return"Data limit error, data length must be 1 to 10.";e.length>10&&(e.splice(10),l.warnParent("Data limit warning, data length must be 1 to 10."));const n=(e,t)=>{l.warnParent(`Item ${t} in setCustomData: ${e}.`)};return e.reduce(((e,a,r)=>{if("string"!=typeof a.content)return n("Property content must be string",r),e;a.link&&(t&&(0,s.isValidHttpURL)(a.link)?(0,s.validateCustomDataLink)(a.link,t)||(n("Such link is not allowed",r),delete a.link):(n("Safe url is not indicated",r),delete a.link));const i=((e,t)=>(a,o)=>{const r=e[a];return"string"==typeof r&&r.length>o?(n(`Max length for ${a} property is ${o}`,t),r.slice(0,o)):r})(a,r);return a.content=i("content",255),a.title=i("title",255),a.key=i("key",1e3),[].concat((0,o.default)(e),[a])}),[])};t.validateClientAnswer=(e,t)=>{if(!t||!e)return!1;const n=String(t).trim();return"email"==e?i.default.emailBot(n):"phone"==e?i.default.phone(n):"name"==e?i.default.name(n):void 0}},69882:function(e,t,n){"use strict";var a=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.isWixIframe=t.isWixEditor=t.isWixContext=t.isTextEmojiDisabled=t.isCustomLabel=t.isChatPage=t.isAppCobrowse=t.getUnicodeHref=t.getProtocol=t.getPageWindow=t.getCurrentPage=t.getChatPageToken=t.deleteNonce=void 0;var o=a(n(50754)),r=n(97615),i=n(67597);const s=()=>window.parent||window;t.getPageWindow=s;const l=()=>s().jivo_chat_page||!1;t.isChatPage=l;t.isAppCobrowse=()=>"cobrowser-iframe"===s().name;t.getProtocol=()=>{let e=s().location.protocol;return r.EnvironmentManager.isSelfhosted()&&"http:"===e||-1===["http","https"].indexOf(e)&&(e="https:"),e};t.deleteNonce=()=>{s().jivo_cspNonce&&delete s().jivo_cspNonce};t.isWixIframe=()=>void 0!==s().jivo_in_wix_iframe;const u=()=>{const e=s().wix_context;return e&&e.Utils&&e.Utils.getViewMode()};t.isWixContext=u;t.isWixEditor=()=>{const e=u();return!!e&&-1!==["preview","editor"].indexOf(e)};t.isCustomLabel=()=>{try{return!(!(window&&window.parent)||"function"!=typeof window.parent.jivo_onLoadCallback)&&-1!=window.parent.jivo_onLoadCallback.toString().search(/jivo_custom_widget/gi)}catch(e){return!1}};const c=e=>{try{const t=e.hostname;return e.href.replace(t,o.default.toUnicode(t))}catch(t){return e.href}};t.getUnicodeHref=c;t.getCurrentPage=()=>{const e=s();let t=e.location.href,n=e.document.title;const a=-1!==t.indexOf("about:");return""==n&&a&&(n=e.parent.document.title),t=c(a?e.parent.location:e.location),u()&&(t=e.wix_url||t,n=e.wix_title||n),{url:(0,i.fixUrl)(t),title:(0,i.fixTitle)(n.substring(0,255),t)}};t.isTextEmojiDisabled=()=>{const e=s();return e._wpemojiSettings||e.twemoji};t.getChatPageToken=()=>{if(l()){let e=null;try{const t=new URLSearchParams(s().location.search).get("token");t&&(e=decodeURIComponent(t))}catch(e){console.error(e)}return e}return null}},45430:function(e,t,n){"use strict";var a=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=a(n(61125)),r=a(n(33119)),i=a(n(92664));n(95020);var s=n(1039),l=n(52274),u=a(n(95003)),c=a(n(84726)),d=a(n(14264)),f=a(n(23116)),p=n(21951),h=n(69882),g=n(9393),m=n(90991),_=a(n(56026)),v=n(94564),y=n(43025),b=n(52028),E=n(47060),T=n(54415),C=n(83170),O=n(26022),S=a(n(22866)),w=n(13077),A=a(n(66547)),I=a(n(73687)),M=n(26932),P=n(20361),R=n(44145),k=n(97615),N=a(n(35802)),D=a(n(4855)),x=n(41504),L=n(91225);function j(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function B(e){for(var t=1;ta)}},{key:"init",value:function(){if(this.openConnection()){if(F.log("start init"),this.net.onopen=this.connectionOnOpen.bind(this),this.net.onget=this.onget.bind(this),this.net.onset=this.onset.bind(this),this.net.onclose=this.connectionOnClosed.bind(this),this.net.onerror=this.connectionOnError.bind(this),this.net.onfail=this.connectionOnFail.bind(this),this.net.ondrop=this.connectionOnDrop.bind(this),this.cacheCurrentKeys=this.getAllCurrentKeys(),u.default.addListener(this.changeCurrentKeysFn),N.default.getInstance().reduxStore.subscribe((()=>{(0,R.getApp)().route===E.Route.HIDDEN&&this.closeConnection(),this.changeCurrentKeysFn()})),d.default.on("create",this.changeCurrentKeysFn),f.default.addListener("update",(0,m.debounce)(this.checkClientAway.bind(this),l.AWAY_CLIENT_TIMEOUT)),(0,h.isWixContext)()){const e=(0,h.getPageWindow)().wix_context;e.addEventListener(e.Events.PAGE_NAVIGATION,this.changeCurrentKeysFn)}(0,p.listenVisibility)((()=>{this.changeCurrentKeysFn(),(0,y.pageVisible)()&&this.openConnection()}))}}},{key:"checkClientAway",value:function(){f.default.isActive||(0,y.pageVisible)()||!this.isConnected||this.net.close()}},{key:"getURL",value:function(){const e=(0,R.getClient)(),t=(0,R.getSystemSettings)().widgetId;return`${k.EnvironmentManager.isProduction()||"https:"===(0,h.getProtocol)()?"wss":"ws"}://${(0,s.getViHost)()}/${t}?${e.visitorId}`}},{key:"openConnection",value:function(){return this.isConnected||!this.ifNeedConnect()?(F.log("cant open connection"),!1):(this.net||(this.net=new ClientSocket),this.net.open(this.getURL()),!0)}},{key:"closeConnection",value:function(){F.log("close connection"),this.isConnected&&this.net&&this.net.close()}},{key:"connectionOnOpen",value:function(){F.log("connection open"),this.isConnected=!0,this.sendDynamicKeys(),this.changeCurrentKeysFn()}},{key:"connectionOnClosed",value:function(e){this.isConnected=!1,F.log("connection close: ",e)}},{key:"connectionOnError",value:function(e){F.error("connection error: ",e)}},{key:"connectionOnFail",value:function(e){T.Monitoring.telemetry(C.TelemetryName.VISITORS_FAIL,{param1:e})}},{key:"connectionOnDrop",value:function(e){0!==e&&(M.appDispatchers.setVIReconnectTime((new Date).getTime()+e),F.log("connection drop: ",e/1e3+"s"),setTimeout((()=>{v.ConfigUtils.reloadConfig(this.openConnection.bind(this))}),e))}},{key:"getKeys",value:function(e){const t=(0,h.getPageWindow)(),n=(0,R.getApp)(),a=(0,R.getClient)(),o={name:()=>a.name,phone:()=>a.phone,email:()=>a.email,desc:()=>a.description,purl:()=>(0,h.isWixContext)()?t.wix_url:(new _.default).decode((0,h.getCurrentPage)().url),ptitle:()=>{let e=(0,h.getCurrentPage)().title;return e===(0,c.default)("lblNewMessage")&&(e=this.cacheCurrentKeys&&this.cacheCurrentKeys.ptitle),(0,h.isWixContext)()?t.wix_title:e},cid:()=>a.clientId?a.clientId.split(".")[0]:null,utm:()=>{const e=B(B(B(B(B(B({},a.utm.campaign&&{campaign:a.utm.campaign}),a.utm.source&&{source:a.utm.source}),a.utm.medium&&{medium:a.utm.medium}),a.utm.keyword&&{keyword:a.utm.keyword}),a.utm.term&&{keyword:a.utm.term}),a.utm.content&&{content:a.utm.content});return JSON.stringify(e)},status:()=>{let e;const t=!d.default.getCurrentChatAgentMessages().length&&d.default.getCurrentClientMessages().length;e=n.chatStarted?n.chatAccepted?O.ClientStatus.ON_CHAT:n.isOnline?N.default.getInstance().managers.connection.isOpen()&&t?O.ClientStatus.INVITE_SENT:O.ClientStatus.ON_SITE:N.default.getInstance().managers.connection.isOpen()&&t&&n.lastChatOpened?O.ClientStatus.INVITE_SENT:O.ClientStatus.ON_SITE:(0,R.getProactive)().text?O.ClientStatus.PROACTIVE_SHOW:O.ClientStatus.ON_SITE;const a=(0,R.getCallback)().status;return a&&-1!==["cw_wait","cw_connecting","cw_connected"].indexOf(a)&&(e=O.ClientStatus.ON_CALL),e==O.ClientStatus.INVITE_SENT&&N.default.getInstance().managers.connection.isOpen()&&!t&&T.Monitoring.telemetryOnce(C.TelemetryName.VI_STATUS_FAIL,{param1:"no_client_message",param2:n.chatAccepted?"1":"0"}),e},navcount:()=>A.default.get("pages_count"),visits:()=>I.default.get("visits_count"),chats:()=>d.default.getChatCounts(),visible:()=>(0,y.pageVisible)(),opened:()=>{const e=n.route;return!(0,L.isChatClosedRoute)(e)},agentids:()=>{const e=n.chatAccepted;return JSON.stringify(e?(0,R.getAgentIdsByStatus)("join"):[])},botids:()=>{const e=n.chatAccepted;return JSON.stringify(e?(0,R.getBotIdsByStatus)("join"):[])},pa_id:()=>a.priorityAgentId,avatar:()=>a.avatarUrl,wversion:()=>k.EnvironmentManager.getVersion(),cdata:()=>{const e=a.customData;return e?JSON.stringify(e):null}};return e?o[e]&&o[e]():Object.keys(o)}},{key:"getAllCurrentKeys",value:function(){const e={};return(0,g.each)(this.getKeys(),(t=>{e[t]=this.getKeys(t)})),e}},{key:"changeCurrentKeys",value:function(){const e=this.getAllCurrentKeys();this.isConnected&&JSON.stringify(this.cacheCurrentKeys)!==JSON.stringify(e)&&(0,g.each)(this.getKeys(),(t=>{const n=e[t];this.cacheCurrentKeys[t]!==n&&this.set(t,n)}))}},{key:"sendAllKeys",value:function(e,t){(0,g.each)(this.getKeys(),(n=>{this.cacheCurrentKeys[n]||(this.cacheCurrentKeys[n]=this.getKeys(n));const a=this.cacheCurrentKeys[n];a&&this.net.set({room:t,to:e,key:n,value:a})}))}},{key:"sendDynamicKeys",value:function(){(0,g.each)(U,(e=>{this.set(e,this.getKeys(e))}))}},{key:"set",value:function(e,t,n,a){if(this.isConnected&&null!=t){this.cacheCurrentKeys[e]=t;const o={key:e,value:t};a&&(o.room=a),n&&(o.to=n),S.default.getInstance().saveViEvent(o),this.net.set(o)}}},{key:"onget",value:function(e){S.default.getInstance().saveViEvent(e),"*"===e.key||"all"===e.key?(this.sendAllKeys(e.from,e.room),(0,g.each)({startsec:()=>{const e=A.default.get("enter_ts");return e&&(0,w.timeDiff)(e)}},((t,n)=>{t()&&this.set(n,t(),e.from,e.room)}))):this.getKeys(e.key)&&this.set(e.key,this.getKeys(e.key),e.from,e.room)}},{key:"onset",value:function(e){const t=(0,R.getApp)(),n=t.isOnline,a=t.route;if(S.default.getInstance().saveViEvent(e),"invite"===e.key&&!this.isInvited){n||(0,L.isChatClosedRoute)(a)&&(M.transitionDispatchers.startTransition(P.ScriptName.OPEN_WIDGET),M.appDispatchers.setAppRoute(E.Route.CHAT));const t=N.default.getInstance().managers.connection;t.isOpen()?t.send(new x.StartChat(e.value)):t.open((()=>{t.send(new x.StartChat(e.value))}),!0),this.isInvited=!0,setTimeout((()=>{this.isInvited=!1}),l.APP_INVITE_TIME),T.Monitoring.telemetry(C.TelemetryName.VISITORS_INVITE,{param1:parseInt(e.value)}),(0,w.setRuleLocal)("isVisitorInvite")}}}]),e}();var H={run:function(){const e=(0,R.getClient)();F.log("run",e.visitorId),0!=e.visitorId?new W:T.Monitoring.telemetry(C.TelemetryName.VISITORS_FAIL,{param1:"visitorId = 0"})}};t.default=H},63427:function(e,t,n){"use strict";var a=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=a(n(33119)),r=a(n(92664)),i=n(69882),s=n(44145),l=n(26932),u=n(26754),c=a(n(1039)),d=n(95911);const f=a(n(4855)).default.name("StatusProvider");var p=new(function(){function e(){(0,o.default)(this,e),f.log("init")}return(0,r.default)(e,[{key:"getUrl",value:function(){const e=(0,s.getSystemSettings)();return(0,i.getProtocol)()+"//"+e.chatHost+"/widget/status/"+e.siteId+"/"+e.widgetId+"?rnd="+Math.random()}},{key:"getStatus",value:async function(e){await d.promisedRequest.get(this.getUrl()).then((t=>{var n;f.warn("response",t,e);const a=t.data;a.maintenance&&l.appDispatchers.setMaintenance(!0);const o=a.bots&&a.bots.length;if(o){const e=a.bots[0];l.botsDispatchers.addBot({avatarUrl:e.avatar_url||null,id:e.bot_id,name:e.display_name||null,title:e.title||null,type:e.type,isBot:!0})}if(a.agents&&!a.agents.length&&(o&&c.default.enable_bot_offline?l.appDispatchers.setAppIsOnline(!0):l.appDispatchers.setAppIsOnline(!1)),null!==(n=a.agents)&&void 0!==n&&n.length)for(const e of a.agents){const t=(0,u.agentToReduxFormat)(e);l.agentsDispatchers.addAgent(t)}e(!0)})).catch((t=>{f.warn(t),e(!1)}))}}]),e}());t.default=p},95911:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.xhrRequest=t.promisedRequest=void 0;var a=n(46322),o=n(31343),r=n(54415),i=n(80210),s=n(82956);const l=(e,t)=>t&&(0,a.isObject)(t.params)?e+=`?${i.querystring.create(t.params)}`:e,u=e=>((e=Object.assign({},o.REQUEST_OPTIONS,e)).body&&(e.headers["Content-Type"]===o.CONTENT_TYPE.X_WWW_FORM?e.body=(0,a.isObject)(e.body)?i.querystring.create(e.body):JSON.stringify(e.body):e.headers["Content-Type"]===o.CONTENT_TYPE.APP_JSON&&(e.body=JSON.stringify(e.body))),e),c=(e,t,n)=>(a,o)=>{!a||"SyntaxError"!==a.name||null!=t&&t.monitoring||r.Monitoring.reportException(`Error parsing response from ${e}. ${a.message}`),n(a,o)},d=(e,t,n)=>({url:l(e,t),options:u(t),callback:n&&c(e,t,n)}),f=e=>(t,n,a)=>{const o=d(t,a,n);return(0,s.xhr)(o.url,e,o.options,o.callback)},p=e=>(t,n)=>{const a=d(t,n);return(0,s.xhrPromised)(a.url,e,a.options)},h={get:f(o.METHODS.GET),post:f(o.METHODS.POST)};t.xhrRequest=h;const g={get:p(o.METHODS.GET),put:p(o.METHODS.PUT),head:p(o.METHODS.HEAD)};t.promisedRequest=g},63621:function(e,t,n){"use strict";var a=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.replaceLinksWithAnchor=t.isValidUrl=t.isValidIp=t.isValidFile=t.isValidEmail=t.findAllLinks=void 0;var o=a(n(15176)),r=a(n(50754)),i=n(11413);t.replaceLinksWithAnchor=e=>(0,o.default)({input:e,options:{protocol:e=>{if(u(e))return"mailto:"},attributes:e=>({target:"_blank",rel:"noopener",title:e}),truncate:80,middleTruncation:!0,specialTransform:[{test:/^https?/,transform:e=>{const t=e.replace(/https?:\/\//,""),n=t.split("/")[0],a=r.default.toUnicode(n),o=t.replace(n,a),s=(e=>e.length>80?e.slice(0,30)+"..."+e.slice(-30):e)((0,i.escape)(decodeURIComponent(o)));return`${s}`}}]}});const s=o.default.list;t.findAllLinks=s;const l=o.default.validate.url;t.isValidUrl=l;const u=o.default.validate.email;t.isValidEmail=u;const c=o.default.validate.ip;t.isValidIp=c;const d=o.default.validate.file;t.isValidFile=d},98960:function(e){"use strict";e.exports={phone:e=>e.length>0&&e.trim().replace(/\D+/g,"").length>=5&&/^\+?[0-9() -]+$/i.test(e),client_name:e=>{const t=e.trim();return t.length>0&&t.length<100},name:e=>{const t=e.trim();return t.length>0&&t.length<100},email:e=>e.length>=4&&new RegExp(/^([a-zA-Z\d-_]+([+.][a-zA-Z\d-_]+)*)@(([a-zA-Z\d][a-zA-Z\d-_.]*[a-zA-Z\d])|([a-zA-Z\d]))\.([a-zA-Z\d]{2,})$/i).test(e),emailBot:e=>e.length>=4&&new RegExp(/^([a-zA-Z\d\-_+!]+(\.[a-zA-Z\d\-_+!]+)*)@(([a-zA-Z\d-]+\.)+[a-zA-Z\d]{2,})$/i).test(e),message:e=>e.trim().length>0,description:e=>e.trim().length>0}},74379:function(e,t,n){"use strict";var a=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=a(n(33119)),r=a(n(92664)),i=a(n(19955)),s=n(69882),l=n(21951),u=n(43374),c=n(9393),d=n(43025),f=a(n(99881)),p=n(26932),h=n(52274);const g=a(n(4855)).default.name("SiteConnector");var m=new(function(){function e(){(0,o.default)(this,e),this.window=(0,s.getPageWindow)(),this.screen=this.window.screen?this.window.screen:window.screen,this.document=this.window.document,this.bodyEl=this.document.body,this.documentEl=this.document.documentElement,this.scrollEl=this.document.scrollingElement||this.bodyEl,this.pageZoom=null,this.userZoom=null,this.appZoom=null,this.isSiteOptimizedForMobile=!1,this.isWidgetOnWix=!1,this.changeZoomSubscription=[],this.checkZoomsFn=(0,u.throttle)((()=>{this.checkZooms()}),200,{trailing:!0}),!i.default.mobileOrTablet()||(0,s.isWixContext)()&&!i.default.android()||(this.checkViewport(),this.initListenChangeZooms())}return(0,r.default)(e,[{key:"initListenChangeZooms",value:function(){(0,l.addListener)(this.window,"scroll",this.checkZoomsFn,!0),(0,l.addListener)(this.window,"resize",this.checkZoomsFn,!0),(0,l.addListener)(this.window,"orientationchange",this.checkZoomsFn),this.window.visualViewport&&this.window.visualViewport.addEventListener&&((0,l.addListener)(this.window.visualViewport,"scroll",this.checkZoomsFn,!0),(0,l.addListener)(this.window.visualViewport,"resize",this.checkZoomsFn,!0))}},{key:"setZoomChangeIterval",value:function(e){e!==this.intervalTime&&(clearInterval(this.intervalId),this.intervalTime=e,this.intervalId=setInterval(this.checkZoomsFn,e))}},{key:"checkZooms",value:function(){const e=this.getUserZoom(),t=this.getPageZoom(),n=this.getAppZoom();e===this.userZoom&&t===this.pageZoom&&n===this.appZoom||(g.log("zoom:",e,t,n),this.userZoom=e,this.pageZoom=t,this.appZoom=n,p.zoomDispatchers.initializeZoomStore({user:this.userZoom,page:this.pageZoom,app:this.appZoom}),this.triggerChangeZoom())}},{key:"checkViewport",value:function(){const e=this.document.querySelector("meta[name=viewport]");if(e&&e.content){const t=e.getAttribute("content").toLowerCase().split(","),n=e.getAttribute("id");for(let e=0;e{e({userZoom:this.userZoom,pageZoom:this.pageZoom,appZoom:this.appZoom})}))}},{key:"blockScroll",value:function(){(0,d.addClass)(this.bodyEl,"jivo-block-scroll"),(0,l.addListener)(this.window,"scroll",this.preventDefault),(0,l.addListener)(this.document,"touchmove",this.preventDefault),this.window.visualViewport&&this.window.visualViewport.addEventListener&&(this.window.visualViewport.addEventListener("scroll",this.preventDefault),this.window.visualViewport.addEventListener("resize",this.preventDefault))}},{key:"unblockScroll",value:function(){(0,d.removeClass)(this.bodyEl,"jivo-block-scroll"),(0,l.removeEvent)(this.window,"scroll",this.preventDefault),(0,l.removeEvent)(this.document,"touchmove",this.preventDefault),this.window.visualViewport&&this.window.visualViewport.removeEventListener&&(this.window.visualViewport.removeEventListener("scroll",this.preventDefault),this.window.visualViewport.removeEventListener("resize",this.preventDefault))}},{key:"addOverlay",value:function(){(0,d.addClass)(this.documentEl,"jivo-mobile-overlay")}},{key:"removeOverlay",value:function(){(0,d.removeClass)(this.documentEl,"jivo-mobile-overlay")}},{key:"blockSite",value:function(){void 0===this.blockState&&(this.resetScrollPositions(),(0,d.addClass)(this.documentEl,"jivo-site-full-block"),i.default.tablet()&&setTimeout((()=>{(0,d.addClass)(this.documentEl,"jivo-tablet-overlay")}),300),this.blockState=!0)}},{key:"unblockSite",value:function(){(0,d.removeClass)(this.documentEl,"jivo-site-full-block"),(0,d.removeClass)(this.documentEl,"jivo-tablet-overlay"),this.restoreScrollPositions(),delete this.blockState}},{key:"resetScrollPositions",value:function(){this.scrollEl&&(this.originalScrollTop=this.scrollEl.scrollTop,this.originalScrollLeft=this.scrollEl.scrollLeft,this.scrollEl.scrollTop=0,this.scrollEl.scrollLeft=0)}},{key:"restoreScrollPositions",value:function(){(this.originalScrollTop||this.originalScrollleft)&&this.scrollEl&&(this.scrollEl.scrollTop=this.originalScrollTop,this.scrollEl.scrollLeft=this.originalScrollLeft,delete this.originalScrollTop,delete this.originalScrollLeft)}},{key:"preventDefault",value:function(e){return e.preventDefault(),e.stopPropagation(),!1}},{key:"getUserZoom",value:function(){let e=this.documentEl.clientWidth/this.window.innerWidth;const t=this.window.visualViewport;if(t&&1!==t.scale){const n=this.getPseudo().clientWidth;e=this.documentEl.clientWidth=.97&&e<=h.MAX_ALLOWED_USER_ZOOM&&(e=1),e}},{key:"getPageZoom",value:function(){return this.screen?this.window.visualViewport?"landscape"===this.getOrientation()?this.screen.height/this.window.visualViewport.width:this.screen.width/this.window.visualViewport.width:"landscape"===this.getOrientation()?this.screen.height/this.window.innerWidth:this.screen.width/this.window.innerWidth:1}},{key:"getAppZoom",value:function(){return this.screen?this.window.visualViewport?"landscape"===this.getOrientation()&&i.default.ios()?this.window.visualViewport.width/this.screen.height:this.window.visualViewport.width/this.screen.width:"landscape"===this.getOrientation()?this.window.innerWidth/this.screen.height:this.window.innerWidth/this.screen.width:1}},{key:"getTextSize",value:function(){if(i.default.ios()&&(0,s.isWixContext)())return"normal";let e=null;if(!i.default.ios())return e;const t=this.getAppZoom();return 1!==t&&(e=100*t+"%"),e||"none"}},{key:"getLineHeight",value:function(e){let t=null;const n=this.getAppZoom();return 1!==n&&(t=(e||1.25)/n+"em"),t}},{key:"getOrientation",value:function(){let e,t=0;switch("number"==typeof this.window.orientation?t=this.window.orientation:this.window.screen&&this.window.screen.orientation&&(t=this.window.screen.orientation.angle),t){case-90:case 90:e="landscape";break;default:e="portrait"}return e}},{key:"getBodyOffset",value:function(){const e=this.getBodyPosition(),t=this.bodyEl.getBoundingClientRect(),n=this.documentEl.getBoundingClientRect();return{top:"static"===e?0:t.top-n.top,left:"static"===e?0:t.left-n.left}}},{key:"getBodyPosition",value:function(){return this.window.getComputedStyle(this.bodyEl).position}},{key:"getPseudo",value:function(){if(this.documentEl.querySelector){const e=this.documentEl.querySelector("."+f.default.pseudoHeight);return e||0}return 0}},{key:"listenChangeZoom",value:function(e){this.changeZoomSubscription.push(e)}}]),e}());t.default=m},14762:function(e,t,n){"use strict";var a=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=a(n(33119)),r=a(n(92664)),i=a(n(44775)),s=a(n(84827)),l=a(n(85299)),u=a(n(55536)),c=a(n(34973)),d=n(9393),f=n(42687);function p(e){var t=function(){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}}();return function(){var n,a=(0,u.default)(e);if(t){var o=(0,u.default)(this).constructor;n=Reflect.construct(a,arguments,o)}else n=a.apply(this,arguments);return(0,l.default)(this,n)}}a(n(4855)).default.name("AgentsStore");let h=function(e){(0,s.default)(n,e);var t=p(n);function n(){return(0,o.default)(this,n),t.apply(this,arguments)}return(0,r.default)(n,[{key:"getAgentById",value:function(e){return e?this.store.find((t=>t.get("agent_id")===parseInt(e))):null}},{key:"getBotById",value:function(e){return e?this.store.find((t=>t.get("bot_id")===parseInt(e))):null}},{key:"getAgentsByStatus",value:function(e){return e?this.store.filter((t=>t.get("body.state")===e)):null}},{key:"getAgentIdsByStatus",value:function(e){return e?this.store.reduce(((t,n)=>(n.get("body.state")===e&&t.push(n.get("agent_id")||n.get("bot_id")),t)),[]):null}},{key:"getOnlyAgentIdsByStatus",value:function(e){return e?this.store.reduce(((t,n)=>(n.get("body.state")===e&&n.get("agent_id")&&t.push(n.get("agent_id")),t)),[]):null}},{key:"getBotIdsByStatus",value:function(e){return e?this.store.reduce(((t,n)=>(n.get("body.state")===e&&n.get("bot_id")&&t.push(n.get("bot_id")),t)),[]):null}},{key:"closeChat",value:function(){(0,d.each)(this.store,(e=>{e.set("body.state","left")}))}},{key:"updateAgentList",value:function(e){e&&e.length&&(1==e.length&&this.closeChat(),(0,d.each)(e,(e=>{let t;t=e.bot_id?this.getBotById(e.bot_id):this.getAgentById(e.agent_id),e.body={state:"join"},e=(0,f.omit)(e,["state","vox_name"]),t?t.set(e):(0,i.default)((0,u.default)(n.prototype),"push",this).call(this,e)})))}},{key:"toReduxFormat",value:function(){const e=[];return(0,d.each)(this.store,(t=>{var n;const a=t.toJSON(),o={avatarUrl:a.avatar_url||null,id:a.agent_id||a.bot_id,name:a.display_name||null,title:a.title||null,isBot:!!a.bot_id,state:(null==a||null===(n=a.body)||void 0===n?void 0:n.state)||null,type:a.type||null};e.push(o)})),e}}]),n}(c.default);var g=new h({type:"default",name:"agents",keys:{type:null,agent_id:null,bot_id:null,display_name:null,title:null,avatar_url:null,body:{state:"join"}}});t.default=g},16818:function(e,t,n){"use strict";var a=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=a(n(33119)),r=a(n(92664)),i=n(44733),s=a(n(56026)),l=n(45950);a(n(4855)).default.name("HistoryStore");var u=new(function(){function e(){(0,o.default)(this,e),this.LS=i.StorageProvider}return(0,r.default)(e,[{key:"push",value:function(e){let t=this.get()||[];e=this.format(e);this.getHistoryByUrl(t,e.url).length?t=this.updateHistoryByUrl(t,e.url):(10===t.length&&(t=this.deleteOldestEntry(t)),e.time=(new Date).getTime(),t.push(e)),this.LS.set("history",t)}},{key:"get",value:function(){return this.LS.get("history")||[]}},{key:"destroy",value:function(){this.LS.remove("history")}},{key:"format",value:function(e){return e.url=this.subStr((new s.default).decode(e.url)),e.title=this.subStr(e.title),e}},{key:"subStr",value:function(e){return e.length>150?e.substr(0,150)+"...":e}},{key:"getHistoryByUrl",value:function(e,t){return e.filter((e=>e.url===t))}},{key:"updateHistoryByUrl",value:function(e,t){for(let n=0;ne.get("created_ts")))}},{key:"formatMessage",value:function(e){var t=h.pick.apply(void 0,[e].concat(["private_id","msg_id","chat_id","created_ts","updated_ts","from","from_id","text","type","status","body"]));const n=e.meta||e.body;if(void 0!==n&&"tinkoffInvoice"===n.type&&"SUCCESS"===n.status){const e=this.store.filter((function(e){return(e.get("body")?e.get("body").invoice_id:e.invoice_id)===n.invoice_id}));if(e.length){const t=e[0].get("body");t&&(t.status="SUCCESS",e[0].set("body",t))}}return e.type==v.MessageType.MESSAGE&&e.media&&(t.type=v.MessageType.MEDIA,t.body=e.media),t}},{key:"getLastMessage",value:function(){return this.store[this.store.length-1]||null}},{key:"getFirstMessage",value:function(){return this.store.length?this.store[0]:null}},{key:"getClientMessages",value:function(){return this.store.filter((e=>e.get("from")===v.MessageInitiator.CLIENT))}},{key:"getAgentMessages",value:function(){return this.store.filter((e=>e.get("from")===v.MessageInitiator.AGENT))}},{key:"getAgentTextMessages",value:function(){const e=this.getChatId();return e?this.store.filter((t=>t.get("chat_id")===e&&t.get("from")===v.MessageInitiator.AGENT&&t.get("type")===v.MessageType.MESSAGE)):[]}},{key:"getMessagesByType",value:function(e){return this.store.filter((t=>t.get("type")===e))}},{key:"getMessageById",value:function(e){return e?this.store.find((t=>t.get("msg_id")===e)):null}},{key:"getMessageByPrivateId",value:function(e){return e?this.store.find((t=>t.get("private_id")===e)):null}},{key:"closeChat",value:function(){const e=this.getLastMessage(),t=this.getLastProactive();t&&t.set("chat_id",e.get("chat_id"))}},{key:"getCurrentProactive",value:function(){const e=this.getLastProactive();let t=null;return(0,d.getApp)().chatStarted&&e&&!e.get("chat_id")&&(t=e),b.log("getCurrentProactive",t),t}},{key:"getLastProactive",value:function(){const e=this.store.filter((e=>e.get("type")===v.MessageType.PROACTIVE));return b.log("getLastProactive",e),e.length?e[e.length-1]:null}},{key:"getTmpProactive",value:function(){const e=this.store.filter((e=>e.get("type")===v.MessageType.PROACTIVE&&e.get("body")&&e.get("body").unsave));return b.log("getTmpProactive",e),e.length?e[e.length-1]:null}},{key:"getUnreadMessage",value:function(){return this.store.filter((e=>{const t=e.toJSON();return t.from===v.MessageInitiator.AGENT&&t.status!==v.MessageStatus.READ&&t.status!==v.MessageStatus.DELETED&&t.type!==v.MessageType.FOR_TEST}))}},{key:"getOfflineUnreadProactive",value:function(){return this.store.filter((e=>{const t=e.toJSON();return t.from===v.MessageInitiator.AGENT&&t.status!==v.MessageStatus.READ&&t.type===v.MessageType.FOR_TEST}))}},{key:"destroyDeletedMessages",value:function(){const e=this.getDeletedMessages();(0,p.each)(e,(e=>{e.destroy()}))}},{key:"getDeletedMessages",value:function(){return this.store.filter((e=>e.get("status")==v.MessageStatus.DELETED))}},{key:"destroyErrorMediaMessages",value:function(){const e=this.getMediaErrors();(0,p.each)(e,(e=>{e.destroy()}))}},{key:"getMediaErrors",value:function(){return this.store.filter((e=>{if(!e)return!1;const t=e.toJSON();return t.type==v.MessageType.MEDIA&&t.body&&t.body.status&&t.body.status!==v.MediaStatus.COMPLETE&&t.body.status!==v.MediaStatus.EXPIRED}))}},{key:"getChatCounts",value:function(){let e,t=0;return(0,p.each)(this.store,(n=>{const a=n.get("chat_id");null!==a&&a!==e&&(e=a,t+=1)})),t}},{key:"getAllChatIds",value:function(){const e=[];return(0,p.each)(this.store,(t=>{t.get("chat_id")&&e.push(t.get("chat_id"))})),(0,o.default)(new Set(e))}},{key:"getChatId",value:function(){const e=this.getAgentMessages(),t=this.filter((e=>e.get("chat_id")&&e.get("from")===v.MessageInitiator.CLIENT));let n=e.length?e[e.length-1].get("chat_id"):null;const a=t.length?t[t.length-1].get("chat_id"):null;return a>n&&(n=a),n}},{key:"getChatMessages",value:function(e){return this.store.filter((t=>t.get("chat_id")===e&&t.get("type")!==v.MessageType.SYSTEM&&"bot"!==t.get("from")))}},{key:"getChatMessagesAfterId",value:function(e,t){return this.store.filter((n=>n.get("chat_id")===e&&n.get("type")!==v.MessageType.SYSTEM&&"bot"!==n.get("from")&&n.get("msg_id")>t))}},{key:"getCurrentChatMessages",value:function(){const e=this.getChatId();return e?this.getChatMessages(e):[]}},{key:"getAgentChatMessages",value:function(e){return this.store.filter((t=>t.get("chat_id")===e&&[v.MessageInitiator.AGENT,v.MessageInitiator.FORM].includes(t.get("from"))&&t.get("type")!==v.MessageType.PROACTIVE))}},{key:"getCurrentChatAgentMessages",value:function(){const e=this.getChatId();return this.getAgentChatMessages(e)}},{key:"getCurrentClientMessages",value:function(){return this.getChatMessages(this.getChatId()).filter((e=>e.get("from")===v.MessageInitiator.CLIENT))}},{key:"find",value:function(e){return this.store.find((t=>e(t)))}},{key:"filter",value:function(e){return this.store.filter((t=>e(t)))}},{key:"getUndelivered",value:function(){return this.store.filter((e=>e.get("status")===v.MessageStatus.NOT_DELIVERED))}},{key:"setUndeliveredForInit",value:function(){return(0,p.each)(this.store,(e=>{e.get("from")===v.MessageInitiator.CLIENT&&e.get("status")===v.MessageStatus.SENT&&e.set("status",v.MessageStatus.NOT_DELIVERED)}))}},{key:"setTempMessagesForInit",value:function(){return(0,p.each)(this.store,(e=>{if(e&&e.get("from")===v.MessageInitiator.CLIENT&&e.get("status")===v.MessageStatus.SENT&&e.get("type")===v.MessageType.TEMPORARY){((new Date).getTime()-e.get("created_ts"))/1e3>604800?(e.set("status",v.MessageStatus.NOT_DELIVERED),e.set("type",v.MessageType.MESSAGE)):e.destroy()}}))}},{key:"getSentMessages",value:function(){return this.store.filter((e=>e.get("from")===v.MessageInitiator.CLIENT&&e.get("status")===v.MessageStatus.SENT&&!e.get("msg_id")&&e.get("type")!==v.MessageType.TEMPORARY))}},{key:"getFormMessage",value:function(){return this.store.filter((e=>e.get("type")===v.MessageType.FORM))}},{key:"getFormIntroduceText",value:function(){return this.store.filter((e=>e.get("type")===v.MessageType.PREFORM&&e.get("from")===v.MessageInitiator.FORM))}},{key:"getBotMessages",value:function(e){return this.store.filter((t=>t.get("chat_id")===e&&t.get("type")===v.MessageType.MESSAGE&&"bot"===t.get("from")))}},{key:"getTemporaryMessageWithText",value:function(e){const t=this.store.filter((t=>t.get("type")===v.MessageType.TEMPORARY&&t.get("text")===e));return t.length?t[t.length-1]:null}},{key:"getTemporaryMessages",value:function(){return this.store.filter((e=>e.get("type")===v.MessageType.TEMPORARY&&e.get("from")===v.MessageInitiator.CLIENT))||null}},{key:"getOfflineTmpMessage",value:function(){const e=this.store.filter((e=>e.get("type")===v.MessageType.TEMPORARY&&e.get("from")===v.MessageInitiator.CLIENT));return e.length?e[e.length-1]:null}},{key:"getLastUnreadApiInvitation",value:function(){const e=this.store.filter((e=>e.get("type")===v.MessageType.MESSAGE&&e.get("body")&&e.get("body").customerIO));return e.length?e[e.length-1]:null}},{key:"getUnreadApiInvitations",value:function(){return this.store.filter((e=>e.get("type")===v.MessageType.MESSAGE&&e.get("body")&&e.get("body").customerIO&&e.get("body").unsave))}},{key:"getSystemMessageByText",value:function(e){return this.store.filter((t=>t.get("type")===v.MessageType.SYSTEM&&t.get("text")===e))}},{key:"hasMessages",value:function(){return this.store.length>0}},{key:"getCobrowseByHash",value:function(e){if(e)return this.store.find((t=>{const n=t.toJSON();return n.type===v.MessageType.COBROWSE&&n.body&&n.body.type===v.MessageType.COBROWSE&&n.body.address===e}))}}]),n}(m.default))({type:"default",name:"messages",itemClass:_.default,keys:{private_id:function(){return(0,f.generateGUID)()},msg_id:null,chat_id:null,created_ts:function(){return(new Date).getTime()},updated_ts:null,from:v.MessageInitiator.EMPTY,from_id:null,text:null,type:v.MessageType.EMPTY,status:v.MessageStatus.SENT,body:{}}});t.default=E},23116:function(e,t,n){"use strict";var a=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(62096),r=a(n(4855)),i=a(n(19955)),s=n(21951),l=n(43374),u=n(43025),c=n(91225),d=n(35233);const f=n(89766).EventEmitter;let p=(new Date).getTime();const h=r.default.name("TabActiveManager"),g=Object.assign(new f,{isActive:null});let m;const _=(0,l.throttle)((()=>{p=(new Date).getTime(),(0,c.isChatRoute)(m)&&(0,u.pageVisible)()&&!0!==g.isActive&&(h.log("setActive"),g.isActive=!0,g.emit("update"))}),500),v=()=>{h.log("setNotActive"),g.isActive=!1,g.emit("update")};setInterval((()=>{!1!==g.isActive&&(new Date).getTime()-p>3e4&&v()}),15e3),i.default.desktop()?((0,s.addListener)(window.parent,"scroll",_,!0),(0,s.addListener)(window.parent,"mousemove",_,!0)):((0,s.addListener)(window.parent,"touchmove",_,!0),(0,s.addListener)(window.parent,"touchend",_,!0)),(0,s.listenVisibility)((()=>{(0,u.pageVisible)()?_():v()})),o.reduxStore.subscribe((()=>{const e=m;m=(0,d.selectRoute)(o.reduxStore.getState()),e!==m&&((0,c.isChatRoute)(m)?_():v())}));var y=g;t.default=y},31802:function(e,t,n){"use strict";var a=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.closeWidget=function(e){if(l.appDispatchers.setAppIsFocused(!1),r.default.mobileOrTablet())(0,i.blurActiveElement)(),e||(0,u._callUserFunction)("onClose");else if((0,c.isMinRoute)((0,s.getApp)().route))parent.document.getElementById("jivo_custom_widget")||(0,u._callUserFunction)("onClose");else{const e=(0,s.getProactive)();e.name&&((0,d.rejectProactive)(),l.proactiveDispatchers.setName(null)),(0,u._callUserFunction)("onClose")}o.default.set("close_time",(new Date).getTime()),l.appDispatchers.setChatOpenByClient(!1)};var o=a(n(66547)),r=a(n(19955)),i=n(43025),s=n(44145),l=n(26932),u=n(43914),c=n(91225),d=n(62162)},11281:function(e,t,n){"use strict";var a=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=a(n(15687)),r=a(n(61125)),i=n(16016),s=a(n(26754)),l=a(n(14264)),u=a(n(14762)),c=a(n(16818)),d=n(68403),f=a(n(84726)),p=a(n(91275)),h=a(n(138)),g=a(n(19955)),m=a(n(71277)),_=n(96879),v=n(33069),y=n(21476),b=n(47060),E=n(81152),T=n(65465),C=n(54415),O=n(83170),S=n(43914),w=n(55329),A=n(26932),I=n(94564),M=a(n(4855)),P=n(47138),R=a(n(22541)),k=a(n(73687)),N=n(49594),D=a(n(35802)),x=a(n(1039)),L=n(28302),j=n(44145),B=n(23336),F=n(94537),U=n(97939),W=n(41168),H=n(64123),G=n(80161),z=n(13077),V=n(34445),q=n(48999),$=n(15787),K=n(62162),Y=n(54346);function X(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function Z(e){for(var t=1;t{const n=e.agent_info.bot_id,a=(0,j.getApp)(),o=(0,j.getClient)(),r=(0,j.getChats)(),i=r[r.length?r.length-1:0],c=(0,j.getUserSettings)();if(A.appDispatchers.setChatStarted(!0),A.appDispatchers.setChatAccepted(!0),A.appDispatchers.setLastChatOpened(!0),A.chatsDispatchers.setChatEvaluated(!1),!a.isOnline){if(n||t.default.setOnline(),T.messageActions.deleteUnansweredOfflineSystemInvite(),G.RouterUtils.canShowIntroduceForm()){const e=l.default.getOfflineTmpMessage();e&&e.destroy(),y.Router.next(b.RouterEvent.ToIntroduce)}C.Monitoring.telemetry(O.TelemetryName.NEWOFFLINE_AGENT_ACCEPT)}n?(s.default.agent_id=0,s.default.type=e.agent_info.type||null):(s.default.bot_id&&t.default.setOnline(),s.default.bot_id=0),A.chatsDispatchers.setNoJoinedAgents(),s.default.agent_id=e.agent_info.agent_id||null,s.default.bot_id=e.agent_info.bot_id||null,s.default.display_name=e.agent_info.display_name||null,s.default.title=e.agent_info.title||null,s.default.avatar_url=e.agent_info.avatar_url||null,s.default.typing=e.agent_info.typing||null,s.default.state="join";const d=s.default.toReduxFormat();n?(A.botsDispatchers.addBot(d),A.chatsDispatchers.setJoinedBots([s.default.bot_id]),u.default.updateAgentList([e.agent_info])):(A.agentsDispatchers.addAgent(d),A.chatsDispatchers.setJoinedAgents([e.agent_info]),A.chatsDispatchers.setJoinedBots([]),A.appDispatchers.setIsInputDisabled(!1)),n||(!o.isIntroduced&&a.isOnline&&T.messageActions.checkContactsForm(),A.clientDispatchers.setPaId(s.default.agent_id)),h.default.trackChatConnected(),(0,S._callUserFunction)("onAccept"),(0,K.saveLastProactive)(),(0,$.openChatOnMessage)();const f=n?E.MessageType.BOT:E.MessageInitiator.AGENT;c.contactsAsk===F.ContactsType.BEFORE_CHAT&&C.Monitoring.telemetry(O.TelemetryName.CHAT_ACCEPTED_CONTACTS,{param1:f,param2:JSON.stringify({chat_id:i.id,department_id:o.departmentId,display_name:Boolean(o.displayName),name:Boolean(o.name),email:Boolean(o.email),is_introduced:o.isIntroduced,phone:Boolean(o.phone)})}),n?C.Monitoring.telemetry(O.TelemetryName.CHAT_BOT_ACCEPTED,{param1:(0,Y.isAssistantBot)()?U.BotType.ASSISTANT:U.BotType.DEFAULT}):C.Monitoring.telemetry(O.TelemetryName.CHAT_ACCEPTED,Z({param1:f},h.default.getCountersTelemetry()))},transferred:e=>{(0,j.getApp)().isOnline||t.default.setOnline(),Object.assign(s.default,e.agent_info);const n=e.agent_info.bot_id,a=s.default.toReduxFormat();n?(A.botsDispatchers.addBot(a),A.chatsDispatchers.setJoinedBots([n])):(A.agentsDispatchers.addAgent(a),A.chatsDispatchers.setJoinedAgents([e.agent_info]),A.chatsDispatchers.setJoinedBots([])),A.messagesDispatchers.addMessage({text:(0,f.default)("lblTransferred").replace("_AGENT_",e.agent_info.display_name),type:E.MessageType.SYSTEM,from:E.MessageType.SYSTEM}),A.clientDispatchers.setPaId(s.default.agent_id)},startup_ok:e=>{const t=(0,j.getApp)(),n=(0,j.getClient)();J.log("startup_ok",e),p.default.reloadStories(),u.default.closeChat(),A.appDispatchers.setMaintenance(!1),A.appDispatchers.setLastChatStatus(V.ChatStatus.STARTUP_OK),A.callbackDispatchers.setCallbackStatus(!1),t.route===b.Route.CHAT_MIN&&y.Router.setNext(b.Route.LABEL),A.clientDispatchers.setClientId(e.jv_client_id),A.clientDispatchers.setClientSessionId(e.jv_sess_id),(0,$.setStartupClientInfo)(e.client_info),T.messageActions.deleteMaintenanceMessage(),(0,N.updateHistory)(e),(n.isIntroduced&&!t.isOnline||t.isOnline)&&D.default.getInstance().managers.connection.flushBuffer(),(0,q.sendTagsIfNeed)(),C.Monitoring.telemetry(O.TelemetryName.STARTUP_OK,{param1:(0,H.getStarupTime)(),param2:(0,j.getSystemSettings)().chatHost})},startup_error:e=>{switch(A.appDispatchers.setLastChatStatus(V.ChatStatus.STARTUP_ERROR),e.err_code){case"deleted":A.clientDispatchers.resetClient(),A.appDispatchers.setLastChatStatus(null),l.default.destroy();break;case"blacklisted":A.appDispatchers.setChatStarted(!1),A.appDispatchers.setChatAccepted(!1),k.default.set("is_blacklisted",!0,86400),y.Router.next(b.RouterEvent.Hide),m.default.disableSoundPlayer();break;case"moved":J.log("startup_error, Site is moved"),I.ConfigUtils.reloadConfig((e=>{J.log("Site is moved",e);const t=D.default.getInstance();if(t){const e=t.managers.connection;e.isOpen()||setTimeout((()=>{e.open()}),5e3)}}));break;case"maintenance":(0,H.enableMaintenance)()}C.Monitoring.telemetry(O.TelemetryName.STARTUP_ERROR,{param1:(0,H.getStarupTime)(),param2:e.err_code||"no_err_code",param3:(0,j.getSystemSettings)().chatHost}),(0,z.setRuleLocal)("isVisitorInvite",!1)},resume_ok:e=>{J.log("resume_ok",e);const n=(0,j.getApp)(),a=(0,j.getClient)(),o=(0,j.getCallback)();if(A.clientDispatchers.setClientId(e.jv_client_id),A.appDispatchers.setMaintenance(!1),A.appDispatchers.setLastChatStatus(V.ChatStatus.RESUME_OK),p.default.reloadStories(),c.default.destroy(),(a.isIntroduced&&!n.isOnline||n.isOnline)&&(G.RouterUtils.canShowIntroduceForm()||D.default.getInstance().managers.connection.flushBuffer()),e.agents&&e.agents.length>0){let n=!1;e.agents.forEach((e=>{e.bot_id&&(n=e)})),n?(A.botsDispatchers.addBot({avatarUrl:n.avatar_url||null,id:n.bot_id,name:n.display_name||null,title:n.title||null,type:n.type,isBot:!0}),A.chatsDispatchers.setJoinedBots([n.bot_id])):A.chatsDispatchers.setJoinedAgents(e.agents),t.default.updateAgentInfo(e.agents),u.default.getAgentsByStatus("join").length&&(A.appDispatchers.setChatAccepted(!0),A.appDispatchers.setAppIsOnline(!0),A.appDispatchers.setLastChatOpened(!0))}else A.chatsDispatchers.setNoJoinedAgents(),A.appDispatchers.setLastChatOpened(!1),A.appDispatchers.setChatAccepted(!1);const r=n.route;g.default.mobileOrTablet()||n.chatStarted||l.default.getCurrentChatMessages().length||!n.isOnline||r===b.Route.CALL||r===b.Route.CHAT_CALL||r===b.Route.LABEL||(0,j.getProactive)().text||y.Router.next(b.RouterEvent.CloseWindow);const i=e.client_info.cw_call;(0,H.setCallbackStatus)(i),i===P.CallStatus.WAIT&&p.default.startCallTimeout(),i&&(Object.assign(o,i),r===b.Route.CHAT_CALL||g.default.mobileOrTablet()||y.Router.next(b.RouterEvent.ToCall),i.status!=P.CallStatus.CONNECTED&&i.status!=P.CallStatus.CONNECTING||(0,v.resetDelayedCallStatus)()),e.client_info.has_integration&&A.clientDispatchers.setHasIntegration(e.client_info.has_integration),e.assigned_agent_id&&A.clientDispatchers.setAssignedAgentId(e.assigned_agent_id),p.default.checkChatStarted(e.chat_started),(0,$.setStartupClientInfo)(e.client_info),T.messageActions.checkContactsForm(),T.messageActions.deleteMaintenanceMessage(),(0,N.updateHistory)(e),C.Monitoring.telemetry(O.TelemetryName.RESUME_OK,{param1:(0,H.getStarupTime)(),param2:e.chat_started,param3:e.agents?e.agents.length:null,param4:e.last_msg_id})},cw_wait:()=>{},cw_call_end:()=>{const e=(0,j.getCallback)();if(J.warn("cw_call_end",e),e.webRTCCallStatus){const e=(0,L.getActiveMessage)(P.WebRTCCallStatus.ACCEPTED);e&&A.messagesDispatchers.updateWebRTCCallStatus(e.private_id,P.WebRTCCallStatus.ENDED),A.callbackDispatchers.setActiveWebRTCCallMessageId(null),A.callbackDispatchers.setWebRTCCallStatus(null),A.callbackDispatchers.setCallbackStatus(P.CallStatus.ENDED),(0,S._callUserFunction)("onCallEnd",{result:"ok"}),C.Monitoring.telemetry(O.TelemetryName.CALL_END,{param1:"webrtc"})}else p.default.clearCallTimeout(),T.messageActions.systemCallMessage((0,f.default)("c_callDisconnected"),E.MessageName.CALL_END),A.callbackDispatchers.setCallbackStatus(P.CallStatus.ENDED),A.callbackDispatchers.setCallbackAvailable(!0),(0,S._callUserFunction)("onCallEnd",{result:"ok"}),C.Monitoring.telemetry(O.TelemetryName.CALL_END)},cw_connecting:()=>{(0,j.getCallback)().webRTCCallStatus?A.callbackDispatchers.setWebRTCCallStatus(P.CallStatus.CONNECTING):A.callbackDispatchers.setCallbackStatus(P.CallStatus.CONNECTING),(0,v.resetDelayedCallStatus)()},cw_connected:()=>{const e=(0,j.getCallback)();if(J.warn("cw_connected",e.webRTCCallStatus,e.activeWebRTCCallMessageId),!e.activeWebRTCCallMessageId){const e=(0,L.getActiveMessage)(P.WebRTCCallStatus.INITIAL);e&&A.messagesDispatchers.updateWebRTCCallStatus(e.private_id,P.WebRTCCallStatus.ACCEPTED)}e.webRTCCallStatus?(A.callbackDispatchers.setWebRTCCallStatus(P.CallStatus.CONNECTED),A.messagesDispatchers.updateWebRTCCallStatus(e.activeWebRTCCallMessageId,P.WebRTCCallStatus.ACCEPTED)):(A.callbackDispatchers.setCallbackStatus(P.CallStatus.CONNECTED),A.callbackDispatchers.setCallbackAvailable(!1)),(0,v.resetDelayedCallStatus)()},cw_error:e=>{const t=(0,f.default)(`cw_reason_${e.reason}`);let n=t;n&&n!=t||(n=(0,W.getCallDefaultError)());const a=(0,j.getCallback)();if(a.webRTCCallStatus){if(a.webRTCCallStatus!==P.CallStatus.ENDED){A.callbackDispatchers.setWebRTCCallStatus(P.CallStatus.ERROR);let e=a.activeWebRTCCallMessageId;if(!e){const t=(0,L.getActiveMessage)(P.WebRTCCallStatus.INITIAL);e=t&&t.private_id}A.messagesDispatchers.updateWebRTCCallStatus(e,P.WebRTCCallStatus.ERROR)}A.callbackDispatchers.setCallbackAvailable(!0),A.callbackDispatchers.setCallbackStatus(P.CallStatus.ERROR),A.callbackDispatchers.setActiveWebRTCCallMessageId(null),A.callbackDispatchers.setWebRTCCallStatus(null),y.Router.getCurrentRoute()===b.Route.CHAT_SETUP_CALL&&y.Router.next(b.RouterEvent.Cancel)}else p.default.clearCallTimeout(),A.messagesDispatchers.addMessage({text:n,type:E.MessageType.SYSTEM,from:E.MessageInitiator.SYSTEM,body:{type:E.MessageType.CALL,name:E.MessageName.CALL_END}}),A.callbackDispatchers.setCallbackAvailable(!0),A.callbackDispatchers.setCallbackStatus(P.CallStatus.ERROR),A.callbackDispatchers.setCallbackError(n),g.default.mobileOrTablet()||y.Router.next(b.RouterEvent.ToCall);(0,S._callUserFunction)("onCallEnd",{result:"fail",reason:n}),C.Monitoring.telemetry(O.TelemetryName.CALL_ERROR,{param1:e.reason})},cw_call_requested:async e=>{if(!x.default.enable_webrtc_calls)return;const t=e.call_id,a=e.vox_user_login,o=e.vox_user_password;A.callbackDispatchers.setCallbackAvailable(!1),A.callbackDispatchers.setWebRTCCallStatus(P.CallStatus.WAIT);const r=(await n.e(772).then(n.bind(n,51961))).default;D.default.getInstance().managers.webRTCCall=new r(D.default.getInstance(),t,a,o),x.default.enable_webrtc_separate_window||D.default.getInstance().managers.webRTCCall.setupSdk(),(0,$.addWebCallMessage)()},agentMessage:(e,n)=>{var a;J.log("agentMessage",e),(0,j.getApp)().isOnline||t.default.setOnline(),T.messageActions.saveLastSystemMessage(),e.media&&(e.media.status=E.MediaStatus.COMPLETE);const o={text:e.message||e.text,type:e.media?E.MessageType.MEDIA:E.MessageType.MESSAGE,from:e.from,from_id:e.from_id,private_id:e.private_id||(0,i.generateGUID)(),msg_id:e.msg_id,chat_id:e.chat_id,meta:e.meta,body:e.media||{}};var r;n&&(0,Y.isAssistantBot)()&&(o.body.bot_message_type=null===(r=e.body)||void 0===r?void 0:r.type);const s=e.type==E.MessageType.LISTPICKER;if(n){var l;if(s)o.text=(e.body.text||e.body.title).trim(),null!==(l=e.body)&&void 0!==l&&l.is_markdown&&(o.body.is_markdown=!0);if(e.is_markdown&&(o.body.is_markdown=!0),e.type==E.MessageType.INVITE){if((0,Y.isAssistantBot)())return;if(o.type=E.MessageType.SYSTEM,o.text=(0,f.default)("botTransferChat"),C.Monitoring.telemetry(O.TelemetryName.BOT_TRANSFER_CHAT),(0,$.isNeedShowBotForm)(x.default))return void T.messageActions.handleBotContactsForm()}else C.Monitoring.telemetry(O.TelemetryName.CLIENT_MESSAGE_BOT)}A.messagesDispatchers.addMessage(o),s&&(o.type=E.MessageType.LISTPICKER,o.body=e.body,o.msg_id=e.msg_id+.1,o.body&&o.body.force_reply&&A.appDispatchers.setIsInputDisabled(!0),A.messagesDispatchers.addMessage(o)),(0,$.agentMessageAck)([e.msg_id],e.chat_id),A.clientDispatchers.updateClient({lastMessage:null}),p.default.agentTyping(0),A.appDispatchers.setLastMsgTime((new Date).getTime()),(0,$.openChatOnMessage)(),(0,$.sendAgentMessageTelemetry)((0,Y.isAssistantBot)()?null===(a=o.body)||void 0===a?void 0:a.bot_message_type:null)},update_agent_info:e=>{(0,j.getApp)().isOnline||t.default.setOnline();const n=e.agent_info,a=u.default.getAgentsByStatus("join").map((e=>{const t=e.store;return t.agent_id===n.agent_id?n:t}));t.default.updateAgentInfo([n]),A.chatsDispatchers.setJoinedAgents(a)},invoice:e=>{J.log("invoice",e),A.messagesDispatchers.addMessage({type:"invoice",msg_id:e.invoice.msg_id,from:"agent",body:{type:e.invoice.gateway_system+"Invoice",comment:e.invoice.comment,amount:e.invoice.amount,invoice_id:e.invoice.invoice_id,payment_url:e.invoice.payment_url,status:e.status,currency:e.invoice.currency}})},agent_chat_close:()=>{A.appDispatchers.setChatStarted(!1),A.appDispatchers.setChatAccepted(!1),l.default.closeChat(),A.chatsDispatchers.setNoJoinedAgents(),A.appDispatchers.setLastChatOpened(!1),A.chatsDispatchers.setChatEvaluated(!1),A.clientDispatchers.updateClient({departmentId:null}),(0,j.getApp)().route===b.Route.CHAT_MIN&&(y.Router.setNext(b.Route.LABEL),p.default.reloadTransitionStore())},agent_service_message:e=>{J.warn("unhandled agent_service_message",e)},agent_typing:e=>{(0,j.getApp)().isOnline||t.default.setOnline(),p.default.agentTyping(e.typing)},update_client_info:e=>{J.warn("update_client_info",e);const t={};e.avatar_url&&(t.avatarUrl=e.avatar_url),e.display_name&&(t.displayName=e.display_name),e.assigned_agent_id&&(t.assignedAgentId=e.assigned_agent_id),e.email&&(t.email=e.email),e.phone&&(t.phone=e.phone),x.default.bots&&(e.email||e.phone)&&(t.isIntroduced=!0),A.clientDispatchers.setClientContacts(t)},update_client_id:e=>{J.warn("update_client_id",e);(0,j.getClient)().clientId!==e.jv_client_id&&(A.clientDispatchers.setClientId(e.jv_client_id),(0,N.updateHistory)(e))},message_state:e=>{const t=l.default.getMessageByPrivateId(e.private_id);if(J.log("messageState",e,t),e.status!==E.MessageStatus.DELIVERED){if(t){const n=(0,j.getApp)(),a=(0,j.getClient)(),o={chat_id:e.chat_id,msg_id:e.msg_id,status:E.MessageStatus.SENT};A.messagesDispatchers.updateMessage({privateId:t.get("private_id")},o),t.get("from")===E.MessageInitiator.CLIENT&&(t.get("type")==E.MessageType.TEMPORARY&&a.isIntroduced&&!n.isOnline&&"sent"==e.status&&(J.warn("messageState replace temp form message",t),A.messagesDispatchers.updateMessage({privateId:t.get("private_id")},{type:E.MessageType.MESSAGE}),A.clientDispatchers.setInputText("")),(0,w.prechatSetUsed)(!1),A.clientDispatchers.updateClient({lastMessage:null}))}}else{const t=(0,j.getMessages)().filter((e=>{let t=e.status,n=e.from;return t===E.MessageStatus.SENT&&n===E.MessageInitiator.CLIENT})),n=(t.length?[e].concat((0,o.default)(t)):[e]).map((e=>e.msg_id));A.messagesDispatchers.updateMessages({messageIds:n},{status:E.MessageStatus.DELIVERED})}},blacklist:()=>{k.default.set("is_blacklisted",!0,86400),A.appDispatchers.setChatStarted(!1),A.appDispatchers.setChatAccepted(!1),y.Router.next(b.RouterEvent.Hide),m.default.disableSoundPlayer()},disconnecting:()=>{R.default.stopBlinking()},offline:()=>{(0,j.getApp)().isOnline&&T.messageActions.sendNoAgentsOnline(),(0,B.setOfflineIntroduced)(),!(0,j.getClient)().isIntroduced||(0,B.needIntroduceInOffline)()?(x.default.bots||x.default.enable_bot_offline||(0,Y.isAssistantBot)()||(A.appDispatchers.setAppIsOnline(!1),A.appDispatchers.setIsInputDisabled(!0),T.messageActions.handleContactsForm(!0)),C.Monitoring.telemetryOnce(O.TelemetryName.NEWOFFLINE_FORCE_OFFLINE)):(A.appDispatchers.setAppIsOnline(!1),h.default.trackOfflineMessageSent())},update_client:e=>{e.has_integration&&(0,d.hasIntegration)(e.has_integration)&&(A.clientDispatchers.setHasIntegration(e.has_integration),A.messagesDispatchers.addMessage({text:(0,f.default)("social_success_"+e.has_integration),type:E.MessageType.SYSTEM,body:{type:E.MessageType.SOCIAL}}),y.Router.next(b.RouterEvent.ToChat),C.Monitoring.telemetry(O.TelemetryName.SOCIAL_HAS_INTEGRATION+e.has_integration),(0,d.isChatContactForm)()&&C.Monitoring.telemetry(O.TelemetryName.CHAT_INTRODUCE_SOCIAL,{param1:"connect_"+e.has_integration}))},connect_failed:()=>{J.log("connect_failed")},offline_ack:e=>{T.messageActions.offlineAck(e)},agent_message:e=>{(0,j.getApp)().isOnline||t.default.setOnline(),e.meta&&t.default.agentMessage(e)},chat_message:e=>{J.log("chat_message",e);const n=(0,j.getApp)(),a=e.params;if(n.isOnline||t.default.setOnline(),-1!==["join","left"].indexOf(a.type))p.default.updateChatAgent(e);else{const e=a.from===E.MessageType.BOT;if((a.from===E.MessageInitiator.AGENT||e)&&t.default.agentMessage(a,e),a.from===E.MessageInitiator.CLIENT){const e=(0,_.filterMessage)(a),t=(0,j.getMessageByPrivateId)(a.private_id);if(a.private_id&&t){const e={chat_id:a.chat_id,msg_id:a.msg_id,status:E.MessageStatus.SENT};A.messagesDispatchers.updateMessage({privateId:t.private_id},e)}if(e&&!t){const e=a.private_id?a.private_id:(0,i.generateGUID)();A.messagesDispatchers.addMessage(Z(Z(Z({from:E.MessageInitiator.CLIENT,text:a.text,type:E.MessageType.MESSAGE,private_id:e,status:E.MessageStatus.DELIVERED},a.chat_id?{chat_id:a.chat_id}:null),a.msg_id?{msg_id:a.msg_id}:null),a.media?{media:a.media}:null))}e&&(0,$.openChatOnMessage)()}}},chat_message_update:e=>{const t=e.params,n=t.msg_id,a=(0,j.getMessageByMessageId)(n);J.log("chat_message_update",e,n,a),a&&(t.deleted?A.messagesDispatchers.updateMessage({messageId:a.msg_id},{status:E.MessageStatus.DELETED,type:E.MessageType.MESSAGE,body:null}):t.updated_ts&&A.messagesDispatchers.updateMessage({messageId:a.msg_id},{updated_ts:1e3*t.updated_ts,text:t.text}))},agents_list_updated:e=>{if(J.log("agents_list_updated"),(0,j.getApp)().isOnline||t.default.setOnline(),e.params.length){if(1===e.params.length){const t=e.params[0];Object.assign(s.default,t),t.bot_id||A.clientDispatchers.setPaId(t.agent_id)}t.default.updateAgentInfo(e.params),A.chatsDispatchers.setJoinedAgents(e.params),A.agentsDispatchers.initializeAgentStore(u.default.toReduxFormat())}},rate:e=>{const t=e.chat_id;(0,$.needToRateForm)(t)},updateAgentInfo:e=>{if(J.log("updateAgentInfo",e),1===e.length){const t=e[0];Object.assign(s.default,{agent_id:t.agent_id||0,bot_id:t.bot_id||0,display_name:t.display_name,title:t.title||null,avatar_url:t.avatar_url||null,state:(0,j.getApp)().chatAccepted?"join":"left"}),t.bot_id||(A.agentsDispatchers.updateAgent({id:t.agent_id||t.bot_id,name:t.display_name,title:t.title,avatarUrl:t.avatar_url||null,isBot:!!t.bot_id}),A.clientDispatchers.setPaId(t.agent_id))}},setOnline(){if(A.appDispatchers.setAppIsOnline(!0),!x.default.bots&&!x.default.enable_bot_offline&&!(0,Y.isAssistantBot)()){const e=(0,f.default)("offlineAgentConnected");T.messageActions.systemMessageOnce(e)}},client_message_error:e=>{C.Monitoring.telemetry(O.TelemetryName.CLIENT_MESSAGE_ERROR,{param1:(null==e?void 0:e.error)||"empty"})},client_message_ack:()=>{}};t.default=Q},15787:function(e,t,n){"use strict";var a=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.setStartupClientInfo=t.setIntroduce=t.sendOfflineTmpMessages=t.sendIntroduceAndMessage=t.sendClientAnswerTelemetry=t.sendApiIntroduce=t.sendAgentMessageTelemetry=t.openChatOnMessage=t.needToRateForm=t.isNeedShowBotForm=t.connectionReadyForMessages=t.checkCustomData=t.agentMessageRead=t.agentMessageAck=t.addWebCallMessage=void 0;var o=a(n(61125)),r=n(88928),i=n(20361),s=a(n(19955)),l=a(n(91275)),u=n(21476),c=n(47060),d=n(26932),f=a(n(22541)),p=a(n(71277)),h=n(54415),g=n(83170),m=a(n(35802)),_=n(65465),v=a(n(23116)),y=a(n(14264)),b=a(n(4855)),E=n(55329),T=n(43914),C=n(44145),O=n(33813),S=n(41504),w=n(13077),A=n(47138),I=n(28302),M=n(32046),P=n(81152),R=n(69882),k=n(84727),N=n(34445),D=n(91225);function x(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function L(e){for(var t=1;t{if(s.default.desktop()&&(!(0,R.isCustomLabel)()||"function"!=typeof(0,R.getPageWindow)().jivo_onMessageReceived)){(0,D.isChatInputRoute)((0,C.getApp)().route)||u.Router.next(c.RouterEvent.ToChat),u.Router.getPrevRoute()===c.Route.CHAT_MIN?d.transitionDispatchers.startTransition(i.ScriptName.MAXIMIZE_WIDGET):d.transitionDispatchers.startTransition(i.ScriptName.OPEN_WIDGET);const e=setInterval((()=>{(0,O.fixSafariKeyframes)()}),50);setTimeout((()=>{clearInterval(e)}),300),f.default.startBlinking()}p.default.play("agent_message"),(0,T._callUserFunction)("onMessageReceived")};t.openChatOnMessage=B;t.sendAgentMessageTelemetry=e=>{h.Monitoring.telemetry(g.TelemetryName.AGENT_MESSAGE,{param1:(0,E.getPrechatUseTime)(),param2:v.default.isActive&&(0,D.isChatInputRoute)((0,C.getApp)().route)?"visible":"hide",param3:e||P.MessageType.MESSAGE})};t.sendClientAnswerTelemetry=e=>{j.warn("sendClientAnswerTelemetry",e);const t=y.default.getLastMessage();if(t){const n=t.get("body.bot_message_type"),a=(0,k.validateClientAnswer)(n,e.text);h.Monitoring.telemetry(g.TelemetryName.CLIENT_MESSAGE_ASSISTANT,{param1:n,param2:a?"valid":"not_valid",param3:e.text})}};t.setStartupClientInfo=e=>{d.clientDispatchers.setHasIntegration(e.has_integration),d.clientDispatchers.setAssignedAgentId(e.assigned_agent_id||null);const t=e.name||e.client_name,n=(0,C.getClient)(),a={description:n.description,accept_eula:n.eulaAccepted||null};n.email!==e.email&&(a.email=n.email),n.phone!==e.phone&&(a.phone=n.phone),n.name!==t&&(a.client_name=n.name),j.log("setStartupClientInfo",n,a),(a.email||a.phone||a.client_name)&&F(a),!n.email&&e.email&&d.clientDispatchers.setClientEmail(e.email),!n.phone&&e.phone&&d.clientDispatchers.setClientPhone(e.phone),!n.name&&t&&d.clientDispatchers.setClientName(t),(0,C.getApp)().isOnline||U()};t.isNeedShowBotForm=e=>{const t=e.lastStatus;return!((t&&t.agents?t.agents.length:0)>0&&2==e.contacts_ask)&&(e.bots&&e.enable_bot_offline)};t.checkCustomData=e=>{const t=m.default.getInstance();if(t&&e){const n=t.managers.connection;n&&n.isOpen()&&n.send(new S.UpdateCustomData(e)),e&&d.clientDispatchers.setCustomData(e)}};const F=e=>{d.clientDispatchers.setClientContacts({name:e.name||e.client_name||null,phone:e.phone||null,email:e.email||null,description:e.description||null}),j.warn("setIntroduce",e);const t=new S.Introduction(e.name||e.client_name||null,e.phone||null,e.email||null,e.description||null,(0,C.getSystemSettings)().eula&&(0,C.getClient)().eulaAccepted||null),n=m.default.getInstance();if(n){const e=n.managers.connection;e&&e.sendIfConnected(t)}};t.setIntroduce=F;t.sendApiIntroduce=e=>{const t=(0,w.getRuleLocal)("lastContactApiData"),n={client_name:e.name||e.client_name,phone:e.phone,email:e.email,description:e.description};return(0,r.shallowEqual)(L(L({},n),{},{message:e.message}),t)?(j.error("setContactInfo same client contacts",t),!1):(e.message&&_.messageActions.sendClientMessage(e.message),l.default.setClientContactInfo(n,!0),e.message&&(n.message=e.message),(0,w.setRuleLocal)("lastContactApiData",n),!0)};const U=()=>{const e=y.default.getTemporaryMessages();e&&(j.warn("sendOfflineTmpMessages"),e.forEach((e=>{_.messageActions.sendClientMessage(e.get("text"),e.get("private_id"))})))};t.sendOfflineTmpMessages=U;t.addWebCallMessage=()=>{_.messageActions.addWebRTCCallMessage();const e=(0,I.getActiveMessage)(A.WebRTCCallStatus.INITIAL);e&&d.messagesDispatchers.updateWebRTCCallStatus(e.private_id,A.WebRTCCallStatus.INITIAL),B(),p.default.play("agent_message")};t.sendIntroduceAndMessage=(e,t)=>{t&&_.messageActions.sendClientMessage(t),d.clientDispatchers.updateClient({lastMessage:null}),l.default.setClientContactInfo(e,!1,!0)};t.needToRateForm=(e,t)=>{j.warn("needToRateForm",e,t);const n=y.default.getMessagesByType(P.MessageType.RATE_FORM);if(n.length&&n[0]&&n[0].get("chat_id")==e)return;const a=(0,C.getUserSettings)().rateSettings;e&&a&&(0,M.pushRateForm)(e,a.conditionName,t)};t.agentMessageRead=(e,t)=>{const n=m.default.getInstance();n&&(f.default.stopBlinking(),n.managers.connection.send(new S.AgentMessagesRead(e,t)))};t.agentMessageAck=(e,t)=>{const n=m.default.getInstance();n&&n.managers.connection.send(new S.AgentMessagesAck(e,t))};t.connectionReadyForMessages=()=>{const e=m.default.getInstance();return(null==e?void 0:e.managers.connection.isOpen())&&[N.ChatStatus.STARTUP_OK,N.ChatStatus.RESUME_OK].includes((0,C.getApp)().lastChatStatus)}},91275:function(e,t,n){"use strict";var a=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=a(n(1039)),r=a(n(95003)),i=n(69882),s=n(16016),l=a(n(19955)),u=a(n(138)),c=a(n(14264)),d=a(n(14762)),f=a(n(84726)),p=a(n(4855)),h=n(21476),g=n(47060),m=n(81152),_=n(65465),v=n(80161),y=n(54415),b=n(83170),E=n(43914),T=n(62096),C=n(26932),O=n(31984),S=n(47138),w=n(20361),A=a(n(79868)),I=a(n(71323)),M=a(n(74379)),P=a(n(35802)),R=n(41504),k=n(44145),N=a(n(73687)),D=n(68403),x=n(23336),L=n(91225),j=n(33069),B=n(41168),F=n(62162),U=n(15787);const W=p.default.name("Actions");let H=null,G="",z=0,V=null,q=!1;const $={startCallDebounce:function(e,n){let a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";if(W.warn("startCallDebounce",e,n),t.default.startCallTimeout(),["cw_wait","cw_connecting","cw_connected"].indexOf((0,k.getCallback)().status)>=0)return void W.log("already calling");const o=(0,O.getPhoneNumberInfo)(e);o?C.clientDispatchers.setClientPhone("+"+o.phoneCode+o.innerNumber):C.clientDispatchers.setClientPhone(e);const r=(0,k.getClient)(),i=(0,k.getApp)();(0,U.setIntroduce)({name:r.name,phone:r.phone,email:r.email,description:r.description},!1),(0,O.checkStartCall)({phone:e,invitationText:a,clientToken:r.clientId},((a,o)=>a?(t.default.setCallError(),y.Monitoring.telemetry(b.TelemetryName.CALL_ERROR,{param1:"in request"})):((o=o.data)||(W.log("Wrong response from telephony"),o={ok:!1,error_list:["wrong_response"]}),o.only_forward?(C.callbackDispatchers.setCallbackStatus(S.CallStatus.ERROR),void C.callbackDispatchers.setCallbackError((0,f.default)("cw_call_forward"))):void(o.ok?(C.appDispatchers.setChatStarted(!0),C.appDispatchers.setChatAccepted(!0),C.callbackDispatchers.setCallbackStatus(S.CallStatus.WAIT),_.messageActions.handleContactsForm(),_.messageActions.systemCallMessage(`${(0,f.default)("cw_call_to")} ${(0,O.getMaskedPhone)(e)}`,m.MessageName.CALL_MESSAGE_START),(0,E._callUserFunction)("onCallStart"),u.default.trackCallWidgetRequested(),y.Monitoring.telemetry(b.TelemetryName.CALL_START,{param1:n}),t.default.reloadTransitionStore()):(t.default.setCallError(),y.Monitoring.telemetry(b.TelemetryName.CALL_ERROR,{param1:o.error_list.join(" ")}),o.work_time&&o.work_time.schedule&&((0,j.onDelayedCallAvailable)(o.work_time),(0,j.redirectAfterRequestDelayedCall)(),y.Monitoring.telemetry(b.TelemetryName.CALL_START,{param1:n})),l.default.mobileOrTablet()||i.route!==g.Route.LABEL||h.Router.next(g.RouterEvent.Navigate))))))},checkConnection:e=>{const t=P.default.getInstance().managers.connection;W.warn("checkConnection",e,t),t.isOpen()?e():t.open(e,!0)},requestCWAvailable:e=>{const t=(0,k.getApp)();N.default.get("is_blacklisted")||t.route==g.Route.HIDDEN||(t.maintenance?C.callbackDispatchers.setCallbackAvailable(!1):(W.warn("requestCWAvailable"),(0,O.callWidgetPing)((t=>{C.callbackDispatchers.setCallbackAvailable(t.ok),t.work_time&&(0,j.onDelayedCallAvailable)(t.work_time),(0,k.getCallback)().available&&"function"==typeof e&&e()}),t.chatStarted)))},requestApiCWAvailable:e=>{(0,O.callWidgetPing)((t=>{if(C.callbackDispatchers.setCallbackAvailable(t.ok),(0,k.getCallback)().available&&"function"==typeof e)e({result:"ok"});else{const n=t.error_list?t.error_list.join(" "):"Call request error";e({result:"fail",reason:n})}}),(0,k.getApp)().chatStarted)},pingAndOpenCall:()=>{W.info("pingAndOpenCall"),t.default.checkConnection((()=>{const e=(0,k.getApp)();(0,O.callWidgetPing)((e=>{C.callbackDispatchers.setCallbackAvailable(e.ok),e.ok&&(0,k.getApp)().route===g.Route.LABEL&&(C.userDispatchers.setCallHeaderText(null),[S.CallPopupStatus.ENABLED,S.CallPopupStatus.ONLY_BUTTON_CLICK].includes((0,k.getCallback)().separateForm)&&l.default.desktop()?h.Router.next(g.RouterEvent.ToCallPopup):(h.Router.next(g.RouterEvent.ToCall),l.default.desktop()&&C.transitionDispatchers.startTransition(w.ScriptName.OPEN_WIDGET)),y.Monitoring.telemetryOnce(b.TelemetryName.API_CALL_OPEN))}),e.chatStarted)}))},openChatCallbacks(){W.log("openChatCallbacks"),(0,k.getApp)().isOnline?u.default.trackChatOpenedByClick():u.default.trackOfflineFormOpenedByClick(),(0,E._callUserFunction)("onOpen")},setClientContactInfo:function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];W.warn("setClientContactInfo",e,t,n),(0,U.setIntroduce)(e),t||(C.clientDispatchers.setIsIntroduced(!0),u.default.trackGaveContacts(),n&&y.Monitoring.telemetry(b.TelemetryName.INTRODUCE,{param1:o.default.contacts_ask,param2:JSON.stringify({name:Boolean(e.client_name),department_id:e.departmentId,email:Boolean(e.email),phone:Boolean(e.phone)})}),(0,E._callUserFunction)("onIntroduction"))},startCall:(e,n,a)=>{W.log("startCall from chat",e),t.default.checkConnection((()=>{t.default.startCallDebounce(e.replace(/\D+/g,""),n,a)}))},markEvaluated:()=>{C.chatsDispatchers.setChatEvaluated(!0)},clientTyping:e=>{const t=e?1:0;if(z!=t){z=t;const e=new R.ClientTyping(t),n=P.default.getInstance().managers.connection;(0,U.connectionReadyForMessages)()&&n.send(e)}},typingInsight:e=>{if(1==o.default.typing_insight&&G!=e){G=e;const t=P.default.getInstance().managers.connection;(0,U.connectionReadyForMessages)()&&t.send(new R.ClientServiceMessage(e))}},updateTitle:(e,t)=>{if(W.log("updateTitle",e),!window||!window.location)return void W.log("no window");if(l.default.mobileOrTablet()&&(0,k.getApp)().route!==g.Route.LABEL)return;const n=t||(0,i.getCurrentPage)().url;W.log("updateTitle url",n);const a=P.default.getInstance().managers.connection;a&&(0,U.connectionReadyForMessages)()&&a.send(new R.UrlChange(n,(0,s.setSubstrTitle)(e)))},submitShowEula:e=>{if(v.RouterUtils.needToShowEula()){const t=(0,O.getMaskedPhone)(e);return I.default.showEula(`${(0,f.default)("eula_phone")}
${t}`,null,"cb"),h.Router.next(g.RouterEvent.Submit,{context:"cb"}),!0}return!1},reloadStories:()=>{r.default.reload(),t.default.syncRouter()},syncRouter:()=>{const e=(0,k.getApp)(),n=(0,k.getClient)();if(W.warn("syncRouter",e.route,h.Router.getCurrentRoute()),e.route!==h.Router.getCurrentRoute()){const a=h.Router.getPrevEvent(),o=e.route===g.Route.INTRODUCE;if(n.isIntroduced&&o)return;if(!e.isOnline&&o)return;if((0,D.isChatContactForm)()&&o)return;if(!(e.route!==g.Route.CHAT_SOCIAL||a&&A.default.getPopupMode()))return void W.warn("prevent to show Social without user click.");if(-1!=[g.Route.CHAT_EULA,g.Route.CALL_EULA].indexOf(e.route)&&(!a||a&&-1==a.indexOf("submit"))&&e.showEula)return void W.warn("prevent to show Eula without user click.");if(e.route===g.Route.CHAT_MIN&&!e.chatAccepted)return void h.Router.setNext(g.RouterEvent.CloseWindow);h.Router.setNext(e.route),t.default.reloadTransitionStore()}},agentTyping(e){0==e?clearTimeout(H):H=setTimeout((()=>{t.default.agentTyping(0)}),3e3),C.chatsDispatchers.setAgentTyping(e)},updateChatAgent:e=>{const t=e.params,n=d.default.getAgentById(t.from_id);n?(n.set("body.state",t.type),C.messagesDispatchers.addMessage({type:"system",body:{from_id:t.from_id,action:t.type,type:"chat"},msg_id:t.msg_id,chat_id:t.chat_id})):W.error("updateChatAgent: No agent info in agents store.")},clearCallTimeout:()=>{V&&clearTimeout(V)},startCallTimeout:()=>{t.default.clearCallTimeout();const e=(0,k.getCallback)();V=setTimeout((()=>{["cw_wait","cw_connecting"].indexOf(e.status)>=0&&t.default.setCallError()}),24e4)},setCallError:()=>{const e=(0,B.getCallDefaultError)();C.callbackDispatchers.setCallbackStatus(S.CallStatus.ERROR),C.callbackDispatchers.setCallbackError(e),C.messagesDispatchers.addMessage({text:e,type:m.MessageType.SYSTEM,from:m.MessageInitiator.SYSTEM,body:{type:m.MessageType.CALL,name:m.MessageName.CALL_END}})},initializeReduxStores(){var e,n;const a=(0,i.getChatPageToken)(),s=(0,k.getApp)().isInputDisabled;if(a&&C.clientDispatchers.setUserToken(a),o.default.joint||C.clientDispatchers.setHasIntegration(!1),C.callbackDispatchers.setSeparateForm(null===(e=o.default.callback_settings)||void 0===e?void 0:e.separate_form),null!==(n=o.default.callback_settings)&&void 0!==n&&n.time||C.callbackDispatchers.setCallbackAvailable(!1),W.log("initializeReduxStores",r.default),C.appDispatchers.initializeAppStore({isFocused:r.default.is_focused,isOnline:r.default.is_online,route:r.default.route,tabRoute:null,lastChatOpened:r.default.lastChatOpened,isInputDisabled:s,maintenance:o.default.maintenance,chatOpenByClient:!1,chatStarted:r.default.chat_started,chatAccepted:r.default.chat_accepted,lastMsgId:r.default.lastMsgId,lastMsgTime:r.default.lastMsgTime,started:r.default.started,showEula:r.default.show_eula,viReconnectTime:r.default.viReconnectTime,didFreezeData:r.default.didFreezeData,lastChatStatus:r.default.lastChatStatus}),(0,x.setOfflineIntroduced)(),l.default.mobileOrTablet()){if(r.default.route==g.Route.HIDDEN)return;M.default.checkZooms()}if(d.default.toReduxFormat().length&&(C.agentsDispatchers.initializeAgentStore(d.default.toReduxFormat()),C.botsDispatchers.initializeBotsStore(d.default.toReduxFormat())),o.default.bots&&o.default.bots.length){const e=o.default.bots[0];C.botsDispatchers.addBot({avatarUrl:e.avatar_url||null,id:e.bot_id,name:e.display_name||null,title:e.title||null,isBot:!0,type:e.type})}C.messagesDispatchers.initializeMessagesStore(),C.chatsDispatchers.initializeChatsStore(),t.default.reloadTransitionStore();const u=(0,k.getProactive)();if(u.text){const e=(0,F.getProactiveAgent)(u);W.warn("restore agent proactiveData",e),e&&(0,F.addProactiveAgent)(e)}},reloadTransitionStore(){const e=(0,k.getApp)().route;let t=(0,L.isContainerRoute)(e)?w.ScriptName.OPEN_WIDGET:w.ScriptName.CLOSE_WIDGET;e===g.Route.CALL_POPUP&&(t=w.ScriptName.CLOSE_WIDGET),(0,L.isMinRoute)(e)&&(t=w.ScriptName.MIN_WIDGET),t==w.ScriptName.OPEN_WIDGET&&T.reduxStore.getState().transition.currentScript==w.ScriptName.MAXIMIZE_WIDGET||C.transitionDispatchers.initializeTransitionStore({currentScript:t})},getCurrentChatStatus(){return(0,k.getApp)().chatAccepted?S.ChatState.ACCEPTED:(0,k.getApp)().chatStarted?S.ChatState.STARTED:S.ChatState.NOT_STARTED_OR_CLOSED},checkChatStarted(e){(0,k.getApp)().isOnline||(W.log("checkChatStarted for offline."),C.appDispatchers.setLastChatOpened(e),c.default.store.length||e||C.appDispatchers.setChatStarted(!1))},initSocial(){q||(A.default.startSocials(),q=!0)},addMessagesOnOpen(){_.messageActions.addMessagesOnOpen((0,k.getApp)().isOnline)}};var K=$;t.default=K},54346:function(e,t,n){"use strict";var a=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.reportVisitorSentTelemetry=t.markInvitationAnswered=t.isAssistantBot=t.checkTrackClientAnswer=void 0;var o=a(n(138)),r=a(n(14264)),i=n(78692),s=n(26932),l=n(55329),u=n(54415),c=n(83170),d=n(44145),f=n(97939),p=n(43914),h=n(60718),g=n(48999),m=n(62162);const _=()=>{if((0,d.getApp)().chatStarted){const e=r.default.getCurrentChatAgentMessages(),t=r.default.getCurrentClientMessages();t&&!t.length&&e&&e.length&&o.default.trackClientAnswerAgentChatRequest()}else o.default.trackClientInitChat(),(0,p._callUserFunction)("onClientStartChat")};t.checkTrackClientAnswer=_;t.markInvitationAnswered=()=>{const e=(0,d.getProactive)(),t=e.name,n=e.campaignId;if(n){u.Monitoring.reportStats(h.StatType.CHAT_INIT,n);const e=(0,g.getCampaignById)(n);null!=e&&e.tag_id&&((0,g.addClientTag)(e.tag_id),(0,g.sendTagsIfNeed)())}t&&((0,m.acceptProactive)(),s.proactiveDispatchers.setName(null),u.Monitoring.telemetry(c.TelemetryName.INVITE_ACCEPTED)),_(),i.ApiInvitationsManager.isInitialized()&&i.ApiInvitationsManager.hasInvitations()&&i.ApiInvitationsManager.markInvitationsAnswered()};t.reportVisitorSentTelemetry=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const t=r.default.getChatCounts(),n=(0,l.prechatUsed)()?"prechat_used":"from_input",a={param1:t>0?"old":"new",param2:n,param3:(0,d.getUserSettings)().locale,param4:e?"media":"text"};u.Monitoring.telemetry(c.TelemetryName.VISITOR_MSG_SENT,a)};t.isAssistantBot=()=>{const e=(0,d.getBots)();return e.length&&e[0].type===f.BotType.ASSISTANT}},65465:function(e,t,n){"use strict";var a=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.messageActions=void 0;var o=a(n(33119)),r=a(n(92664)),i=a(n(26754)),s=n(44145),l=n(16016),u=n(69882),c=n(92560),d=a(n(1039)),f=a(n(19955)),p=a(n(14264)),h=a(n(79868)),g=a(n(84726)),m=a(n(4855)),_=n(21476),v=n(47060),y=n(81152),b=n(55329),E=n(52028),T=n(54415),C=n(83170),O=n(43914),S=n(13077),w=n(81722),A=n(26932),I=a(n(35802)),M=n(47138),P=a(n(63427)),R=n(66934),k=n(97615),N=n(94537),D=n(62162),x=n(15787),L=n(54346),j=n(80161),B=n(34445),F=n(54346);const U=m.default.name("MessageActions");let W=function(){function e(){(0,o.default)(this,e),this.cacheOfflineMsg={},this.mediaFile=!1,this.formTimeout=null,this.clientSendingFirstMessage=!1}return(0,r.default)(e,[{key:"systemMessage",value:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"text",n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];U.log("systemMessage",e,t);const a={type:"text"!==t?"call":t,name:t};n||(a.unsave=!0),A.messagesDispatchers.addMessage({text:e,type:y.MessageType.SYSTEM,body:a})}},{key:"testMessage",value:function(e){A.messagesDispatchers.addMessage({text:e,type:y.MessageType.FOR_TEST,from:y.MessageInitiator.AGENT})}},{key:"botMessage",value:function(e){U.log("botMessage",e),A.messagesDispatchers.addMessage({type:y.MessageType.PREFORM,text:e,from:y.MessageInitiator.FORM})}},{key:"messageOnce",value:function(e,t,n,a){const o=this.checkIfMessageExists(e,t);if(U.log("messageOnce",o),!o)switch(e){case y.MessageType.SYSTEM:this.systemMessage(t,n,a);break;case y.MessageType.PREFORM:this.botMessage(t);break;case y.MessageType.FOR_TEST:this.testMessage(t)}}},{key:"systemMessageOnce",value:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"text",n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];this.messageOnce(y.MessageType.SYSTEM,e,t,n)}},{key:"botMessageOnce",value:function(e){this.messageOnce(y.MessageType.PREFORM,e)}},{key:"checkIfMessageExists",value:function(e,t){const n=(0,s.getMessages)();if(!n.length)return!1;const a=n.find((n=>{const a=n.type===e,o=!t||n.text===t;return a&&o}));return a||!1}},{key:"_sendClientMessageBase",value:async function(e,t){U.warn("_sendClientMessageBase",e,t);const n=t||(0,l.generateGUID)();(0,F.markInvitationAnswered)(),(0,D.saveLastProactive)(),this.saveLastSystemMessage();const a={name:"client_message",message:e,private_id:n},o=(0,s.getApp)(),r=(0,s.getClient)();r.departmentId&&(a.widget_department_id=r.departmentId);const i=!(0,F.isAssistantBot)()&&!r.isIntroduced&&!o.isOnline;let c=null;if(!this.mediaFile&&!t){const t={from:y.MessageInitiator.CLIENT,text:e,type:i?y.MessageType.TEMPORARY:y.MessageType.MESSAGE,private_id:n,status:y.MessageStatus.SENT};(0,b.prechatUsed)()&&(t.body={is_prechat:!0}),(0,F.isAssistantBot)()&&(0,x.sendClientAnswerTelemetry)(t),c=p.default.push(t),A.messagesDispatchers.addMessage(t,!0)}if(1!==p.default.getClientMessages().length||this.clientSendingFirstMessage||(this.clientSendingFirstMessage=!0,(0,O._callUserFunction)("onMessageSent")),(0,u.isWixEditor)()||E.isDesignerEditor)return void U.warn("send message disabled.");if(!c&&t&&(c=p.default.getMessageByPrivateId(t)),(0,b.prechatEnabled)()&&((0,b.prechatUsed)()&&(a.is_prechat_btn=!0),this.deletePrechatMsg()),3==d.default.contacts_ask&&h.default.isLoginned()&&this.initSocial(),this.startContactFormIfNeed(),j.RouterUtils.canShowIntroduceForm())return void _.Router.next(v.RouterEvent.ToIntroduce);if(this.mediaFile&&(a.media=this.mediaFile.file,a.private_id=this.mediaFile.privateId,this.mediaFile=!1),(0,S.getRuleLocal)("firstMessageTime")||(0,S.setRuleLocal)("firstMessageTime",new Date),c){if(i)return;setTimeout((()=>{(0,R.checkForDelivered)(c)}),2e3)}A.appDispatchers.setChatStarted(!0),A.appDispatchers.setLastMsgTime((new Date).getTime());const f=I.default.getInstance().managers.connection;f.isOpen()||await f.open((()=>{}),!0);const g=(0,s.getApp)().lastChatStatus;(0,x.connectionReadyForMessages)()&&f.send(a),g&&g!==B.ChatStatus.STARTUP||f.buffer.add(a),(0,L.reportVisitorSentTelemetry)()}},{key:"startContactFormIfNeed",value:function(){this.needToShowContactsForm()&&!d.default.bots&&this.startFormSequence((0,s.getApp)().isOnline?(0,g.default)("lblIntroduceRequest"):(0,g.default)("offlineIntroductionText"))}},{key:"needToShowContactsForm",value:function(){if(U.warn("needToShowContactsForm"),(0,F.isAssistantBot)())return!1;const e=(0,s.getApp)(),t=(0,s.getClient)(),n=(0,s.getUserSettings)();return!t.isIntroduced&&!i.default.bot_id&&(-1!==[N.ContactsType.DURING_CHAT,N.ContactsType.DURING_CHAT_NO_CLOSE].indexOf(n.contactsAsk)||!e.isOnline)&&!p.default.getFormMessage().length&&p.default.getClientMessages().length}},{key:"checkContactsForm",value:function(){if(this.needToShowContactsForm()){const e=(0,g.default)("lblIntroduceRequest"),t=this.checkIfMessageExists(y.MessageType.PREFORM,e);if(t||this.botMessage(e),t){const e=p.default.getMessageByPrivateId(t.private_id);e&&e.set("created_ts",(new Date).getTime())}this.addContactsForm()}}},{key:"addContactsForm",value:function(){U.warn("addContactsForm");const e=this.checkIfMessageExists(y.MessageType.FORM);if(e){const t=p.default.getMessageByPrivateId(e.private_id);t&&t.set("created_ts",(new Date).getTime()+1)}else A.messagesDispatchers.addMessage({type:y.MessageType.FORM,from:y.MessageInitiator.FORM}),this.addSocialTelemetry()}},{key:"saveLastSystemMessage",value:function(){const e=p.default.getLastMessage();e&&"system"==e.get("type")&&e.get("body")&&e.get("body").unsave&&e.set("body",null)}},{key:"storeMediaFile",value:function(e,t){this.mediaFile={file:e,privateId:t}}},{key:"addSocialTelemetry",value:function(){const e=h.default.getJoints().links;let t="";e.vkUrl&&e.fbUrl&&(t="show_vkfb"),e.vkUrl&&!e.fbUrl&&(t="show_vk"),!e.vkUrl&&e.fbUrl&&(t="show_fb"),(e.vkUrl||e.fbUrl)&&T.Monitoring.telemetry(C.TelemetryName.CHAT_INTRODUCE_SOCIAL,{param1:t})}},{key:"initSocial",value:function(){if(U.log("initSocial",h.default.isLoginned()),!p.default.getMessagesByType(y.MessageType.SOCIAL).length&&!f.default.mobileOrTablet()){const e=(0,s.getClient)();setTimeout((()=>{1!==p.default.getCurrentClientMessages().length||e.hasIntegration||(i.default.bot_id||A.messagesDispatchers.addMessage({text:(0,g.default)("social_online_text"),type:y.MessageType.SYSTEM,body:{type:y.MessageType.SOCIAL}}),setTimeout((()=>{this.addSocialMessage()}),2e3))}),2e3)}}},{key:"addSocialMessage",value:function(){const e=(0,s.getClient)();U.log("addSocialMessage"),d.default.joint&&!e.email&&!e.hasIntegration&&!f.default.mobileOrTablet()&&!p.default.getMessagesByType(y.MessageType.SOCIAL).length&&p.default.getCurrentClientMessages().length>0&&A.messagesDispatchers.addMessage({text:"",type:y.MessageType.SOCIAL})}},{key:"getOfflineSuccessText",value:function(){return(0,g.default)("offlineSuccessContactsSubmit")}},{key:"offlineSystemInvite",value:function(){if(!(0,s.getApp)().maintenance&&!(0,s.getApp)().isOnline&&!(0,s.getApp)().chatStarted){const e=(0,s.getUserSettings)().offlineFormText;U.log("offlineSystemInvite",e),this.messageOnce(y.MessageType.FOR_TEST,e)}}},{key:"startFormSequence",value:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:700;U.log("startFormSequence",e,t),(0,s.getApp)().isOnline&&i.default.bot_id&&!d.default.enable_bot_offline||((0,F.isAssistantBot)()?U.log("Disable form for assistant bot."):(this.formTimeout&&clearTimeout(this.formTimeout),(0,s.getApp)().isOnline||this.setInputDisabled(!0),t?this.formTimeout=setTimeout((()=>{0===p.default.getFormMessage().length&&(e&&this.botMessageOnce(e),setTimeout((()=>{this.addContactsForm()}),t),T.Monitoring.telemetry(C.TelemetryName.CHAT_INTRODUCE,{param1:"show"}))}),t):0===p.default.getFormMessage().length&&(e&&this.botMessageOnce(e),this.addContactsForm(),T.Monitoring.telemetry(C.TelemetryName.CHAT_INTRODUCE,{param1:"show"}))))}},{key:"deleteUnansweredOfflineSystemInvite",value:function(){if(U.warn("deleteUnansweredOfflineSystemInvite"),0===p.default.getTemporaryMessages().length){this.deleteOfflineSystemInvites();const e=(0,s.getClient)();(0,w.isValidEmail)()||e.isIntroduced||this.deleteOfflineTmpMessage(),A.messagesDispatchers.initializeMessagesStore()}}},{key:"deleteOfflineTmpMessage",value:function(){U.warn("deleteOfflineTmpMessage"),this.destroyByType(y.MessageType.FOR_TEST),this.destroyByType(y.MessageType.TEMPORARY),(0,s.getApp)().isOnline&&0==d.default.contacts_ask||(this.destroyByType(y.MessageType.PREFORM),this.destroyByType(y.MessageType.FORM))}},{key:"addPrechatMessage",value:function(){if(!(0,b.prechatEnabled)())return;const e=p.default.getMessagesByType(y.MessageType.PRECHAT),t=(0,s.getApp)();!t.isOnline||t.chatStarted||e.length?e.length&&(e[0].set("created_ts",(new Date).getTime()),p.default.sort(),p.default.trigger("update")):this.pushPrechat()}},{key:"pushPrechat",value:function(e){A.messagesDispatchers.addMessage({body:{unsave:!0,prechats:e||d.default.prechat||null},type:y.MessageType.PRECHAT,from:y.MessageInitiator.FORM})}},{key:"deletePrechatMsg",value:function(){const e=p.default.getMessagesByType(y.MessageType.PRECHAT);e&&e.forEach((e=>{e&&e.destroy()}))}},{key:"deleteOfflineSystemInvites",value:function(){const e=p.default.getMessagesByType(y.MessageType.FOR_TEST);U.log("deleteOfflineSystemInvites",e),e.forEach((e=>{e&&e.destroy()}))}},{key:"addMaintenanceMessage",value:function(){this.systemMessageOnce((0,g.default)("maintenanceSystemText"),"text",!1),A.appDispatchers.setIsInputDisabled(!0)}},{key:"deleteMaintenanceMessage",value:function(){U.log("deleteMaintenanceMessage");p.default.getSystemMessageByText((0,g.default)("maintenanceSystemText")).forEach((e=>{e&&e.destroy()}))}},{key:"destroyByType",value:function(e){p.default.getMessagesByType(e).forEach((e=>{e&&e.destroy()}))}},{key:"markdownMessage",value:function(e){U.log("markdownMessage",e),A.messagesDispatchers.addMessage({type:y.MessageType.MESSAGE,text:e,from:y.MessageInitiator.AGENT,body:{customerIO:!0,unsave:!0}})}},{key:"systemCallMessage",value:function(e,t){const n=p.default.getLastMessage();(!n||n&&n.get("text")!==e)&&this.systemMessage(e.replace("
","\n"),t)}},{key:"sendClientMessage",value:function(e,t){0!==p.default.getClientMessages().length||k.EnvironmentManager.isDesignerEditor()||k.EnvironmentManager.isRegPage()?this.sendClientMessageCheck(e,t):P.default.getStatus((()=>{this.sendClientMessageCheck(e,t)}))}},{key:"sendClientMessageCheck",value:function(e,t){if(t){const e=I.default.getInstance();if(e){e.managers.connection.provider.setLastError(null)}}if(d.default.bots)return this._sendClientMessageBase(e,t),void(d.default.enable_bot_offline||this.handleContactsForm());(0,s.getApp)().isOnline||this.handleContactsForm(),this._sendClientMessageBase(e,t)}},{key:"offlineAck",value:function(e){U.log("offlineAck"),(0,c.isEmpty)(this.cacheOfflineMsg)&&!e||(_.Router.getCurrentRoute()===v.Route.CHAT||f.default.mobileOrTablet()||_.Router.next(v.RouterEvent.ToChat),this.cacheOfflineMsg=e)}},{key:"sendNoAgentsOnline",value:function(){d.default.bots||d.default.enable_bot_offline||(0,F.isAssistantBot)()||this.systemMessageOnce((0,g.default)("offlineForceOfflineMessage"))}},{key:"handleContactsForm",value:function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const t=(0,s.getClient)();if(!(0,s.getApp)().isOnline&&!t.isIntroduced&&p.default.getClientMessages().length&&(p.default.getOfflineTmpMessage()||e)){U.warn("handleContactsForm");const e=p.default.getFormMessage();if(0===e.length)this.startFormSequence((0,g.default)("offlineIntroductionText")),T.Monitoring.telemetryOnce(C.TelemetryName.NEWOFFLINE_FIRST_MESSAGE);else{const t=p.default.getFormIntroduceText();t.length&&t[0].set({text:(0,g.default)("offlineIntroductionText"),created_ts:(new Date).getTime()}),e[0].set("created_ts",(new Date).getTime()+1),p.default.sort(),setTimeout((()=>{p.default.trigger("update")}),200),this.setInputDisabled(!0)}}}},{key:"handleBotContactsForm",value:function(){const e=(0,s.getClient)();U.log("handleBotContactsForm"),!e.isIntroduced&&d.default.bots&&d.default.enable_bot_offline&&0===p.default.getFormMessage().length&&(this.startFormSequence(),T.Monitoring.telemetryOnce(C.TelemetryName.NEWOFFLINE_FIRST_MESSAGE))}},{key:"setInputDisabled",value:function(e){U.log("setInputDisabled",e),A.appDispatchers.setIsInputDisabled(e)}},{key:"checkMessageStatus",value:function(e){return U.log("checkMessageStatus"),new Promise((t=>{setTimeout((()=>{const n=(0,s.getMessageByPrivateId)(e);let a=!1;n?n.msg_id||(A.messagesDispatchers.updateMessage({privateId:n.private_id},{status:y.MessageStatus.NOT_DELIVERED}),a=!0,t({isNotDelivered:a,isDeleted:n.status===y.MessageStatus.DELETED})):(a=!0,t({isNotDelivered:a,isDeleted:!1}))}),2e3)}))}},{key:"setListpickerAnswer",value:function(e,t){U.log("setListpickerAnswer",e,t);const n=p.default.getMessageById(e);if(n){n.set("body.answer_id",t);const e=n.get("body.keyboard")[t];n.set("body.keyboard",[e]),n.get("body.force_reply")&&n.set("body.force_reply",null),this.destroyByType(y.MessageType.LISTPICKER),this.setInputDisabled(!1)}}},{key:"hideEmailForm",value:function(){const e=p.default.getMessagesByType("email");e.length&&e[e.length-1].destroy()}},{key:"addMessagesOnOpen",value:function(e){this.deleteUnansweredOfflineSystemInvite(),e?this.addPrechatMessage():this.offlineSystemInvite()}},{key:"addWebRTCCallMessage",value:function(){U.warn("addWebRTCCallMessage");const e=(0,s.getChats)(),t=e[e.length?e.length-1:0],n=t&&t.joinedAgents[0],a=(0,l.generateGUID)(),o={from:y.MessageInitiator.AGENT,type:y.MessageType.WEB_RTC_CALL,from_id:n,private_id:a,body:{webRTCCallStatus:M.WebRTCCallStatus.INITIAL}};A.messagesDispatchers.addMessage(o),A.callbackDispatchers.setActiveWebRTCCallMessageId(a)}}]),e}();const H=new W;t.messageActions=H},62162:function(e,t,n){"use strict";var a=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.sendUpdateProactive=t.saveLastProactive=t.rejectProactive=t.readProactive=t.getProactiveAgent=t.getCurrentProactiveData=t.addProactiveAgentToChat=t.addProactiveAgent=t.acceptProactive=void 0;var o=a(n(61125)),r=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=m(t);if(n&&n.has(e))return n.get(e);var a={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var r in e)if("default"!==r&&Object.prototype.hasOwnProperty.call(e,r)){var i=o?Object.getOwnPropertyDescriptor(e,r):null;i&&(i.get||i.set)?Object.defineProperty(a,r,i):a[r]=e[r]}a.default=e,n&&n.set(e,a);return a}(n(26754)),i=n(81152),s=n(16016),l=n(26932),u=n(44145),c=a(n(35802)),d=n(13077),f=a(n(14264)),p=a(n(4855)),h=a(n(138)),g=a(n(14762));function m(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(m=function(e){return e?n:t})(e)}function _(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function v(e){for(var t=1;te.text?e.botId?(0,u.getBotById)(e.botId):e.agentId?(0,u.getAgentById)(e.agentId):null:null;const b=(e,t)=>{e.isBot?l.botsDispatchers.addBot({avatarUrl:e.avatarUrl,id:e.id,name:e.name,title:e.title,isBot:!0}):l.agentsDispatchers.addAgent(e),t&&E(e)};t.addProactiveAgent=b;const E=e=>{e.isBot?l.chatsDispatchers.setJoinedBots([e.id]):l.chatsDispatchers.addJoinedAgent(e.id)};t.addProactiveAgentToChat=E;t.getCurrentProactiveData=(e,t,n,a,o,l)=>{const u=(0,r.agentToReduxFormat)(l);return b(u,!1),g.default.updateAgentList([l]),{text:e,name:t,createdTs:(new Date).getTime(),privateId:(0,s.generateGUID)(),status:i.MessageStatus.EMPTY,agentId:u.isBot?null:u.id,botId:u.isBot?u.id:null,isMarkdown:!!n,prechats:a,campaignId:o}};t.sendUpdateProactive=e=>{const t=(0,u.getClient)().sessionId;if(!t)return void y.log("updateProactive no session.");const n={name:"update_client",jv_sess_id:t};e&&(n.proactive_rule={invitation_text:e.text,private_id:e.privateId,created_ts:Math.floor(e.createdTs/1e3)},e.isMarkdown&&(n.proactive_rule.is_markdown=!0),e.agentId&&(n.proactive_rule.agent_id=e.agentId),e.botId&&(n.proactive_rule.bot_id=e.botId));const a=JSON.stringify(n);if((0,d.getRuleLocal)("lastUpdateProactiveEvent")!=a&&((0,d.setRuleLocal)("lastUpdateProactiveEvent",a),y.log("sendUpdateProactive",n),n.proactive_rule)){const e=c.default.getInstance();if(e){const t=e.managers.connection;t&&t.isOpen()&&t.send(n)}}};t.saveLastProactive=()=>{const e=f.default.getLastProactive();if(e){var t;const n=e.toJSON(),a=n.body.is_markdown,o=null===(t=n.body)||void 0===t?void 0:t.agent_info,i=o||r.default;n.body=v(v({},o?null:i),{},{agent_info:i,is_markdown:a||null}),e.destroy(),l.messagesDispatchers.addMessage(n)}};t.readProactive=()=>{const e=(0,u.getProactive)();e.text&&e.status!==i.MessageStatus.READ&&l.proactiveDispatchers.setStatus(i.MessageStatus.READ)};t.rejectProactive=()=>{const e=(0,u.getProactive)(),t=e.campaignId,n=e.name;n&&(t?h.default.trackCampaignRejected(n):h.default.trackProactiveInvitationRejected(n))};t.acceptProactive=()=>{const e=(0,u.getProactive)(),t=e.campaignId,n=e.name;n&&(t?h.default.trackCampaignAccepted(n):h.default.trackProactiveInvitationAccepted(n))}},92443:function(e,t,n){"use strict";var a=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=a(n(26754)),r=a(n(14264)),i=a(n(91275)),s=a(n(19955)),l=a(n(138)),u=n(21476),c=n(47060),d=n(65465),f=n(54415),p=n(83170),h=n(81152),g=n(26932),m=n(20361),_=n(44145),v=n(47138),y=n(44733),b=n(13077),E=a(n(4855)),T=n(55329),C=n(69882),O=n(60718),S=n(62162);const w=E.default.name("ruleActions"),A=()=>{(0,_.getApp)().isOnline&&d.messageActions.deleteUnansweredOfflineSystemInvite(),u.Router.getCurrentRoute()!==c.Route.LABEL||s.default.mobileOrTablet()||(u.Router.next(c.RouterEvent.ToChat),g.transitionDispatchers.startTransition(m.ScriptName.OPEN_WIDGET),(0,S.readProactive)())},I=e=>{y.StorageProvider.set("hide_reported",e)};var M={proactive:e=>{let t=e.message,n=e.agentInfo,a=e.name,r=e.isMarkdown,i=e.prechats,s=e.campaignId;Object.assign(o.default,n);const l=(0,S.getCurrentProactiveData)(t,a,r,i,s,n);g.proactiveDispatchers.addProactive(l);const u={is_markdown:r,unsave:!0,prechats:i||null,agent_info:n};s&&(u.campaign_id=s);const c={from:h.MessageInitiator.AGENT,from_id:n.agent_id,status:h.MessageStatus.READ,private_id:l.privateId,text:l.text,created_ts:l.createdTs,type:h.MessageType.PROACTIVE,body:u};n.bot_id&&(c.from_id=n.bot_id,c.from=h.MessageType.BOT),g.messagesDispatchers.addMessage(c),g.userDispatchers.setCallHeaderText(null),A(),(0,S.sendUpdateProactive)(l),(0,T.updatePrechatTime)(l.createdTs),I(!1),s&&f.Monitoring.reportStats(O.StatType.SHOWN,s);const d=s?"campaign"+s:(0,b.isDefaultProactive)()?"default":"custom";f.Monitoring.telemetry(p.TelemetryName.CHAT_INVITE,{param1:d,param2:(0,b.timeDiff)((0,b.getRuleLocal)("pageEnterTime")),param3:(0,C.isCustomLabel)()?"customlabel":"label"})},showCallForm:(e,t)=>{i.default.requestCWAvailable((()=>{if(w.log("requestCWAvailable: ",(0,_.getCallback)().available),f.Monitoring.telemetry(p.TelemetryName.CWP_SHOW_ON_PROACTIVE),!s.default.mobileOrTablet()&&[v.CallPopupStatus.ENABLED,v.CallPopupStatus.ONLY_TRIGGERS].includes((0,_.getCallback)().separateForm))return g.userDispatchers.setCallHeaderText(e),u.Router.next(c.RouterEvent.ToCallPopup),"function"==typeof t&&t(),void I(!1);(0,_.getCallback)().available&&(0,_.getApp)().route==c.Route.LABEL&&(g.userDispatchers.setCallHeaderText(e),!s.default.mobileOrTablet()&&u.Router.next(c.RouterEvent.ToCall),g.transitionDispatchers.startTransition(m.ScriptName.OPEN_WIDGET),"function"==typeof t&&t(),I(!1))}))},systemMessage:e=>{if(o.default.bot_id)return;const t=r.default.getLastMessage();t&&t.get("type")===h.MessageType.SYSTEM&&t.get("text")===e&&t.destroy();const n={type:h.MessageType.SYSTEM,text:e};(0,_.getApp)().chatStarted||(n.body={unsave:!0}),g.messagesDispatchers.addMessage(n),A(),I(!1)},systemMessageEmail:e=>{g.messagesDispatchers.addMessage({type:"email",text:e,body:{unsave:!0}}),A(),l.default.trackSystemMessageEmailShown(),I(!1)},openOffline:()=>{d.messageActions.offlineSystemInvite(!0),A(),I(!1),f.Monitoring.telemetry(p.TelemetryName.OFFLINE_INVITE)},showPopup:e=>{w.log("ruleActions: showCampaignPopup",e),g.campaignPopupDispatchers.updateCampaignPopup(e),g.campaignPopupDispatchers.setDisplay(!0),f.Monitoring.reportStats(O.StatType.SHOWN,e.campaignId)}};t.default=M},64123:function(e,t,n){"use strict";var a=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.setCallbackStatus=t.getStarupTime=t.enableRecaptchaAntispam=t.enableMaintenance=void 0;var o=n(26932),r=a(n(4855)),i=n(65465),s=n(13077),l=a(n(84726)),u=a(n(5735));const c=r.default.name("Action utils","color: grey;");t.enableMaintenance=()=>{c.log("Maintenance mode is on"),o.appDispatchers.setMaintenance(!0),o.callbackDispatchers.setCallbackAvailable(!1),i.messageActions.addMaintenanceMessage()};t.setCallbackStatus=e=>{c.log("setCallbackStatus",e),o.callbackDispatchers.setCallbackStatus(!!e&&e.status)};t.getStarupTime=()=>(((new Date).getTime()-(0,s.getRuleLocal)("sendStartupTime")||0)/1e3).toFixed(1);t.enableRecaptchaAntispam=()=>{c.log("Enable antispam"),o.callbackDispatchers.setCallbackAvailable(!1),i.messageActions.systemMessageOnce((0,l.default)("maintenanceSystemText"),"text",!1),o.appDispatchers.setIsInputDisabled(!0),u.default.allRulesCancel()}},138:function(e,t,n){"use strict";var a=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=a(n(61125)),r=n(68403),i=n(69882),s=a(n(4855)),l=n(55004);function u(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}const c=s.default.name("analytics"),d={counters:{ya:0,fb:0,ga:0},_yaCounter:[],_trackedEvents:[],getCountersTelemetry:function(){return{param2:this.counters.ya,param3:this.counters.fb,param4:this.counters.ga}},getAnalyticsClientId:function(){const e=(0,i.getPageWindow)(),t={};return"function"==typeof e.ga&&("function"==typeof e.ga.getAll&&e.ga.getAll().forEach((e=>{t.ga||(t.ga=e.get("clientId"))})),this.counters.ga=1),!t.ga&&e.gaGlobal&&(t.ga=e.gaGlobal.vid,this.counters.ga=1),this._yaCounter.forEach((n=>{e[n]&&"function"==typeof e[n].getClientID&&(t.ym||(t.ym=e[n].getClientID()))})),t},isAnalyticsIdAvaiable:function(){if(!this.isEnabled())return!1;const e=this.getAnalyticsClientId();return c.log("Counters userId",e),!(!(0,r.isPaidCustomer)()||!e.ga&&!e.ym)&&e},init:function(){if(this.isEnabled()){this._yaCounter=[];try{const e=(0,i.getPageWindow)();for(const t in e)0===t.indexOf("yaCounter")&&"function"==typeof e[t].reachGoal&&(this._yaCounter.push(t),this.counters.ya=1);!this.counters.ya&&e.Ya&&e.Ya._metrika&&e.Ya._metrika.getCounters&&e.Ya._metrika.getCounters().forEach((t=>{const n=e["yaCounter"+t.id];n&&this._yaCounter.push(n)})),c.log("Active Yandex counters: ",this._yaCounter.length)}catch(e){c.log(e.toString())}}},isEnabled:function(){if(!(0,r.isAnalyticsDisabled)()&&(0,r.isPaidCustomer)())return!0},_trackEvent:function(e,t){if(!this.isEnabled())return;if(this._trackedEvents.indexOf(e)>=0)return;this.counters.ga&&this.counters.ya||this.init(),this._trackedEvents.push(e),c.info("_trackEvent: "+e+"/"+t);const n=(0,i.getPageWindow)();void 0!==n._gaq&&"function"==typeof n._gaq.push&&n._gaq.push(["_trackEvent","JivoSite",e,t,void 0,!0]),"function"==typeof n.ga&&"function"==typeof n.ga.getAll&&(n.ga.getAll().forEach((function(n){const a=n.get("name");c.log("track ga:",n.get("name"),e,t),a&&0!==a.search(/^gtag_/i)&&n.send("event","JivoSite",e,t,{nonInteraction:1})})),this.counters.ga=1);const a="function"==typeof n.gtag,r={event_category:"JivoSite",event_action:e,event_label:t};if(a&&(c.log("track gtag:",r),n.gtag("event","JivoSite",r),this.counters.ga=1),!a&&n.dataLayer&&"function"==typeof n.dataLayer.push&&(c.log("track dataLayer:",r),n.dataLayer.push(function(e){for(var t=1;t0&&a[1]&&"function"==typeof a[1].send&&(a[1].send("event","JivoSite",e,t,{nonInteraction:1}),c.log("Track event to custom tiu client counter",a[1].get("trackingId"),e,t)),this.counters.ga=1}if(this._yaCounter.length>0){e=["Jivo"].concat(e.split(" ")).join("_");var s=(0,i.getPageWindow)();this._yaCounter.forEach((function(t){s&&s[t]&&"function"==typeof s[t].reachGoal&&s[t].reachGoal(e)})),this.counters.ya=1}this.trackFBEvents(e)},_setCustomVar:function(e,t){c.log("_setCustomVar: "+e+"/"+t);const n=(0,i.getPageWindow)();if(void 0!==n._gaq&&n._gaq.push(["_setCustomVar",1,e,t,1]),"function"==typeof n.ga&&n.ga("set",e,t),this._yaCounter.length>0){const a={};a[e]=t,this._yaCounter.forEach((function(e){n[e].params(a)}))}},trackFBEvents:function(e){const t=(0,i.getPageWindow)().fbq;t&&!(0,r.isJivoSite)()&&(e=e.replace(/ /gi,"_").replace("Jivo_",""),c.log("trackFBEvents",e),(0,l.isFunction)(t)&&(t("trackCustom","Jivo",{content_name:e}),this.counters.fb=1))},trackChatOpenedByClick:function(){this._trackEvent("Chat requested","User clicked chat widget")},trackOfflineFormOpenedByClick:function(){this._trackEvent("Offline form shown","User offline form")},trackOfflineMessageSent:function(){this._trackEvent("Offline message sent","User sent message via offline form")},trackProactiveInvitationShown:function(e){this._trackEvent("Proactive invitation shown",e)},trackProactiveInvitationAccepted:function(e){this._trackEvent("Proactive invitation accepted",e)},trackProactiveInvitationRejected:function(e){this._trackEvent("Proactive invitation rejected",e)},trackCampaignShown:function(e){this._trackEvent("Campaign shown",e)},trackCampaignAccepted:function(e){this._trackEvent("Campaign invitation accepted",e)},trackCampaignRejected:function(e){this._trackEvent("Campaign invitaion rejected",e)},trackChatConnected:function(){this._trackEvent("Chat established","User connected to agent")},trackGaveContacts:function(){const e="User gave contacts during chat";this._trackEvent(e,e)},trackCallWidgetInvitationShown:function(e){this._trackEvent("Callback invitation shown",e)},trackCallWidgetRequested:function(){this._trackEvent("Callback requested","User request callback.")},setABTestGroupContacts:function(e,t){this._setCustomVar(e,t)},trackSystemMessageEmailShown:function(){const e="In-chat email form shown";this._trackEvent(e,e)},trackSystemMessageEmailSubmitted:function(){const e="In-chat email form submitted";this._trackEvent(e,e)},trackContinueInSocial:function(e){this._trackEvent("Continue in social",`User clicked ${e} button`)},trackMobileSocial:function(e){const t=this.getSocialName(e);this._trackEvent(`Jivo_${t}`,`User tap ${t} mobile link`)},trackSocial:function(e){const t=this.getSocialName(e);this._trackEvent(`Jivo_${t}`,`User click ${t} label link`)},trackClientInitChat:function(){this._trackEvent("Client initiate chat","Client initiate chat")},trackClientAnswerAgentChatRequest:function(){const e="Client answer on agent request";this._trackEvent(e,e)},trackMobileCallClick:function(){this._trackEvent("Mobile call","Mobile call")},trackCallClick:function(){this._trackEvent("Callback button","User requested callback form")},trackPrechatClick:function(e){this._trackEvent("Prechat phrase clicked",e)},trackBotButtonClick:function(e){this._trackEvent("Client press bot button",e)},getSocialName(e){switch(e){case"vk":return"Vkontakte";case"fb":return"Facebook";case"ig":return"Instagram";case"wa":return"WhatsApp";case"tg":return"Telegram";case"vb":return"Viber";default:return e}}};var f=d;t.default=f},42908:function(e,t,n){"use strict";var a=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.api=void 0;var o=a(n(1039)),r=a(n(95003)),i=n(92560),s=a(n(27104)),l=a(n(19955)),u=a(n(5735)),c=a(n(138)),d=a(n(3415)),f=a(n(91275)),p=n(21476),h=n(47060),g=n(65465),m=a(n(86961)),_=n(54415),v=n(83170),y=a(n(14264)),b=a(n(98960)),E=a(n(79868)),T=n(78692),C=n(31984),O=n(26932),S=n(20361),w=n(13077),A=a(n(73687)),I=a(n(35802)),M=n(15787),P=n(62096),R=n(87692),k=n(41504),N=n(84727),D=n(69882),x=n(97615),L=n(44145),j=n(46322),B=n(55004),F=n(21733),U=n(31802);const W=a(n(4855)).default.name("api","color: grey"),H={result:"fail",error:"Need paid account."},G={open:function(e){const t=(0,L.getApp)();if(_.Monitoring.telemetryWithProbability(v.TelemetryName.API_OPEN,{param1:e},v.RateLimit.High),A.default.get("is_blacklisted"))return{result:"fail"};const n=(0,D.getPageWindow)();n.jivo_cstm_widget&&l.default.mobileOrTablet()&&(n.jivo_cstm_widget.style.display="block");const a="object"==typeof e;return a&&"call"===e.start?o.default.callback_settings.time?(t.route===h.Route.CALL||(u.default.allRulesCancel(),f.default.pingAndOpenCall()),{result:"ok"}):(W.info("Callback is disabled."),{result:"fail",reason:"Callback is disabled"}):t.route===h.Route.CHAT?{result:"ok",opened:!0}:(O.appDispatchers.setAppIsFocused(!0),a&&"menu"===e.start?l.default.mobile()&&E.default.getJoints().count>0?(O.appDispatchers.setChatOpenByClient(!1),p.Router.next(h.RouterEvent.ToMobileMenu)):(O.transitionDispatchers.startTransition(S.ScriptName.OPEN_WIDGET),p.Router.next(h.RouterEvent.ApiOpen)):(l.default.desktop()&&O.transitionDispatchers.startTransition(S.ScriptName.OPEN_WIDGET),p.Router.next(h.RouterEvent.ApiOpen)),g.messageActions.offlineSystemInvite(),g.messageActions.addPrechatMessage(),n.jivo_cstm_widget&&l.default.mobileOrTablet()&&((0,L.getApp)().isOnline?c.default.trackChatOpenedByClick():c.default.trackOfflineFormOpenedByClick()),{result:"ok"})},close:function(){if(_.Monitoring.telemetryWithProbability(v.TelemetryName.API_CLOSE,{},v.RateLimit.High),A.default.get("is_blacklisted"))return{result:"fail"};if([h.Route.LABEL,h.Route.CHAT_MIN].indexOf((0,L.getApp)().route)>=0)return{result:"ok",closed:!0};if((0,U.closeWidget)(),l.default.mobileOrTablet())p.Router.next(h.RouterEvent.CloseWindow);else{const e=(0,L.getApp)().chatAccepted?S.ScriptName.MINIMIZE_WIDGET:S.ScriptName.CLOSE_WIDGET;O.transitionDispatchers.startTransition(e)}return{result:"ok"}},getContactInfo:function(){if(!x.EnvironmentManager.isJsApiAvaiable())return H;_.Monitoring.telemetryWithProbability(v.TelemetryName.API_GET_CONTACT_INFO,{},v.RateLimit.Low);const e=(0,L.getClient)();return{client_name:e.name,email:e.email,phone:e.phone,description:e.description}},getVisitorNumber:function(e){if(!x.EnvironmentManager.isJsApiAvaiable())return H;W.log("getVisitorNumber",e);const t=(0,L.getClient)().clientId;if(t&&t.indexOf(".")>0&&(0,B.isFunction)(e))return e(null,t.split(".")[0]);(0,B.isFunction)(e)?(_.Monitoring.telemetryWithProbability(v.TelemetryName.API_GET_VISITOR_NUMBER,{},v.RateLimit.Low),m.default.getVisitorNumber(((n,a)=>{if(W.log(n,a),n)W.log("Error fetch visitor number.");else if((0,j.isObject)(a.data)&&a.data.client_id&&a.data.result){const n=a.data.client_id;t||O.clientDispatchers.updateClient({clientId:n}),(0,B.isFunction)(e)&&(0,F.isString)(n)&&e(null,n.split(".")[0])}else W.error("Error fetching visitor number")}))):W.error("Please provide callback function in jivo_api.getVisitorNumber(callback)")},setUserToken:function(e){if(!x.EnvironmentManager.isJsApiAvaiable())return H;if(_.Monitoring.telemetryWithProbability(v.TelemetryName.API_SET_USER_TOKEN,{},v.RateLimit.High),"string"==typeof e||e instanceof String){let t;if(e==(0,L.getClient)().userToken)t={result:"fail",error:`Cant set same token: ${e}`};else{O.clientDispatchers.setUserToken(e);const n=I.default.getInstance();if(n){const t=n.managers.connection;t&&t.isOpen()?(t.send(new k.UpdateUserToken(e)),W.log(`Token updated, token: ${e}`)):W.log("Token set, but was not sent to the server")}t={result:"ok",token:e||!1}}return!o.default.enable_api_invitation&&x.EnvironmentManager.isProduction()||(0,L.getApp)().chatStarted||T.ApiInvitationsManager.initialize(e),t}return W.error("Bad token. The token must be type of string"),{result:"fail",token:e||!1}},setCustomData:function(e){if(!x.EnvironmentManager.isJsApiAvaiable())return H;_.Monitoring.telemetryWithProbability(v.TelemetryName.API_SET_CUSTOM_DATA,{},v.RateLimit.Low);const t=P.reduxStore.getState(),n=(0,R.selectApiDomain)(t),a=(0,N.validateCustomData)(e,n);return Array.isArray(a)?((0,M.checkCustomData)(a),{result:"ok"}):(W.error("Invalid custom data.",a),{result:"fail",reason:a})},sendMessage:function(e){if(!x.EnvironmentManager.isJsApiAvaiable())return H;if("string"!=typeof e||"[object Object]"===Object.prototype.toString.call(e))return{result:"fail",error:"First argument must be text to send message."};const t=y.default.getClientMessages();return t.length&&e==t[t.length-1].get("text")?{result:"fail",error:"You cannot send 2 messages in a row"}:(g.messageActions.sendClientMessage(e),_.Monitoring.telemetryOnce(v.TelemetryName.API_SEND_MESSAGE),{result:"ok"})},setContactInfo:function(e){if(!x.EnvironmentManager.isJsApiAvaiable())return H;if(_.Monitoring.telemetryWithProbability(v.TelemetryName.API_SET_CONTACT_INFO,{},v.RateLimit.Low),e&&"object"==typeof e){W.log("setContactInfo",e);const t={};let n=!1,a="";for(const o in e)if({}.hasOwnProperty.call(e,o)){const r=e[o];let i=o;"name"==i&&(i="client_name"),r&&b.default[i]&&b.default[i](r)?(t[o]=r,n=!0):(W.error(i+" not valid."),a+=i+" not valid.")}if(n){return(0,M.sendApiIntroduce)(t)?{result:"ok",data:t}:{result:"false",data:t,error:"Cant send same client contacts twice."}}return _.Monitoring.telemetryWithProbability(v.TelemetryName.API_SET_CONTACT_INFO_BAD_DATA,{},v.RateLimit.High),W.error("setContactInfo bad data",e),{result:"fail",error:a}}},showProactiveInvitation:function(e,t,n){const a=(0,L.getClient)();(0,w.isYandexMarketClient)(a.utm)?W.log("Disabled for YM clients"):x.EnvironmentManager.isJsApiAvaiable()?(_.Monitoring.telemetryOnce(v.TelemetryName.API_SHOW_PROACTIVE),u.default.showProactive(e,+t,"jivo_api.showProactiveInvitation",n)):W.log("Proactive disabled for free users.")},highlightCobrowse:function(e,t,n){if(!e)return!1;d.default.getCobrowseData(e,t,n)},sendOfflineMessage:function(e){if(!x.EnvironmentManager.isJsApiAvaiable())return H;if(_.Monitoring.telemetryOnce(v.TelemetryName.API_SEND_OFFLINE_MESSAGE),W.log("sendOfflineMessage",e),(0,L.getApp)().isOnline)return{result:"fail",error:"Error send offline message when chat is online."};if(e&&"object"==typeof e){W.log("sendOfflineMessage",e);let t="";for(const n in e)if({}.hasOwnProperty.call(e,n)){const a=e[n];let o=n;"name"==o&&(o="client_name"),a&&b.default[o]&&b.default[o](a)||(W.error(o+" not valid."),t+=o+" not valid. ")}if(""==t){return(0,M.sendApiIntroduce)(e)?{result:"ok"}:{result:"fail",error:"Cant send same message and contacts twice."}}return W.warn("sendOfflineMessage bad data",e),_.Monitoring.telemetryOnce(v.TelemetryName.API_SEND_OFFLINE_MESSAGE_BAD_DATA),{result:"fail",error:t}}return{result:"fail",error:"Invalid params for offline message"}},setRules:function(e){return x.EnvironmentManager.isJsApiAvaiable()?(_.Monitoring.telemetryOnce(v.TelemetryName.API_SET_RULES),e&&"object"==typeof e?(o.default.rules=e,{result:"ok"}):(W.error("Invalid type of rules, must be object."),{result:"fail"})):H},chatMode:function(){return x.EnvironmentManager.isJsApiAvaiable()?(_.Monitoring.telemetryWithProbability(v.TelemetryName.API_CHAT_MODE,{},v.RateLimit.Low),o.default.chat_mode):H},setWidgetColor:function(e,t){_.Monitoring.telemetryOnce(v.TelemetryName.API_SET_WIDGET_COLOR);const n=s.default.isLightColor(e)?"dark":"light";O.userDispatchers.setWidgetColor(e),O.userDispatchers.setWidgetColor2(t||null),O.userDispatchers.setWidgetFontColor(n)},sendPageTitle:function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return x.EnvironmentManager.isJsApiAvaiable()?e&&"string"==typeof e?(f.default.updateTitle(e,n),t&&_.Monitoring.telemetryOnce(v.TelemetryName.API_SEND_PAGE_TITLE),{result:"ok"}):{result:"fail",reason:"Invalid title"}:H},isCallbackEnabled:function(e){if(!x.EnvironmentManager.isJsApiAvaiable())return H;"function"==typeof e&&(_.Monitoring.telemetryWithProbability(v.TelemetryName.API_IS_CALLBACK_ENABLED,{},v.RateLimit.High),(0,i.isEmpty)(o.default.callback_settings)?e({result:"fail",reason:"Callback disabled"}):f.default.requestApiCWAvailable(e))},startCall:function(e){if(!x.EnvironmentManager.isJsApiAvaiable())return H;const t=(0,L.getCallback)();if(W.log("api startCall",e),!t.available||(0,i.isEmpty)(o.default.callback_settings))return{result:"fail",reason:"Callback disabled"};if(e){const t=(0,C.getPhoneNumberInfo)(e);return t?(e="+"+t.number,p.Router.next(h.RouterEvent.ToCall),f.default.startCall(e,"from_api"),{result:"ok"}):{result:"fail",reason:"Invalid phone"}}return{result:"fail",reason:"Invalid phone"}},getUtm:function(){if(!x.EnvironmentManager.isJsApiAvaiable())return H;_.Monitoring.telemetryWithProbability(v.TelemetryName.API_GET_UTM,{},v.RateLimit.High);const e=(0,L.getClient)().utm;return{term:e.term||e.keyword||null,campaign:e.campaign||null,content:e.content||null,medium:e.medium||null,source:e.source||null}},getUnreadMessagesCount:function(){const e=(0,L.getUnreadMessages)(),t=(0,L.getLastChatId)();return e.filter((e=>e.chat_id===t)).length},clearHistory:()=>{if(!x.EnvironmentManager.isJsApiAvaiable())return H;O.clientDispatchers.resetClient(),r.default.reset(),O.appDispatchers.setDidFreezeData(!0),y.default.destroy(),W.log("Client info deleted, history cleared.")}};t.api=G},3415:function(e,t,n){"use strict";var a=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=a(n(98661)),r=a(n(98661)),i=a(n(84726)),s=n(21951),l=n(9393),u=n(46322),c=n(11413),d=n(43025),f=a(n(19955)),p=a(n(1039)),h=a(n(90842)),g=a(n(93867)),m=n(54415),_=n(83170),v=n(97615),y=a(n(22541)),b=a(n(87736)),E=n(38632),T=a(n(4855)),C=n(95911),O=n(55004),S=n(67597),w=n(69882);const A=T.default.name("cobrowse"),I=window.parent.document,M=function(e,t){const n=window.top;"function"==typeof n.history.replaceState?n.history.replaceState({},t,e):"function"==typeof n.history.pushState&&n.history.pushState({},t,e)},P={init:function(){var e,t,n=!1,a={};h.default.install(window.parent),this._process=t=function(t,o){n?(A.log("controller of childSandboxBridge set as for NodeWebkit"),(e=N).setLangpack(a),e.init(),"in_node_webkit"===t&&window.parent.jivo_cobrowse.source.postMessage({name:"widget_ready"},window.parent.jivo_cobrowse.origin)):e=k,e[t]&&"is_node_webkit"!==t&&e[t](o)},(0,s.addListener)(window.parent,"message",(function(e){if(e&&e.data&&"object"==typeof e.data){var o=e.data;-1!==["startSelection","stopSelection","in_node_webkit"].indexOf(o.name)&&e.source&&e.origin&&(e.source,e.origin,n=!0,o.langpack&&(a=o.langpack),t(o.name,o))}}),!1)},process:function(e,t){this._process||this.init(),this._process(e,t)},create:function(e,t){P.process("highlight",e),P.process("renderTooltip",e),M(t,I.title)},postMessage:function(e){setTimeout((function(){window.parent.jivo_cobrowse.source.postMessage(e,window.parent.jivo_cobrowse.origin)}),0)},isNodeWebkit:function(){return isNodeWebkit},isOldCobrowse:e=>{if(10==e.length)return!0;let t=null;try{t=window.atob(e),(0,w.getPageWindow)().document.querySelector(t)}catch(e){t=!1}return!t},getCobrowseData:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null;if(A.log("getCobrowseData",e,t,n,a),!P.isOldCobrowse(e)){const r=(0,w.getPageWindow)().location.href.replace((0,w.getPageWindow)().location.hash,"");if(t&&t!==r)(0,w.getPageWindow)().document.location.href=`${t}#jvhs_${e}`;else{t=(0,w.getPageWindow)().document.location.href;const r=`${t.split("#")[0]}#jvhs_${e}`;let s=null;try{s=window.atob(e)}catch(t){return A.error(t),void m.Monitoring.telemetry(_.TelemetryName.COBROWSE_FAILED,{param1:e,param2:t})}P.create({comment:n?(0,c.escape)(n):(0,i.default)("lblDefaultCobrowseComment"),element:s,hash:e,page:r,show:!0,agentId:a&&a.agentId,agent:a,cb:o},r)}return}const r=p.default.base_url+`/script/cobrowsing?hash=${e}`;C.xhrRequest.get(r,((n,a)=>{if(n)return(0,O.isFunction)(o)&&o(!1),m.Monitoring.telemetry(_.TelemetryName.COBROWSE_FAILED);const r=a.data;if((0,u.isObject)(r)){if(r.isDeleted)return(0,O.isFunction)(o)&&o(!1),m.Monitoring.telemetry(_.TelemetryName.COBROWSE_FAILED);0===r.comment.length&&(r.comment=(0,i.default)("lblDefaultCobrowseComment")),r.comment=(0,c.escape)(r.comment),y.default.stopBlinking();const n=(0,w.getPageWindow)().document.location.href.split("#")[0],a=t&&t+"#jvhs_"+e;t&&n!==t&&n!==encodeURI(t)?(0,w.getPageWindow)().document.location.href=a:(o&&(r.cb=o),P.create(r,a))}}))}};function R(e){var t=function(e){var t="",n=e.split(" > ");return(0,l.each)(n,(function(e){t+="/*",-1!==e.indexOf(":")&&(t+="["+e.substr(e.indexOf("(")+1,e.indexOf(")")-e.indexOf("(")-1)+"]")})),t}(e),n=I.querySelector(e);return n||I.evaluate(t,I,null,h.default.XPathResultType.FIRST_ORDERED_NODE_TYPE,null).singleNodeValue}var k={is_inited:!1,isCobrowseVisible:function(e){return(0,d.isVisible)(e)&&"HTML"!=e.tagName&&"hidden"!=e.style.visibility&&"jivo-iframe-container"!=e.id&&"jivo_container"!=e.id},highlight:function(e){if(A.log("highlight"),"cobrowser-iframe"===window.parent.name&&!this.is_inited&&!N.is_inited){var t=I.createElement("link");t.setAttribute("rel","stylesheet"),t.setAttribute("href",(0,S.staticUrl)((v.EnvironmentManager.isDevelopment()?"/public":"")+"/css/for_app.css")),I.body.appendChild(t),this.is_inited=!0}var n;if(D(n="string"==typeof e.element?R(e.element):e.element)){if(e.hash&&null!==I.getElementById("#jivo_cobrowsing_element_id_"+e.hash))return this.animateScroll(e);(0,l.each)(["jivo_cobrowsing_element","jivo_cobrowsing_tooltip"],(function(e){(0,l.each)(I.getElementsByClassName(e),(function(e){e.parentNode.removeChild(e)}))}));var a,o=D(n),r=o.width,i=o.height;if(A.log(n,e),!n||!this.isCobrowseVisible(n))return"cobrowser-iframe"!==window.parent.name&&m.Monitoring.telemetry(_.TelemetryName.COBROWSE_FAILED),void(e.cb&&e.cb(!1));A.log("overlayCreate"),d(),A.log("overlayCss"),c(o,r,i),A.log("overlayAppend"),f(),window.parent&&"cobrowser-iframe"!==window.parent.name&&m.Monitoring.telemetry(_.TelemetryName.COBROWSE_SUCCESS,{param1:e.hash?e.hash.length:0});var u=function(){var t;if(t="string"==typeof e.element?R(e.element):e.element,a||(d(),f()),t){var n=D(t);c(n,n.width,n.height)}if(a)return a};return setTimeout((function(){u()}),50),(0,s.addListener)(window.parent,"resize",u),a||void 0}function c(e,t,o){a.style.width=t+"px",a.style.height=o+"px",a.style.left=e.left-8+"px",a.style.top=e.top-8+"px",x(n)&&(a.style.position="fixed")}function d(){a||((a=I.createElement("jdiv")).className="jivo_cobrowsing_element",a.id="jivo_cobrowsing_element_id_"+e.hash,I.body.appendChild(a))}function f(){if(!a){var e=I.createElement("jdiv");a.className="jivo_cobrowsing_element_inner",a.appendChild(e)}}A.log("cobrowse element position failed.")},renderTooltip:function(e){A.log("renderTooltip",e);var t,n=null!==I.getElementById("#jivo_cobrowsing_element_id_"+e.hash);if(!1!==n)return this.animateScroll(e),n;if(!(t="string"==typeof e.element?R(e.element):e.element)||!this.isCobrowseVisible(t))return A.log("Error render tooltip, element not visible"),void(e.cb&&e.cb(!1));var a=I.createElement("jdiv");a.className="",a.id="jivo_content_cobrowsing_tooltip",a.style.width="100%",a.style.height="auto";var o=I.createElement("jdiv");return o.className="jivo_cobrowsing_tooltip",f.default.mobile()&&(o.style.width="200px"),o.id="jivo_cobrowsing_tooltip_"+e.hash,x(t)&&(o.style.position="fixed"),o.appendChild(a),e.show&&(o=this.addTooltipContent(o,e,t),e.cb&&e.cb(!0)),o},appendTooltip:function(e,t){var n=e.childNodes[0];I.body.appendChild(e);var a=function(){if((0,d.addClass)(n,"jivo-bottom"),(0,d.removeClass)(n,"jivo-top jivo-left jivo-right"),t){var a=D(t),o=(0,w.getPageWindow)(),r=a.width,i=a.height,s=a.left+r/2,l=a.top-30+15,u=D(e),c=D(n),p=o.innerWidth||o.outerWidth,h=u.width/2*-1;lp&&(h=0,s=p-u.width):s+u.width>p&&(h=-1*u.width,s=a.left+r-30,n.className+=" jivo-right"),e.style.left=(0!==s?s:35)+"px",e.style.top=l+"px",e.style.marginLeft=h+"px"}};a(),e.style.opacity=0,this.animateScroll(null,t,n),setTimeout((function(){a(),e.style.opacity=1}),300),(0,s.addListener)(window.parent,"resize",a)},addTooltipContent:function(e,t,n){A.log("addTooltipContent",t);const a=e.childNodes[0],i=32&p.default.options&&t.agent,s=I.createElement("jdiv");s.dir="ltr",s.id="jivo_action",s.className="jivo-desktop";const l=window.parent.document.createElement("jdiv");if(l.id="jivo_close_button",l.innerHTML=g.default,s.appendChild(l),a.appendChild(s),l.addEventListener("click",(function(n){n.preventDefault();var a=I.getElementsByClassName("jivo_cobrowsing_element")[0];a.parentNode.removeChild(a),function(e){const t=window.top;t.location.href.indexOf("#jvhs_"+e)>0&&M(t.location.href.replace("#jvhs_"+e,""),(0,w.getCurrentPage)().title)}(t.hash),e.parentNode.removeChild(e)})),i&&t.agent){if(t.agent.avatar_url){const e=I.createElement("jdiv");e.className="jivo_cobrowsing_tooltip_avatar",a.appendChild(e),r.default.render(o.default.createElement(b.default,{dark:!1,inChat:!0,url:(0,S.getAvatarUrl)(p.default.avatar_url,t.agent.avatar_url)}),e)}const e=I.createElement("jdiv");e.innerText=t.agent.display_name,e.className="jivo_cobrowsing_tooltip_agent",a.appendChild(e)}const u=I.createElement("jdiv");return u.innerHTML=t.comment.split("\n").join("
"),u.className="jivo_cobrowsing_tooltip_text",a.appendChild(u),this.appendTooltip(e,n),e},animateScroll:function(e,t,n){if(e&&(t=I.getElementById("#jivo_cobrowsing_element_id_"+e.hash),n=I.getElementById("#jivo_cobrowsing_tooltip_"+e.hash).childNodes[0]),x(t))A.log("Ignore scroll for fixed element");else{var a={top:(n&&(0,d.hasClass)(n,"jivo-top")?D(t).top:D(n.parentNode).top)-300};I.documentElement&&"scrollBehavior"in I.documentElement.style&&(a.behavior="smooth"),A.log("scrollTo",a),window.parent.scrollTo(a)}}},N={is_selecting:!1,is_tooltip_open:!1,is_inited:!1,langpack:{},init:function(){if(!this.is_inited){var e=I.createElement("link");e.setAttribute("rel","stylesheet"),e.setAttribute("href",(0,S.staticUrl)((v.EnvironmentManager.isDevelopment()?"/public":"")+"/css/for_app.css")),I.body.appendChild(e),(0,s.removeEvent)(window.parent,"keydown",this.keydownListener),(0,s.addListener)(window.parent,"keydown",this.keydownListener),this.is_inited=!0}},keydownListener:function(e){27===e.keyCode&&N.onEsc()},setLangpack:function(e){this.langpack=e},i18n:function(e){return this.langpack[e]?this.langpack[e]:e},startSelection:function(){var e=N;(0,d.addClass)(I.body,"jivo_selecting"),e.is_selecting=!0,(0,l.each)(["input","textarea","select","button"],(function(e){(0,l.each)(I.getElementsByTagName(e),(function(e){const t=I.createElement("jdiv"),n=D(e);t.style.width=n.width+"px",t.style.height=n.height+"px",t.style.left=n.left+"px",t.style.top=n.top+"px",t.style.position="absolute",t.realNode=e,e.disabled=!0,I.body.appendChild(t)}))})),(0,l.each)(I.getElementsByTagName("*"),(function(t){(0,s.addListener)(t,"mouseover",e.mouseoverListener),(0,s.addListener)(t,"mouseout",e.clearSelection)}))},stopTagsA:function(){(0,l.each)(I.getElementsByTagName("a"),(function(e){(0,s.addListener)(e,"click",(function(e){return e.preventDefault(),e.stopPropagation(),!1}))}))},mouseoverListener:function(e){var t=N;if("OPTION"===this.tagName)return!1;t.clearSelection(),k.highlight({element:e.target}),t.stopTagsA(),(0,s.removeEvent)(e.currentTarget,"click",t.clickListener),(0,s.addListener)(e.currentTarget,"click",t.clickListener)},clickListener:function(e){var t=N;e.preventDefault(),e.stopPropagation();var n=this.realNode?this.realNode:this;t.stopSelection(),t.toolTip(n)},stopSelection:function(){var e=N;(0,d.removeClass)(I.body,"jivo_selecting"),(0,l.each)(["input","textarea","select","button"],(function(e){(0,l.each)(I.getElementsByTagName(e),(function(e){e.disabled=!1}))})),(0,l.each)(I.getElementsByClassName("fake_cb_element"),(function(e){e.parentNode.removeChild(e)})),(0,l.each)(I.getElementsByTagName("*"),(function(t){(0,s.removeEvent)(t,"mouseover",e.mouseoverListener),(0,s.removeEvent)(t,"mouseout",e.clearSelection),(0,s.removeEvent)(t,"click",e.clickListener)})),e.is_selecting=!1},clearSelection:function(){(0,l.each)(["jivo_cobrowsing_element","jivo_cobrowsing_tooltip"],(function(e){(0,l.each)(I.getElementsByClassName(e),(function(e){e.parentNode.removeChild(e)}))}))},toolTip:function(e){var t=N,n=k.renderTooltip({element:e}),a=n.childNodes[0];n.className+=" air",n.style.width="auto",a.style.padding="8px",a.style.width="auto",a.style.backgroundColor="";var o=I.createElement("textarea");o.id="cobrowsing_textarea_comment",o.maxLength=200,o.placeholder=t.i18n("cb_enterComment"),o.value="",o.onkeypress=function(n){13===n.keyCode&&(n.preventDefault(),n.stopPropagation(),t.send(e))},t.textInput=o;var r=I.createElement("button");r.className="btn btn-mimi blue on_dark large",r.innerText=t.i18n("cb_send"),r.style.float="right",r.style.position="relative",r.style.marginRight="8px",r.onclick=function(){t.send(e)};var i=I.createElement("button");i.className="btn btn-mimi grey on_dark large",i.innerText=t.i18n("cb_cancel"),i.style.float="right",i.style.position="relative",i.style.marginRight="5px",i.onclick=function(){t.closeTooltip()};var s=I.createElement("jdiv");s.style.clear="both",a.appendChild(o),a.appendChild(i),a.appendChild(r),a.appendChild(s),k.appendTooltip(n,e),o.focus(),t.is_tooltip_open=!0},send:function(e){var t=this.textInput.value;t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");var n={name:"on_send",page_element:function(e){for(var t=[];e.parentNode;){if(e.id){t.unshift("#"+e.id);break}if(e==e.ownerDocument.documentElement)t.unshift(e.tagName);else{for(var n=1,a=e;a.previousElementSibling;a=a.previousElementSibling,n++);t.unshift(e.tagName+":nth-child("+n+")")}e=e.parentNode}return t.join(" > ")}(e),page_url:window.parent.location.href,comment:t};A.log("postMessage",n),P.postMessage(n),f.default.supportsLocalStorage()&&E.parentLS.remove(`jv_${p.default.widget_id}_tmp_app`)},closeTooltip:function(){var e=N;e.stopSelection(),e.is_tooltip_open=!1,e.startSelection(),P.postMessage({name:"on_cancel"})},onEsc:function(){this.is_tooltip_open?this.closeTooltip():this.is_selecting?(this.stopSelection(),P.postMessage({name:"reset"})):P.postMessage({name:"close"})}};function D(e){var t,n,a=0,o=0,r=0,i=0,s={top:0,left:0},l=I,u=l.body;return t=l.documentElement,e&&void 0!==e.getBoundingClientRect?(s=e.getBoundingClientRect(),e&&!x(e)&&(n=(0,w.getPageWindow)(),a=t.clientTop||u.clientTop||0,o=t.clientLeft||u.clientLeft||0,r=n.pageYOffset||t.scrollTop,i=n.pageXOffset||t.scrollLeft),{top:s.top+r-a,left:s.left+i-o,right:s.right,width:e.offsetWidth,height:e.offsetHeight,windowWidth:u.innerWidth,windowHeight:u.innerHeight}):(m.Monitoring.telemetry(_.TelemetryName.COBROWSE_FAILED),!1)}function x(e){var t=!1;if(e)for(var n=e,a=[];n&&"HTML"!==n.tagName;){if(a.unshift(n),window.parent.window.Polymer&&!window.parent.jivo_cobrowse&&n.treeScope_){var o=n[Object.keys(n)[0]];"fixed"===getComputedStyle(o).position&&(t=!0)}else"fixed"===getComputedStyle(n).position&&(t=!0);n=n.parentNode}return t}var L=P;t.default=L},1039:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.getCometHost=function(){return d.chat_host},t.getConfig=function(){return d},t.getViHost=function(){return d.vi_host},t.initConfig=h,t.setConfigParam=void 0;var a,o=n(4425),r=n(94537),i=n(52028),s=n(97615),l=n(68403),u=n(69882),c=window.parent||window,d=c.jivo_config;if(d||(d={}),s.EnvironmentManager.isSelfhosted()){const e=window.parent||window;n.p=`${e.location.protocol}${d.base_url}/`}else n.p="https:"+d.base_url+"/";switch(d.chat_mode){case o.ChatMode.ONLINE:case 1:d.chat_mode=o.ChatMode.ONLINE;break;case o.ChatMode.OFFLINE:case 0:d.chat_mode=o.ChatMode.OFFLINE}d.bots&&d.enable_bot_offline&&(d.chat_mode=o.ChatMode.ONLINE),d.callback_settings||(d.callback_settings={});const f=d.contacts_settings;f&&d.contacts_ask===r.ContactsType.BEFORE_CHAT&&(f.phone.show||f.email.show||f.name.show||(d.contacts_settings.email.show=!0)),f||(d.contacts_settings={name:{show:!1,required:!1},email:{show:!0,required:!0},phone:{show:!1,required:!1}});const p=d.chat_mode==o.ChatMode.ONLINE;function h(e){window.parent.jivo_config=d=e}p&&d.contacts_ask===r.ContactsType.DISABLED&&!(0,l.isEmailOrPhoneRequired)(d.contacts_settings)&&(d.contacts_settings.email={show:!0,required:!0}),p||(0,l.isEmailOrPhoneRequired)(d.contacts_settings)||(d.contacts_settings=(0,l.fixOfflineSettings)(d.contacts_settings)),d.widget_color2||"#383345"!=d.widget_color||(d.widget_color="#2F324A",d.widget_color2="#424867",d.power_gradient=1),d.bubble_color||(d.bubble_color="green"),"[object Object]"===Object.prototype.toString.call(c.wix_context)&&"[object Object]"===Object.prototype.toString.call(c.jivo_wix)&&Object.assign(d,c.jivo_wix),c.jivo_in_wix_iframe&&(d.widget_orientation="bottom"),i.isDesignerEditor&&Object.assign(d,c._desingerConfig),d.joint&&"RU"==(null===(a=d.geoip)||void 0===a?void 0:a.split(";")[0])&&(delete d.joint.ig,delete d.joint.fb),d.disable_botmode&&(d.botmode=null),(0,u.isChatPage)()&&(d.enable_campaigns=0);t.setConfigParam=(e,t)=>{const n=d;n[e]=t,h(n)};var g=d;t.default=g},99040:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ACTIVE_TEST=void 0;n(53049);t.ACTIVE_TEST=!1},52274:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PROACTIVE_TEXT_LIMIT=t.PROACTIVE_MAX_HEIGHT=t.MP_LINE_HEIGHT=t.MP_AGENT_HEIGHT=t.MINIMAL_WIDGET_HEIGHT=t.MAX_IMAGE_WIDTH=t.MAX_FILE_SIZE=t.MAX_ALLOWED_USER_ZOOM=t.MAINT_RECONNECT_TIMEOUT=t.LABEL_HEIGHT=t.INPUT_HEIGHT=t.HEADER_HEIGHT=t.DEFAULT_WIDGET_HEIGHT=t.CHAT_WIDTH=t.CAMPAIGN_TEXT_HEIGHT=t.CACHE_KEY=t.AWAY_CLIENT_TIMEOUT=t.APP_INVITE_TIME=t.API_INVITES_CACHE_TIME=void 0;t.AWAY_CLIENT_TIMEOUT=144e5;t.APP_INVITE_TIME=8e3;t.PROACTIVE_TEXT_LIMIT=50;t.PROACTIVE_MAX_HEIGHT=74;t.CAMPAIGN_TEXT_HEIGHT=90;t.MP_LINE_HEIGHT=19;t.MP_AGENT_HEIGHT=28;t.API_INVITES_CACHE_TIME=18e5;t.CACHE_KEY="api_invites";t.HEADER_HEIGHT=70;t.INPUT_HEIGHT=106;t.MAINT_RECONNECT_TIMEOUT=3e5;t.MAX_FILE_SIZE=10485760;t.MINIMAL_WIDGET_HEIGHT=402;t.CHAT_WIDTH=336;t.LABEL_HEIGHT=40;t.DEFAULT_WIDGET_HEIGHT=496;t.MAX_IMAGE_WIDTH=234;t.MAX_ALLOWED_USER_ZOOM=1.03},85948:function(e,t,n){"use strict";var a=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.addSyncExclude=void 0;var o=a(n(61125)),r=a(n(19955)),i=n(43025),s=n(44733),l=n(9393),u=n(90991),c=a(n(4855));function d(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function f(e){for(var t=1;t{g.push(e),m.push(e)};var v=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if("JivoStore"==e.__type)return e;var n=JSON.stringify(e),a=r.default.supportsLocalStorage(),o=new p,c=(0,u.debounce)((()=>{o.emit("update",e)}),10),d=()=>{if(a){const n=(t=>{let n=f({},t);return t?_(n,e):n=e,n})(s.StorageProvider.get(t));s.StorageProvider.set(t,n)}},v=(e,n)=>{var a=e[n];Object.defineProperty(e,n,{set:e=>{if(a!=e&&(a=e,c(),t)){if(!(0,i.pageVisible)()&&g.indexOf(n)>-1)return;if(m.indexOf(n)>-1)return;if(window.parent&&"cobrowser-iframe"===window.parent.name)return;d()}},get:()=>a})},y=e=>{(0,l.each)(e,((t,n)=>{"function"!=typeof t&&(t&&"object"==typeof t&&"number"!=typeof t.length?y(t):v(e,n))}))},b=()=>{if(t)try{const n=s.StorageProvider.get(t);_(e,n)}catch(e){h.error(e)}},E=()=>{e=JSON.parse(n),y(e),d(),c()};return y(e),b(),Object.defineProperty(e,"__type",{enumerable:!1,configurable:!1,writable:!1,value:"JivoStore"}),Object.defineProperty(e,"addListener",{enumerable:!1,configurable:!1,writable:!1,value:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"update",t=arguments.length>1?arguments[1]:void 0;return"function"==typeof e&&(t=e,e="update"),o.addListener(e,t)}}),Object.defineProperty(e,"dispatch",{enumerable:!1,configurable:!1,writable:!1,value:()=>{c()}}),Object.defineProperty(e,"reload",{enumerable:!1,configurable:!1,writable:!1,value:()=>{b()}}),Object.defineProperty(e,"reset",{enumerable:!1,configurable:!1,writable:!1,value:()=>{E()}}),e};t.default=v},33180:function(e,t,n){"use strict";var a=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.cssLoader=void 0;var o=a(n(1039)),r=a(n(48553));window.parent.__jivoBundleInit&&window.parent.__jivoBundleInit(window);const i=(()=>{let e=window.parent.location.protocol;return-1===["http","https","http:","https:"].indexOf(e)&&(e="https:"),e})()+o.default.base_url+"/css/3eaff2a/widget.css",s=new r.default(window.parent.document,i);t.cssLoader=s},83778:function(e,t,n){"use strict";var a=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.detectType=t.default=t.chatServerHost=void 0;var o=a(n(1039)),r=n(69882),i=n(67597),s=n(68403),l=n(97615);a(n(4855)).default.name("utils","color: grey");const u=()=>l.EnvironmentManager.isSelfhosted()?`${(0,r.getProtocol)()}//${o.default.chat_host}`:"https://"+o.default.chat_host;t.chatServerHost=u;const c=e=>e.indexOf("image")>=0&&-1==e.indexOf("photoshop")&&-1==e.indexOf("svg")?"photo":e.indexOf("video")>=0?"video":e.indexOf("audio")>=0?"audio":"document";t.detectType=c;var d={detectType:c,isAppCobrowse:r.isAppCobrowse,isCustomLabel:r.isCustomLabel,getProtocol:r.getProtocol,chatServerHost:u,staticUrl:i.staticUrl,getUtmLink:i.getUtmLink,getUnicodeHref:r.getUnicodeHref,getCurrentPage:r.getCurrentPage,isWixEditor:r.isWixEditor,showAd:s.showAd,getPageWindow:r.getPageWindow,getHostURL:i.getHostURL,getChatPageToken:r.getChatPageToken};t.default=d},87869:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useClickListener=function(e,t){(0,a.useEffect)((()=>{if((0,o.isFunction)(t)&&e.current){const n=n=>{e.current&&(n.preventDefault(),t(n))},a=e.current;return a.addEventListener("mousedown",n),a.addEventListener("touchstart",n),()=>{a.removeEventListener("mousedown",n),a.removeEventListener("touchstart",n)}}}),[e,t])};var a=n(98661),o=n(55004)},57985:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useClickOutside=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:window.parent.document;(0,a.useEffect)((()=>{if((0,o.isFunction)(t)){const a=n=>{e.current&&!e.current.contains(n.target)&&t(n)};return n.addEventListener("mousedown",a),n.addEventListener("touchstart",a),()=>{n.removeEventListener("mousedown",a),n.removeEventListener("touchstart",a)}}}),[e,t,n])};var a=n(98661),o=n(55004)},49862:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useDidUpdate=function(e,t){const n=(0,a.useRef)(!1);(0,a.useEffect)((()=>{n.current?e():n.current=!0}),t)};var a=n(98661)},63664:function(e,t,n){"use strict";var a=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.useErrorCatcher=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=(0,r.useErrorBoundary)((t=>{t.message+=` (in ${e} component)`,i.Monitoring.reportException(t)})),a=(0,o.default)(n,2),l=a[0],u=a[1];if(l)return(0,s.isFunction)(t)?t({error:l,resetError:u}):t};var o=a(n(67375)),r=n(30396),i=n(54415),s=n(55004)},2535:function(e,t,n){"use strict";var a=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.useForm=function(e){let t=e.initialValues,n=e.initialErrors,a=e.validate,o=e.schemas,c=e.focusOnFirstError;const g=(0,i.useState)(f(n)),m=(0,r.default)(g,2),_=m[0],v=m[1],y=(0,i.useState)(t),b=(0,r.default)(y,2),E=b[0],T=b[1],C=(0,i.useState)({}),O=(0,r.default)(C,2),S=O[0],w=O[1],A=(0,i.useState)(0),I=(0,r.default)(A,2),M=I[0],P=I[1],R=!p(_),k=M>0,N=(0,i.useRef)(null);(0,u.useDidUpdate)((()=>{if(F(),N.current&&c&&!(0,l.isEmpty)(_)){const e=`[name="${Object.keys(_)[0]}"]`,t=N.current.querySelector(e);t&&t.focus()}}),[M]);const D=()=>v({}),x=(e,t)=>v((n=>d(d({},n),{},{[e]:t}))),L=e=>v((t=>{const n=d({},t);return delete n[e],n})),j=(e,t)=>{const n=(0,s.isFunction)(null==o?void 0:o[e])?o[e](t):t;T((t=>d(d({},t),{},{[e]:n}))),L(e),B(e)},B=e=>w((t=>d(d({},t),{},{[e]:!0}))),F=()=>w({}),U=()=>{const e=h(a,E);return v(e.errors),e};return{errors:_,values:E,submitCount:M,isValid:R,isSubmitted:k,formRef:N,setErrors:v,setValues:T,clearErrors:D,setFieldError:x,clearFieldError:L,setFieldValue:j,validate:U,validateField:e=>{const t=function(e,t,n){const a=h(t,n),o=e in a.errors;return{hasError:o,error:o?a.errors[e]:null}}(e,a,E);return t.hasError?x(e,t.error):L(e),t},onSubmit:e=>(t,n)=>{n||t.preventDefault(),P((e=>e+1)),!U().hasErrors&&e(E,t)},reset:()=>{T(t),D(),F()},getInputProps:e=>{return{state:{isDirty:S[e],isValid:!_[e],isEmpty:E[e]&&E[e].length>0},attrs:{value:E[e],error:_[e],onChange:(t=t=>j(e,t),e=>{t("object"==typeof e&&"nativeEvent"in e?e.currentTarget.value:e)})}};var t}}};var o=a(n(61125)),r=a(n(67375)),i=n(98661),s=n(55004),l=n(92560),u=n(49862);function c(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function d(e){for(var t=1;t{const a=e[n];return a&&(t[n]=a),t}),{}):{}}function p(e){return Object.keys(e).length>0}function h(e,t){return e?function(e){const t=f(e);return{hasErrors:p(t),errors:t}}(e(t)):{hasErrors:!1,errors:{}}}},81366:function(e,t,n){"use strict";var a=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.useIsOnline=function(){const e=(0,s.useToggle)(l.navigator.onLine),t=(0,o.default)(e,2),n=t[0],a=t[1];return(0,r.useEffect)((()=>(l.addEventListener("online",a),l.addEventListener("offline",a),()=>{l.removeEventListener("online",a),l.removeEventListener("offline",a)})),[a]),n};var o=a(n(67375)),r=n(98661),i=n(69882),s=n(9335);const l=(0,i.getPageWindow)()},77389:function(e,t,n){"use strict";var a=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.useListenedStyle=function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const n=(0,o.useRef)(u(e,t));return(0,o.useEffect)((function(){r.default.listenChangeZoom((()=>{n.current=u(e,t)}))}),[t,e]),n.current};var o=n(98661),r=a(n(74379)),i=n(46322),s=n(90872);function l(e,t){return{textSize:r.default.getTextSize(),lineHeight:r.default.getLineHeight(t),zoom:r.default.getAppZoom()}[e]}function u(e,t){return t?(0,s.isArray)(e)?e.map((e=>(0,i.isObject)(e)?l(e.name,e.repass):l(e))):(0,i.isObject)(e)?l(e.name,e.repass):l(e):[]}},55330:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useMergeRefs=function(){for(var e=arguments.length,t=new Array(e),n=0;nt.every((e=>(0,r.isUndefined)(e)||(0,o.isNull)(e)))?null:e=>{t.forEach((t=>{t&&l(t,e)}))}),t)};var a=n(98661),o=n(98986),r=n(28008),i=n(55004),s=n(4623);function l(e,t){(0,r.isUndefined)(e)||(0,o.isNull)(e)||((0,i.isFunction)(e)?e(t):(0,s.tryCatch)((()=>e.current=t),(()=>{throw new Error(`Cannot assign value '${t}' to ref '${e}'`)})))}},9335:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useToggle=void 0;var a=n(98661);const o=(e,t)=>"boolean"==typeof t?t:!e;t.useToggle=e=>(0,a.useReducer)(o,e)},84726:function(e,t,n){"use strict";var a=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=a(n(1039));function r(e){return"custom_langpack"in o.default&&e in o.default.custom_langpack?o.default.custom_langpack[e].replace(/\n/g,"
").replace(/"/g,'"').replace(/'/g,"'"):function(e){return window.base_langpack&&window.base_langpack[e]?window.base_langpack[e].replace(/\n/g,"
").replace(/ /g," "):e}(e)}function i(e){var t=window.parent.currentDownloadLocale,n=window.parent.customLocale,a=window.parent.domKeys;return a&&a[e]&&t&&t[e]?n[e]||t[e]:"{{_"+e+"_}}"}var s=window.parent&&window.parent.__jivoPhraseappEditor?i:r;t.default=s},88319:function(e,t){"use strict";t.Z=void 0,function(e){var t={CONNECTING:0,OPEN:1,CLOSING:2,CLOSED:3},n={1e3:"Normal Closure",1001:"Going away",1002:"Protocol error",1003:"Unsupported data",1004:"reserved",1005:null,1006:null,1007:"Invalid frame payload data",1008:"Policy violation",1009:"Message Too Big",1010:"Mandatory Ext.",1011:"Internal Error",1012:"Service Restart",1013:"Try Again Later",1014:"Unassigned",1015:"TLS handshake",3001:"Attempts have Ended",3333:"Spam detected",4e3:"Application Closure",4999:"Last Code"},a=function(){},o=function(){throw new Error("Not implemented")},r=Date,i=function(e,t){this.name="NetworkError",this.code=t<<0,this.message=String(e)};i.prototype.toString=function(){return this.name+":"+(this.code<<0||"")+" "+this.message};var s,l=function(e,t,n){if(e&&"function"==typeof e[t])try{e[t](n)}catch(n){if("onerror"===String(t))throw n;try{l(e,"onerror",n)}catch(e){}}},u={};if(window&&("function"==typeof window.WebSocket||"object"==typeof window.WebSocket)){var c=window.WebSocket;for(var d in s=function(e,a){var o,r,i,s,u=this;this.url=e,this.readyState=t.CONNECTING;var d=function(){if(o){o.onclose=null,o.onerror=null,o.onmessage=null,o.onopen=null;try{o.close()}catch(e){}}u.readyState=t.CLOSED,l(u,"onclose",{wasClean:!1,code:1006,reason:"Timeout"})},f=function(){try{this.send(".")}catch(e){}s=setTimeout(d,1e4)}.bind(this);this.close=function(e,n){if(clearTimeout(i),this.readyState===t.CONNECTING)this.readyState=t.CLOSING,clearTimeout(r),r=setTimeout((function(){u.readyState=t.CLOSED,l(u,"onclose",{wasClean:!1,code:1006,reason:""})}),20);else if(this.readyState===t.OPEN){this.readyState=t.CLOSING;try{n?o.close(e,n):e?o.close(e):o.close(1e3)}catch(e){l(u,"onerror",e),l(u,"onclose",{wasClean:!1,code:1006,reason:""})}}},this.send=function(e){if(!o||o.OPEN!==o.readyState)throw new Error("Socket is not open");clearTimeout(i),clearTimeout(s),o.send(e),i=setTimeout(f,2e4)},r=setTimeout((function(){try{(o=a?new c(e,a):new c(e)).onclose=function(e){if(clearTimeout(i),clearTimeout(r),u.readyState=t.CLOSED,/MSIE|Trident|Edge|Lumia/.test(window.navigator.userAgent)&&e.wasClean&&(1e3===e.code||1005===e.code)&&e.reason)for(var a in n)if(e.reason===n[a])return void l(u,"onclose",{wasClean:!0,code:a<<0,reason:e.reason});l(u,"onclose",e)},o.onerror=function(e){e.name||e.message||(e.name="WebSocketError",e.message="Unknown"),l(u,"onerror",e)},o.onmessage=function(e){clearTimeout(s),e&&e.data&&1f[1]&&(s=o);if(/apple/i.test(window.navigator.vendor))(f=/\bVersion\/(\d+)\./.exec(window.navigator.userAgent))&&6>f[1]&&(s=o)}u.ws=u.wss=s;var p=function(){var e,t,n,o,r=window.document.getElementsByTagName("head")[0],i=this;this.withCredentials=!1,this.readyState=0,this.responseText="",this.status=0,this.statusText="",this.timeout=void 0;var s=function(){if(e){clearTimeout(o),e.onreadystatechange=a,e.onload=a,e.onerror=a,e.parentNode.removeChild(e),e=null,t=null,n=null,i.responseText="",i.status=0,i.statusText="",i.timeout=void 0,i.withCredentials=!1;try{delete window[n]}catch(e){window[n]=void 0}l(i,"onloadend")}},u=function(){e&&(l(i,"onerror"),s())};this.open=function(e,a){!t&&a&&(i.readyState=1,t=String(a).replace(/#.*$/,""),n="_jivo"+p._count++,t+=(-1===t.indexOf("?")?"?":"&")+"cb="+n)},this.send=function(a){t&&(a=a?"&msg="+encodeURIComponent(a):"",window[n]=function(e){i.readyState=4,p._statusBody.test(e)?(i.status=p._statusBody.exec(e)[1]<<0,i.statusText="",i.responseText="",l(i,"onerror"),s()):(i.status=200,i.statusText="OK",i.responseText=e,l(i,"onload"),s())},(e=document.createElement("script")).charset="utf-8",e.type="text/javascript",e.onreadystatechange=function(){"complete"!==this.readyState&&"loaded"!==this.readyState||setTimeout(u,0)},e.readyState||(e.onload=e.onerror=u),e.src=t+a,r.appendChild(e),i.timeout<<=0,0e.code?h(e):S()},_=function(e){try{s.error(e)}catch(e){throw e}},v=function(e){if(t.OPEN===l())try{s.message(e.data)}catch(e){_(e)}},C=function(){var e,n,a,r,u;f(),l(t.OPEN),e=o[o.index],n=d,r=1e3,u=function(){e&&0<=e.health&&(n(++e.health),r<<=1,a=setTimeout(u,r))},a=setTimeout(u,r),i=function(){clearTimeout(a)};try{s.open()}catch(e){_(e)}},O=function(){var e=o[o.index];try{r=function(e){if("string"!=typeof e)throw new TypeError("Bad URL type");var t=y.exec(e);if(null===t)throw new Error("Bad URL");if(!u[t[1]])throw new Error("Not supported URL scheme: "+t[1]);return new u[t[1]](e)}(e.value)}catch(t){return e.health=-1,++o.index,_(t),S()}r.onclose=m,r.onerror=_,r.onmessage=v,r.onopen=C},S=function(e){if(f(),o.index>=o.length)c(void 0),d(void 0),h({wasClean:!1,code:3001,reason:n[3001]});else if(0>o[o.index].health)_(new Error("Sick URL")),++o.index,S();else{p(),l(t.CONNECTING);var a=o[o.index];c()!==a.value&&(c(a.value),d(a.health));try{s.connecting(a.health)}catch(e){}e||0===o[o.index].health?O():f(O,3e3)}};this.open=function(e){if(g())return h({wasClean:!1,code:3333,reason:n[3333]});if(t.CONNECTING!==l()&&t.OPEN!==l()){if(e){e=String(e);for(var a=0;a(e<<=0)||5e3<=e?r.close():a?r.close(e,String(a)):r.close(e),r.onclose=h,l(t.CLOSING)))},this.send=function(e){if(t.OPEN!==l())return new Error("Connection is not open");if(g())return h({wasClean:!1,code:3333,reason:n[3333]}),new Error("Spam detected");try{r.send(e)}catch(e){return e}return null};var w=function(e,t){return function(){t.apply(e,arguments)}};this.on=function(e,t){if(e&&"object"==typeof e)for(var n in e)this.on(n,w(e,e[n]));else s[e]&&"function"==typeof t&&(s[e]=t)},this.off=function(){for(var e in s)s[e]=a},this.getHealthyURLs=function(){for(var e=[],t=0;t{const t=(0,u.getComputedStyleAll)(this.element,e);t&&(this.clone.style[e]=t)})),this.clone.style.display="block"}},{key:"afterResize",value:function(){(c.default.tablet()?this.element.scrollHeight:this.element.offsetHeight)>=this.config.maxSize&&this.element.style.setProperty("overflow-y","auto","important")}},{key:"updateConfig",value:function(e){d.log("updateConfig",e),Object.assign(this.config,e)}},{key:"check",value:function(){this.updateClone();let e=this.element.value||this.element.getAttribute("placeholder")||"";const t=this.element.offsetHeight;let n,a;e=e.length?e:" ",e===this.prevValue&&""==e||(this.clone.innerHTML=(0,l.escape)(e).replace(new RegExp("\\r?\\n","ig"),"
.
"),n=Math.min(Math.max(this.clone.offsetHeight,this.config.minSize>>0),this.config.maxSize),""==this.element.value&&(n=this.clone.offsetHeight),t!==n&&(a={height:n}),this.prevValue=e,a&&(c.default.mobile()&&(n+=parseInt((0,u.getComputedStyleAll)(this.element,"paddingTop"))+parseInt((0,u.getComputedStyleAll)(this.element,"paddingBottom"))),this.element.setAttribute("style",`height: ${n}px!important`),this.config.onResize&&this.config.onResize.call(this.element),this.config.initCheck=!1,this.afterResize()))}}]),e}();t.default=h},27104:function(e,t){"use strict";function n(e){return parseInt(r(e).substring(0,2),16)}function a(e){return parseInt(r(e).substring(2,4),16)}function o(e){return parseInt(r(e).substring(4,6),16)}function r(e){return function(e){return 3==e.length&&(e=e.split("").map((function(e){return e.toString()+e.toString()})).join("")),e}(e="#"==e.charAt(0)?e.substring(1,7):e)}function i(e){return e=parseInt(e,10),isNaN(e)?"00":(e=Math.max(0,Math.min(e,255)),"0123456789ABCDEF".charAt((e-e%16)/16)+"0123456789ABCDEF".charAt(e%16))}function s(e,t,r){var s=n(e),l=a(e),u=o(e),d=f.toHSV(new c(s,l,u));d.v>0?d.v=d.v*t:d.v=100*(t-1),d.s=d.s*r;var p,h,g,m=f.toRGB(d);return"#"+(p=m.r,h=m.g,g=m.b,i(p)+i(h)+i(g))}function l(e){return(299*n(e)+587*a(e)+114*o(e))/1e3}function u(e,t,n){e<=0&&(e=0),t<=0&&(t=0),n<=0&&(n=0),e>360&&(e=360),t>100&&(t=100),n>100&&(n=100),this.h=e,this.s=t,this.v=n}function c(e,t,n){e<=0&&(e=0),t<=0&&(t=0),n<=0&&(n=0),e>255&&(e=255),t>255&&(t=255),n>255&&(n=255),this.r=e,this.g=t,this.b=n}function d(e,t,n,a){e<=0&&(e=0),t<=0&&(t=0),n<=0&&(n=0),a<=0&&(a=0),e>100&&(e=100),t>100&&(t=100),n>100&&(n=100),a>100&&(a=100),this.c=e,this.m=t,this.y=n,this.k=a}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var f={isLightColor:function(e){return function(e){var t=n(e),r=a(e),i=o(e),s=f.toHSV(new c(t,r,i));return s.v+-.5*s.s}(e)>58},getContrast:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:128;const n=l(e);return n>=t?"black":"white"},_RGBtoHSV:function(e){var t=new u(0,0,0),n=e.r/255,a=e.g/255,o=e.b/255,r=Math.min(n,a,o),i=Math.max(n,a,o),s=i-r;if(t.v=i,0==s)t.h=0,t.s=0;else{t.s=s/i;var l=((i-n)/6+s/2)/s,c=((i-a)/6+s/2)/s,d=((i-o)/6+s/2)/s;n==i?t.h=d-c:a==i?t.h=1/3+l-d:o==i&&(t.h=2/3+c-l),t.h<0&&(t.h+=1),t.h>1&&(t.h-=1)}return t.h=Math.round(360*t.h),t.s=Math.round(100*t.s),t.v=Math.round(100*t.v),t},_HSVtoRGB:function(e){var t=new c(0,0,0),n=e.h/360,a=e.s/100,o=e.v/100;if(0==a)t.r=255*o,t.g=255*o,t.b=255*o;else{var r,i,s,l=6*n,u=Math.floor(l),d=o*(1-a),f=o*(1-a*(l-u)),p=o*(1-a*(1-(l-u)));0==u?(r=o,i=p,s=d):1==u?(r=f,i=o,s=d):2==u?(r=d,i=o,s=p):3==u?(r=d,i=f,s=o):4==u?(r=p,i=d,s=o):(r=o,i=d,s=f),t.r=255*r,t.g=255*i,t.b=255*s,t.r=Math.round(t.r),t.g=Math.round(t.g),t.b=Math.round(t.b)}return t},_CMYKtoRGB:function(e){var t=new c(0,0,0),n=e.c/100,a=e.m/100,o=e.y/100,r=e.k/100;return t.r=1-Math.min(1,n*(1-r)+r),t.g=1-Math.min(1,a*(1-r)+r),t.b=1-Math.min(1,o*(1-r)+r),t.r=Math.round(255*t.r),t.g=Math.round(255*t.g),t.b=Math.round(255*t.b),t},_RGBtoCMYK:function(e){var t=new d(0,0,0,0),n=e.r/255,a=e.g/255,o=e.b/255;return t.k=Math.min(1-n,1-a,1-o),t.c=(1-n-t.k)/(1-t.k),t.m=(1-a-t.k)/(1-t.k),t.y=(1-o-t.k)/(1-t.k),t.c=Math.round(100*t.c),t.m=Math.round(100*t.m),t.y=Math.round(100*t.y),t.k=Math.round(100*t.k),t},toRGB:function(e){return e instanceof c?e:e instanceof u?this._HSVtoRGB(e):e instanceof d?this._CMYKtoRGB(e):void 0},toHSV:function(e){return e instanceof u?e:e instanceof c?this._RGBtoHSV(e):e instanceof d?this._RGBtoHSV(this._CMYKtoRGB(e)):void 0},toCMYK:function(e){return e instanceof d?e:e instanceof c?this._RGBtoCMYK(e):e instanceof u?this._RGBtoCMYK(this._HSVtoRGB(e)):void 0},genGradientBg:function(e){return"linear-gradient(95deg, "+e+" 20%, "+this.getRightColor(e)+" 80%)"},getRightColor:function(e){return s(e,.9,.9)},getGradientBg:function(e,t){return"linear-gradient(95deg, "+e+" 20%, "+(t||e)+" 80%)"}},p=f;t.default=p},30295:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n,a,o,r,i=(n=/d{1,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|[LloSZ]|"[^"]*"|'[^']*'/g,a=/\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b/g,o=/[^-+\dA-Z]/g,r=function(e,t){for(e=String(e),t=t||2;e.length99?Math.round(_/10):_),t:h<12?"a":"p",tt:h<12?"am":"pm",T:h<12?"A":"P",TT:h<12?"AM":"PM",Z:s?"UTC":(String(e).match(a)||[""]).pop().replace(o,""),o:(v>0?"-":"+")+r(100*Math.floor(Math.abs(v)/60)+Math.abs(v)%60,4),S:["th","st","nd","rd"][c%10>3?0:(c%100-c%10!=10)*c%10]};return t.replace(n,(function(e){return e in y?y[e]:e.slice(1,e.length-1)}))});i.masks={default:"ddd mmm dd yyyy HH:MM:ss",shortDate:"m/d/yy",mediumDate:"mmm d, yyyy",longDate:"mmmm d, yyyy",fullDate:"dddd, mmmm d, yyyy",shortTime:"h:MM TT",mediumTime:"h:MM:ss TT",longTime:"h:MM:ss TT Z",isoDate:"yyyy-mm-dd",isoTime:"HH:MM:ss",isoDateTime:"yyyy-mm-dd'T'HH:MM:ss",isoUtcDateTime:"UTC:yyyy-mm-dd'T'HH:MM:ss'Z'"},i.i18n={dayNames:["Sun","Mon","Tue","Wed","Thu","Fri","Sat","Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],monthNames:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec","January","February","March","April","May","June","July","August","September","October","November","December"]};var s=i;t.default=s},96879:function(e,t,n){"use strict";var a=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.filterMessage=void 0;var o=n(81152),r=a(n(14264));t.filterMessage=e=>{const t=/^\/service/.test(e.text),n="object"==typeof e.media,a=e.msg_id;let i=!t;if("number"==typeof a){const e=!!r.default.getMessageById(a);i=i&&!e}if(n){const t=e.from===o.MessageInitiator.CLIENT&&e.type!==o.MessageType.MEDIA&&n&&"error"===e.media.type;i=i&&!t}return e.deleted&&(i=!1),e.type==o.MessageType.INVOICE&&(i=!1),i}},17987:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=n(60277),o=n(9393),r=n(90872),i=n(64249),s=n(82138),l=n(55004),u=n(21733),c=n(34548),d=n(15201),f=n(31484),p=n(54415),h=n(97615),g=function(){var e,t=[].slice,n="transition",g="handler",m="handling",_="handled",v="nohandler",y="deferred",b="newfsm",E={makeFsmNamespace:(e=0,function(){return"fsm."+e++}),getDefaultOptions:function(){return{initialState:"uninitialized",eventListeners:{"*":[]},states:{},eventQueue:[],namespace:E.makeFsmNamespace(),targetReplayState:"",state:void 0,priorState:void 0,_priorAction:"",_currentAction:""}}},T={"*":function(e,t,n){e[t]=n},object:function(e,t,n){e[t]=O({},e[t]||{},n)},array:function(e,t,n){e[t]=[],(0,o.each)(n,(function(n,a){T[C(n)](e[t],a,n)}),this)}},C=function(e){var t=function(e){return(0,r.isArray)(e)?"array":(0,i.isDate)(e)?"date":(0,s.isRegExp)(e)?"regex":typeof e}(e);return T[t]?t:"*"},O=function(e){return(0,o.each)(t.call(arguments,1),(function(t){(0,o.each)(t,(function(t,n){T[C(t)](e,n,t)}))})),e},S=function(e){(0,a.extend)(this,e),(0,f.defaults)(this,E.getDefaultOptions()),this.initialize.apply(this,arguments),A.emit(b,this),this.initialState&&this.transition(this.initialState)};(0,a.extend)(S.prototype,{initialize:function(){},emit:function(e){var n=arguments;this.eventListeners["*"]&&(0,o.each)(this.eventListeners["*"],(function(a){if(h.EnvironmentManager.isProduction())try{a.apply(this,t.call(n,0))}catch(t){t.message+=` machina.js * [${this.namespace}] ${e}`,p.Monitoring.reportException(t)}else a.apply(this,t.call(n,0))}),this),this.eventListeners[e]&&(0,o.each)(this.eventListeners[e],(function(a){if(h.EnvironmentManager.isProduction())try{a.apply(this,t.call(n,1))}catch(t){t.message+=` machina.js ev [${this.namespace}] ${e}`,p.Monitoring.reportException(t)}else a.apply(this,t.call(n,1))}),this)},handle:function(e){if(!this.inExitHandler){var n,a,o,r,i=this.states,s=this.state,c=t.call(arguments,0);this.currentActionArgs=c,i[s][e]||i[s]["*"]||this["*"]?(o="*"===(n=i[s][e]?e:"*"),i[s][n]?(a=i[s][n],r=s+"."+n):(a=this["*"],r="*"),this._currentAction||(this._currentAction=r),this.emit.call(this,m,{inputType:e,args:c.slice(1)}),(0,l.isFunction)(a)&&(a=a.apply(this,o?c:c.slice(1))),(0,u.isString)(a)&&this.transition(a),this.emit.call(this,_,{inputType:e,args:c.slice(1)}),this._priorAction=this._currentAction,this._currentAction="",this.processQueue(g)):this.emit.call(this,v,{inputType:e,args:c.slice(1)}),this.currentActionArgs=void 0}},transition:function(e){if(!this.inExitHandler&&e!==this.state){var t;if(this.states[e]){if(this.targetReplayState=e,this.priorState=this.state,this.state=e,t=this.priorState,this.states[t]&&this.states[t]._onExit&&(this.inExitHandler=!0,this.states[t]._onExit.call(this),this.inExitHandler=!1),this.emit.call(this,"transition",{fromState:t,action:this._currentAction,toState:e}),this.states[e]._onEnter)if(h.EnvironmentManager.isProduction())try{this.states[e]._onEnter.call(this)}catch(t){t.message+=` machina.js [${this.namespace}] ${e}`,p.Monitoring.reportException(t)}else this.states[e]._onEnter.call(this);return void(this.targetReplayState===e&&this.processQueue(n))}this.emit.call(this,"invalidstate",{state:this.state,attemptedState:e})}},processQueue:function(e){var t=e===n?function(e){return e.type===n&&(!e.untilState||e.untilState===this.state)}:function(e){return e.type===g},a=this.eventQueue.filter(t);this.eventQueue=(0,c.difference)(this.eventQueue,a),(0,o.each)(a,(function(e){this.handle.apply(this,e.args)}),this)},clearQueue:function(e,t){var a;e?(e===n?a=function(e){return e.type===n&&(!t||e.untilState===t)}:e===g&&(a=function(e){return e.type===g}),this.eventQueue=this.eventQueue.filter(a)):this.eventQueue=[]},deferUntilTransition:function(e){if(this.currentActionArgs){var t={type:n,untilState:e,args:this.currentActionArgs};this.eventQueue.push(t),this.emit.call(this,y,{state:this.state,queuedArgs:t})}},deferUntilNextHandler:function(){if(this.currentActionArgs){var e={type:n,args:this.currentActionArgs};this.eventQueue.push(e),this.emit.call(this,y,{state:this.state,queuedArgs:e})}},on:function(e,t){var n=this;return n.eventListeners[e]||(n.eventListeners[e]=[]),n.eventListeners[e].push(t),{eventName:e,callback:t,off:function(){n.off(e,t)}}},off:function(e,t){e?this.eventListeners[e]&&(this.eventListeners[e]=t?(0,d.without)(this.eventListeners[e],t):[]):this.eventListeners={}}}),S.prototype.trigger=S.prototype.emit;var w=function(){};S.extend=function(e,t){var n=function(e,t,n){var a;return a=t&&t.hasOwnProperty("constructor")?t.constructor:function(){e.apply(this,arguments)},O(a,e),w.prototype=e.prototype,a.prototype=new w,t&&O(a.prototype,t),n&&O(a,n),a.prototype.constructor=a,a.__super__=e.prototype,a}(this,e,t);return n.extend=this.extend,n};var A={Fsm:S,utils:E,on:function(e,t){return this.eventListeners[e]||(this.eventListeners[e]=[]),this.eventListeners[e].push(t),t},off:function(e,t){this.eventListeners[e]&&(this.eventListeners[e]=(0,d.without)(this.eventListeners[e],t))},trigger:function(e){var n=arguments,a=this.eventListeners[e]||[];a&&a.length&&(0,o.each)(a,(function(e){e.apply(null,t.call(n,1))}))},eventListeners:{newFsm:[]}};return A.emit=A.trigger,A}(),m=g;t.default=m},66214:function(e){"use strict";const t=()=>!0,n=e=>{const t="\\".charCodeAt(0);let n=e.length,a=0;for(;n&&e.charCodeAt(--n)===t;)a++;return a%2==1},a=(e,t,a)=>{let o=a-1;for(;;){const a=o;if(o=e.indexOf(t,o+1),o<0)return-1;if(!n(e.slice(a,o)))return o}},o=function(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];const i=[];let s;const l=e=>s&&"text"==s.type?(s.text+=e,s):u({type:"text",text:e}),u=e=>{const t=i.length;return(t?i[t-1].block:r).push(e),s=e},c=e=>("link"==e.type&&(e={type:"link",block:e.block,url:"",ref:""}),u(e)),d=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:t;for(let t=i.length;--t>=0;){const n=i[t];if(!e(n))return n;c(i.pop())}},f=e=>p.lastIndex=h=e,p=/(^([*_-])\s*\2(?:\s*\2)+$)|(?:^(\s*)([>*+-]|\d+[.\)])\s+)|(?:^``` *(\w*)\n([\s\S]*?)```$)|(^(?:(?:\t| )[^\n]*(?:\n|$))+)|(\!?\[)|(\](?:(\(|\[)|\:\s*(.+)$)?)|(?:^([^\s].*)\n(\-{3,}|={3,})$)|(?:^(#{1,6})(?:[ \t]+(.*))?$)|(?:`([^`].*?)`)|( \n|\n\n)|(__|\*\*|[_*]|~~)/gm;let h=0;for(;;){const t=p.exec(e),r=t?t.index:e.length,g=e.slice(h,r);if(g&&(l(g),t&&n(g))){f(t.index+1),l(t[0][0]);continue}if(!t)break;let m=1;if(h=p.lastIndex,t[m])d(),u({type:"border",text:e.slice(r,r+t[0].length)});else if(t[m+=3]){d();const n=t[m],r=">"==n,i=u(r?{type:"quote",block:[]}:{type:"list",block:[],indent:t[m-1],bullet:n}),s=r?/^\s{0,3}([*+-]|\d+[.\)])[ \t]/:/^\s*([>*+-]|\d+[.\)])[ \t]/,l=h;h=a(e,"\n",l),h<0&&(h=e.length);let c=e.slice(l,h);for(;h?\s*(.*)$/:/^\s*(.*)$/);if(!o){c+="\n"+n;break}c+="\n"+o[0]}o(c,i.block),f(h)}else if(null!=t[m+=2]||t[m+1]){d();let e=t[m+1],n="",a="";e?(a=/^(\t| )/.exec(e)[0],e=e.replace(/^(\t| )/gm,""),"\n"==e.slice(-1)&&(e=e.slice(0,-1),f(h-1))):(e=t[m].slice(0,-1),n=t[m-1].toLowerCase()),u({type:"codeBlock",code:e,syntax:n,indent:a})}else if(t[m+=2])if("!"==t[m][0]){const n=a(e,"]",h);if(n<0){l(t[0]);continue}s=null,i.push({type:"image",alt:e.slice(t.index+2,n),url:"",ref:""}),f(n)}else s=null,i.push({type:"link",block:[],offset:h});else if(t[++m]){const n=/^(link|image)$/;let o=d((e=>!n.test(e.type)));if(o){if(i.pop(),t[m+2]){if("link"==o.type){u({type:"linkDef",key:e.slice(o.offset,r),url:t[m+2]});continue}f(t.index+1)}if(o=c(o),t[m+1]){const n=a(e,"("==t[m+1]?")":"]",h);if(n<0)l(t[m+1]);else{const a=t.index+2,r=e.slice(a,n);f(n+1),"("==t[m+1]?o.url=r:o.ref=r}}}else l(t[0])}else if(t[m+=3]||t[m+2])d(),u({type:"title",block:o(t[m]||t[m+3]||""),rank:t[m+2]?t[m+2].length:"="==t[m+1][0]?1:2});else if(t[m+=4]){const n=r+1;u({type:"codeSpan",code:e.slice(n,n+t[m].length)})}else if(t[++m])d(),u({type:"break",text:t[0]});else if(t[++m]){const e=t[m],n=e.length<2?"italic":"~~"==e?"strike":"bold",a=i[i.length-1];a&&a.type==n&&a.style==e?u(i.pop()):(s=null,i.push({type:n,block:[],style:e}))}}return d(),r};Object.defineProperty(o,"default",{value:o}),e.exports=o},5798:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;let n=function(e,t,n){for(;t=l.length){if(i.length===u.length)return s.join("");if(void 0!==f&&i.length>u.length)return n(s,o,f).join("");break}if(s[o]&&a(s[o])&&l[c].match(/[0-9]/))s[o]=l[c++];else if(s[o]&&a(s[o]))return void 0!==f?n(s,o,f).join(""):s.slice(0,o).join("")}return s.join("").substr(0,o)}};t.default=o},50754:function(e,t,n){"use strict";var a=n(17907)(n(15687));const o=2147483647,r=36,i=/^xn--/,s=/[^\0-\x7E]/,l=/[\x2E\u3002\uFF0E\uFF61]/g,u={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},c=Math.floor,d=String.fromCharCode;function f(e){throw new RangeError(u[e])}function p(e,t){const n=e.split("@");let a="";n.length>1&&(a=n[0]+"@",e=n[1]);const o=function(e,t){const n=[];let a=e.length;for(;a--;)n[a]=t(e[a]);return n}((e=e.replace(l,".")).split("."),t).join(".");return a+o}function h(e){const t=[];let n=0;const a=e.length;for(;n=55296&&o<=56319&&n>1,e+=c(e/t);e>455;a+=r)e=c(e/35);return c(a+36*e/(e+38))},_=function(e){const t=[],n=e.length;let a=0,i=128,s=72,l=e.lastIndexOf("-");l<0&&(l=0);for(let n=0;n=128&&f("not-basic"),t.push(e.charCodeAt(n));for(let d=l>0?l+1:0;d=n&&f("invalid-input");const l=(u=e.charCodeAt(d++))-48<10?u-22:u-65<26?u-65:u-97<26?u-97:r;(l>=r||l>c((o-a)/t))&&f("overflow"),a+=l*t;const p=i<=s?1:i>=s+26?26:i-s;if(lc(o/h)&&f("overflow"),t*=h}const p=t.length+1;s=m(a-l,p,0==l),c(a/p)>o-i&&f("overflow"),i+=c(a/p),a%=p,t.splice(a++,0,i)}var u;return String.fromCodePoint.apply(String,t)},v=function(e){const t=[];let n=(e=h(e)).length,a=128,i=0,s=72;for(const n of e)n<128&&t.push(d(n));let l=t.length,u=l;for(l&&t.push("-");u=a&&tc((o-i)/p)&&f("overflow"),i+=(n-a)*p,a=n;for(const n of e)if(no&&f("overflow"),n==a){let e=i;for(let n=r;;n+=r){const a=n<=s?1:n>=s+26?26:n-s;if(eString.fromCodePoint.apply(String,(0,a.default)(e))},decode:_,encode:v,toASCII:function(e){return p(e,(function(e){return s.test(e)?"xn--"+v(e):e}))},toUnicode:function(e){return p(e,(function(e){return i.test(e)?_(e.slice(4).toLowerCase()):e}))}};e.exports=y},69759:function(e,t,n){"use strict";var a=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(60277),r=n(80210),i=a(n(4855));const s=n(61691),l=(i.default.name("Referer"),function(e){const t=[];for(const a in e){const o=e[a];for(const e in o){const a=o[e];for(const o in a){var n=a[o];n[0].forEach((function(a){var r={domain:a,medium:e,name:o};n[1]&&(r.params=n[1]),t.push(r)}))}}}return t}(s)),u=function(e,t,n){this.known=!1,this.referer=null,this.medium="unknown",this.search_parameter=null,this.search_term=null,this.referers=n||l;const a=new URL(e),i=a.hostname;if(this.known=Boolean(~["http:","https:"].indexOf(a.protocol)),this.uri=a,!this.known)return;if(t){if(new URL(t).hostname===i)return void(this.medium="internal")}let s=this._lookup_referer(i,a.pathname,!0);if(s||(s=this._lookup_referer(i,a.pathname,!1),s)){if(this.referer=s.name,this.medium=s.medium,"search"===s.medium){if(!s.params)return;const e=(0,o.extend)(r.querystring.parse(a.hash),r.querystring.parse(a.search));for(const t in e){const n=e[t];-1!==s.params.indexOf(t.toLowerCase())&&(this.search_parameter=t,this.search_term=n)}}}else this.medium="unknown"};u.prototype.searchReferer=function(e){return this.referers.find((t=>t.domain instanceof RegExp&&e.search(t.domain)>-1||(t.domain===e||void 0)))},u.prototype._lookup_referer=function(e,t,n){let a=null;if(a=n?this.searchReferer(e+t):this.searchReferer(e),!a&&n){const n=t.split("/");if(n.length>1)try{a=this.searchReferer(e+"/"+n[1])}catch(e){}}if(a)return a;try{const a=e.indexOf(".");if(-1===a)return null;const o=e.slice(a+1);return this._lookup_referer(o,t,n)}catch(e){return null}};var c=u;t.default=c},61691:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default={unknown:{Google:[["support.google.com","developers.google.com","maps.google.com","accounts.google.com","drive.google.com","sites.google.com","groups.google.com","groups.google.co.uk","news.google.co.uk"]],"Yahoo!":[["finance.yahoo.com","news.yahoo.com","eurosport.yahoo.com","sports.yahoo.com","astrology.yahoo.com","travel.yahoo.com","answers.yahoo.com","screen.yahoo.com","weather.yahoo.com","messenger.yahoo.com","games.yahoo.com","shopping.yahoo.net","movies.yahoo.com","cars.yahoo.com","lifestyle.yahoo.com","omg.yahoo.com","match.yahoo.net"]]},search:{"360.cn":[[/so.(com|360.cn)$/gi],["q"]],AOL:[[/\.aol.\w{2,4}(\w{2,4})?/gi,"aolsearch.com"],["q","query"]],Yandex:[["yandex.ru","yandex.ua","yandex.com","www.yandex.ru","www.yandex.ua","www.yandex.com","yandex.by","yandex.kz","www.yandex.by","www.yandex.kz"],["text"]],DuckDuckGoL:[["duckduckgo.com"],["q"]],Picsearch:[["www.picsearch.com"],["q"]],"Mail.ru":[["go.mail.ru"],["q"]],Rambler:[["nova.rambler.ru"],["query","words"]],MySearch:[[/(.mysearch)|(.myway).com$/gi,"search.mywebsearch.com"],["searchfor","searchFor"]],Baidu:[[/.baidu.com$/gi,"web.gougou.com"],["wd","word","kw","k"]],Ecosia:[["ecosia.org"],["q"]],Bing:[["bing.com","www.bing.com","msnbc.msn.com","dizionario.it.msn.com","cc.bingj.com","m.bing.com"],["q"]],Seznam:[["search.seznam.cz"],["q"]],"Yahoo!":[[/.?yahoo./gi,"www.cercato.it","search.offerbox.com","ys.mirostart.com"],["q","p"]],Ask:[[/.ask.com$/gi,"ask.reference.com","www.askkids.com","www.ask.co.uk","search-results.com","uk.search-results.com","www.search-results.com","int.search-results.com"]],"uol.com.br":[["busca.uol.com.br"],["q"]],Google:[[/^(www.)?google.\w{2,4}(.\w{2,4})?$/gi,/^.incredimail.com$/gi,/.googleearth./gi,"isearch.avg.com","www.cnn.com","darkoogle.com","search.darkoogle.com","search.foxtab.com","www.gooofullsearch.com","search.hiyo.com","search.sweetim.com","www.fastweb.it","search.juno.com","find.tdc.dk","searchresults.verizon.com","search.walla.co.il","search.alot.com","webcache.googleusercontent.com","encrypted.google.com","googlesyndicatedsearch.com"],["q","query","keywords"]],"2GIS":[["link.2gis.ru"]]},email:{Gmail:[["mail.google.com"]],Rambler:[["mail.rambler.ru"]]},social:{Odnoklassniki:[["odnoklassniki.ru","ok.ru"]],GitHub:[["github.com"]],Instagram:[["instagram.com"]],Vkontakte:[["vk.com","vkontakte.ru"]],Twitter:[["twitter.com","t.co"]],"Mail.ru":[["my.mail.ru"]],Pinterest:[["pinterest.com"]],LinkedIn:[["linkedin.com"]],Facebook:[["facebook.com","fb.me"]],Youtube:[["youtube.com","youtu.be"]]}}},73055:function(e,t,n){"use strict";var a=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.useSwipeDetector=function(e){let t=e.element,n=e.onLeftSwipe,a=e.onRightSwipe,i=e.onUpSwipe,s=e.onDownSwipe,l=e.onDownCount,u=e.onTouchEnd,c=e.verticalSwipeThreshold,d=void 0===c?70:c,f=e.horizontalSwipeThreshold,p=void 0===f?30:f;const h=(0,r.useState)(null),g=(0,o.default)(h,2),m=g[0],_=g[1],v=(0,r.useRef)(null),y=(0,r.useRef)(null);return(0,r.useEffect)((()=>{if(!t)return;if(!t.current)return;if(_(t.current),!m)return;if(!m.addEventListener)return;const e=e=>{const t=(0,o.default)(e.touches,1)[0];v.current=t.clientX,y.current=t.clientY},r=e=>{if(!v.current||!y.current)return;const t=(0,o.default)(e.touches,1)[0];if(!t)return;const r=t.clientX,u=t.clientY,c=v.current-r,f=y.current-u;Math.abs(c)>Math.abs(f)?c>p?a&&a():c<-p&&n&&n():f>d?i&&i():f<-d?s&&s(f):l&&l(f)},c=()=>{v.current=null,y.current=null,u&&u()};return m.addEventListener("touchstart",e,!1),m.addEventListener("touchmove",r,!1),m.addEventListener("touchend",c,!1),()=>{m.removeEventListener("touchstart",e),m.removeEventListener("touchmove",r),m.removeEventListener("touchend",c)}}),[m,n,a,i,s,l,u,d,p]),e=>_(e)};var o=a(n(67375)),r=n(98661)},8117:function(e,t,n){"use strict";var a=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=a(n(61125)),r=a(n(69759)),i=a(n(4855)),s=a(n(50754)),l=n(92560),u=n(37578),c=n(80210);function d(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}const f=i.default.name("utm"),p={utmccn:"campaign",utmcsr:"source",utmcmd:"medium",utmctr:"keyword",utmcct:"content"},h={parseUtmz:function(e){const t={};if(e){const n=decodeURI(e).replace(/^[0-9\.]*/g,"");let a;if(n){const e=n.split("|");for(let n=0;n=0?(a[t[0]]=t[1],i=!0):"term"===t[0]&&(a.keyword=t[1],a.term=t[1]))}if(h=function(e){for(var t=1;t!(0,l.isEmpty)(e)))},isLid(e,t){return["yclid=","gclid=","fbclid="].some((t=>e.includes(t)))&&["yandex","google","facebook"].some((e=>t.includes(e)))},decodeString(e){try{e=decodeURIComponent(e)}catch(t){return f.log(t),this.decode(e)}return e},decode(e){return(e=(e=(e=e.replace(/%([EF][0-9A-F])%([89AB][0-9A-F])%([89AB][0-9A-F])/gi,(function(e,t,n,a){const o=parseInt(t,16)-224,r=parseInt(n,16)-128;if(0==o&&r<32)return e;const i=(o<<12)+(r<<6)+(parseInt(a,16)-128);return i>65535?e:String.fromCharCode(i)}))).replace(/%([CD][0-9A-F])%([89AB][0-9A-F])/gi,(function(e,t,n){const a=parseInt(t,16)-192;if(a<2)return e;const o=parseInt(n,16)-128;return String.fromCharCode((a<<6)+o)}))).replace(/%([0-7][0-9A-F])/gi,(function(e,t){return String.fromCharCode(parseInt(t,16))}))).replace(/%[A-Z0-9]{2}/gi,"")},getUTMParamsFromUrl:function(e){let t=e.indexOf("?"),n=null;for(;-1!=n;)n=e.indexOf("?",t+1),n>0&&(t=n);const a=e.substr(t+1).split("&");let o,r,i="";for(r=a.length;r--;)if(o=a[r].split("="),o[0].indexOf("utm_")>=0){o=a[r],o=o.replace(/\|/gi,"%7C");const e=o.split("=");e.length>1&&(o=e[0]+"="+e.slice(1).join("%3D")),i+=(i.length>0?"|":"")+o.substr(o.indexOf("utm_")+4)}return i},setUTM:function(e){let t=e.href,n=e.refer,a=e.setterFn;const o=h.getUTMParamsFromUrl(t),r=h.parseUTM(t,n,o);return a({campaign:r&&r.campaign||null,source:r&&r.source||null,medium:r&&r.medium||null,keyword:r&&r.keyword||null,term:r&&r.term||null,content:r&&r.content||null})}};var g=h;t.default=g},95020:function(e,t,n){"use strict";!function(){"undefined"==typeof window&&(window=n.g);var e,t=2e4,a=2e3,o=32e3,r=3e4,i=function(t,n){if("function"==typeof e[t])try{return e[t](n)}catch(n){if("onerror"!==t)try{e.onerror(n)}catch(e){}}},s=function(e){return void 0===e?"":("string"!=typeof e&&(e=String(e)),e.replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/[\x00-\x19]/g," "))},l=function(e){return Math.random()*e<<0},u=/^-?[a-zA-Z0-9]{1,16}$/,c=/^[_a-zA-Z][_a-zA-Z0-9]{0,7}$/,d=/^[a-zA-Z0-9]{10}$/;window.ClientSocket=function(){if(e)return e;e=this;var n,f,p,h,g=a,m=0,_=function(){try{f.send(".")}catch(e){}p=setTimeout(_,t)},v=function(){f.onclose=null,f.onerror=null,f.onmessage=null,f.onopen=null,f.CLOSING>f.readyState&&f.close()},y=function(){f&&(v(),o<(g<<=1)&&(g=o)),f=new WebSocket(n),e.readyState=f.readyState,f.onclose=function(t){if(e.readyState=f.readyState,i("onclose",t.reason),p){if(clearTimeout(p),clearTimeout(h),t.reason){var n=-1;switch(t.reason){case"Protocol Error":case"Unsupported Data":case"Invalid Data":case"Message Too Big":case"Mandatory Ext.":case"Invalid Response":case"Normal Closure":case"Void Time":n=0;break;case"Service Restart":n=6e4+l(6e5);break;case"Try Again Later":n=6e5+l(6e5);break;case"Internal Error":n=18e5+l(6e5);break;case"Going Away":n=36e5+l(6e5);break;case"Policy Violation":n=72e5;break;case"Blacklisted":n=864e5}if(-1!==n)return v(),p=null,void i("ondrop",n)}else i("onerror",new Error("close-is-not-clean"));if(3<=++m)return v(),p=null,i("ondrop",6e5+l(6e5)),void i("onfail","Network Unreachable");p=setTimeout(y,g+l(a)),o<(g<<=1)&&(g=o)}},f.onerror=function(e){},f.onmessage=function(e){if(m=0,clearTimeout(h),h=setTimeout(y,r),!(1>=e.data.length)){for(var t,n="",a={},o=e.data.split("\n"),l=0;lu.length)o[l]&&i("onerror","uncomplete-message: "+JSON.stringify(o[l]));else switch(u[3]){case"+":u[0]&&(a.from=u[0]),u[1]&&(a.room=u[1]),u[4]&&(a.ip=u[4]),u[5]&&(a.port=u[5]),a.geoip={},u[6]&&(a.geoip.region=u[6]),u[7]&&(a.geoip.city_country_code=u[7]),u[8]&&(a.geoip.city_country_name=u[8]),u[9]&&(a.geoip.region_name=u[9]),u[10]&&(a.geoip.city=u[10]),u[11]&&(a.geoip.latitude=u[11]),u[12]&&(a.geoip.longitude=u[12]),u[13]&&(a.geoip.org=u[13]),i("onadd",a);break;case"-":u[0]&&(a.from=u[0]),u[1]&&(a.room=u[1]),u[4]&&(a.code=u[4]),i("ondel",a);break;default:if(4=n))throw new RangeError("message-too-big");clearTimeout(h),h=setTimeout(y,r),clearTimeout(p),p=setTimeout(_,t),f.send(e)}},E=function(e,t){var n="";if(e.to){if(!u.test(e.to))throw new Error("invalid-TO");if(!e.room||!d.test(e.room))throw new Error("invalid-ROOM");n+="\t"+e.room+"\t"+e.to}else{if("get"===t)throw new Error("get-require-TO-and-ROOM");n+="\t\t"}if("*"===e.key)e.key="";else if(!c.test(e.key))throw new Error("invalid-KEY");return n+="\t"+e.key};this.get=function(e){if(e)try{b(E(e,"get")+"\n")}catch(e){return e}},this.set=function(e){if(e)try{var t=E(e,"set");if(e.value instanceof Array){if(0===e.value.length)return;for(var n=0;n{l=!!e},lastLog:u,name:(e,t)=>new s(e,t)};t.default=c},53139:function(e,t,n){"use strict";var a=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.updateAgent=t.setAllAgentsLeft=t.initializeAgentStore=t.dispatchers=t.addAgent=void 0;var o=n(2036),r=n(62096),i=n(15857),s=a(n(14762));const l=a(n(4855)).default.name("AgentsActions"),u=e=>({type:o.ActionType.INIT_AGENTS_STORE,payload:e});t.initializeAgentStore=u;const c=e=>({type:o.ActionType.ADD_AGENT,payload:e});t.addAgent=c;const d=e=>{const t=s.default.getAgentById(e.id);return l.log("redux_try_to_update_agent",e,t),t&&(t.set("display_name",e.name),t.set("title",e.title),t.set("avatar_url",e.avatarUrl),l.log("redux_update_agent",s.default)),{type:o.ActionType.UPDATE_AGENT,payload:e}};t.updateAgent=d;const f=()=>({type:o.ActionType.SET_ALL_AGENTS_LEFT});t.setAllAgentsLeft=f;const p=(0,i.bindActionCreators)({initializeAgentStore:u,addAgent:c,updateAgent:d,setAllAgentsLeft:f},r.reduxStore.dispatch);t.dispatchers=p},42932:function(e,t,n){"use strict";var a=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.setVIReconnectTime=t.setShowEula=t.setMaintenance=t.setLastMsgTime=t.setLastMsgId=t.setLastChatStatus=t.setLastChatOpened=t.setIsInputDisabled=t.setIsInDrag=t.setIsContactFormFocused=t.setDidFreezeData=t.setChatStarted=t.setChatOpenByClient=t.setChatAccepted=t.setAppStarted=t.setAppRoute=t.setAppIsOnline=t.setAppIsFocused=t.initializeAppStore=t.dispatchers=void 0;var o=n(2036),r=n(62096),i=n(15857),s=a(n(95003)),l=a(n(1039));const u=e=>{let t=e.isFocused,n=e.isOnline,a=e.route,r=e.tabRoute,i=e.lastChatOpened,s=e.isInputDisabled,l=e.maintenance,u=e.chatStarted,c=e.chatAccepted,d=e.lastMsgId,f=e.lastMsgTime,p=e.started,h=e.showEula,g=e.chatOpenByClient,m=e.viReconnectTime,_=e.didFreezeData,v=e.lastChatStatus;return{type:o.ActionType.INIT_APP_STORE,payload:{isFocused:t,isOnline:n,route:a,tabRoute:r,lastChatOpened:i,isInputDisabled:s,maintenance:l,chatOpenByClient:g,chatStarted:u,chatAccepted:c,lastMsgId:d,lastMsgTime:f,started:p,showEula:h,viReconnectTime:m,didFreezeData:_,lastChatStatus:v}}};t.initializeAppStore=u;const c=e=>(s.default.is_online=e?1:0,{type:o.ActionType.SET_APP_IS_ONLINE,payload:{isOnline:e}});t.setAppIsOnline=c;const d=e=>(s.default.is_focused=e,{type:o.ActionType.SET_APP_IS_FOCUSED,payload:{isFocused:e}});t.setAppIsFocused=d;const f=e=>({type:o.ActionType.SET_CHAT_OPEN_BY_CLIENT,payload:{chatOpenByClient:e}});t.setChatOpenByClient=f;const p=e=>(s.default.route=e,{type:o.ActionType.SET_APP_ROUTE,payload:{route:e}});t.setAppRoute=p;const h=e=>(s.default.lastChatOpened=e,{type:o.ActionType.SET_LAST_CHAT_OPENED,payload:{lastChatOpened:e}});t.setLastChatOpened=h;const g=e=>({type:o.ActionType.SET_IS_IN_DRAG,payload:{isInDrag:e}});t.setIsInDrag=g;const m=e=>({type:o.ActionType.SET_IS_CONTACT_FORM_FOCUSED,payload:{isContactFormFocused:e}});t.setIsContactFormFocused=m;const _=e=>({type:o.ActionType.SET_IS_INPUT_DISABLED,payload:{isInputDisabled:e}});t.setIsInputDisabled=_;const v=e=>(l.default.maintenance=e,{type:o.ActionType.SET_MAINTENANCE,payload:{maintenance:e}});t.setMaintenance=v;const y=e=>(s.default.chat_started=e,{type:o.ActionType.UPDATE_APP_STORE,payload:{chatStarted:e}});t.setChatStarted=y;const b=e=>(s.default.chat_accepted=e,{type:o.ActionType.UPDATE_APP_STORE,payload:{chatAccepted:e}});t.setChatAccepted=b;const E=e=>(s.default.lastMsgTime=e,{type:o.ActionType.UPDATE_APP_STORE,payload:{lastMsgTime:e}});t.setLastMsgTime=E;const T=e=>(s.default.lastMsgId=e,{type:o.ActionType.UPDATE_APP_STORE,payload:{lastMsgId:e}});t.setLastMsgId=T;const C=e=>(s.default.started=e,{type:o.ActionType.UPDATE_APP_STORE,payload:{started:e}});t.setAppStarted=C;const O=e=>(s.default.show_eula=e,{type:o.ActionType.UPDATE_APP_STORE,payload:{showEula:e}});t.setShowEula=O;const S=e=>(s.default.viReconnectTime=e,{type:o.ActionType.UPDATE_APP_STORE,payload:{viReconnectTime:e}});t.setVIReconnectTime=S;const w=e=>(s.default.didFreezeData=e,{type:o.ActionType.UPDATE_APP_STORE,payload:{didFreezeData:e}});t.setDidFreezeData=w;const A=e=>(s.default.lastChatStatus=e,{type:o.ActionType.SET_LAST_CHAT_STATUS,payload:{lastChatStatus:e}});t.setLastChatStatus=A;const I=(0,i.bindActionCreators)({initializeAppStore:u,setAppIsOnline:c,setAppIsFocused:d,setAppRoute:p,setLastChatOpened:h,setIsInDrag:g,setIsContactFormFocused:m,setIsInputDisabled:_,setMaintenance:v,setChatOpenByClient:f,setChatAccepted:b,setChatStarted:y,setLastMsgTime:E,setAppStarted:C,setShowEula:O,setLastMsgId:T,setVIReconnectTime:S,setDidFreezeData:w,setLastChatStatus:A},r.reduxStore.dispatch);t.dispatchers=I},13532:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.initializeBotsStore=t.dispatchers=t.addBot=void 0;var a=n(2036),o=n(62096),r=n(15857);const i=e=>({type:a.ActionType.INIT_BOTS_STORE,payload:e});t.initializeBotsStore=i;const s=e=>({type:a.ActionType.ADD_BOT,payload:e});t.addBot=s;const l={initializeBotsStore:(0,r.bindActionCreators)(i,o.reduxStore.dispatch),addBot:(0,r.bindActionCreators)(s,o.reduxStore.dispatch)};t.dispatchers=l},45689:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setWebRTCCallStatus=t.setSeparateForm=t.setDelayedTimezone=t.setDelayedPeriods=t.setDelayedCallbackStatus=t.setCallbackStatus=t.setCallbackIsDelayed=t.setCallbackError=t.setCallbackAvailable=t.setActiveWebRTCCallMessageId=t.initializeCallbackStore=t.dispatchers=void 0;var a=n(2036),o=n(62096),r=n(15857);const i=e=>({type:a.ActionType.INIT_CALLBACK_STORE,payload:e});t.initializeCallbackStore=i;const s=e=>({type:a.ActionType.UPDATE_CALLBACK_STORE,payload:{available:e}});t.setCallbackAvailable=s;const l=e=>({type:a.ActionType.UPDATE_CALLBACK_STORE,payload:{delayedStatus:e}});t.setDelayedCallbackStatus=l;const u=e=>({type:a.ActionType.UPDATE_CALLBACK_STORE,payload:{isDelayed:e}});t.setCallbackIsDelayed=u;const c=e=>({type:a.ActionType.UPDATE_CALLBACK_STORE,payload:{status:e}});t.setCallbackStatus=c;const d=e=>({type:a.ActionType.UPDATE_CALLBACK_STORE,payload:{error:e}});t.setCallbackError=d;const f=e=>({type:a.ActionType.UPDATE_CALLBACK_STORE,payload:{delayedTimezone:e}});t.setDelayedTimezone=f;const p=e=>({type:a.ActionType.UPDATE_CALLBACK_STORE,payload:{delayedPeriods:e}});t.setDelayedPeriods=p;const h=e=>({type:a.ActionType.UPDATE_CALLBACK_STORE,payload:{activeWebRTCCallMessageId:e}});t.setActiveWebRTCCallMessageId=h;const g=e=>({type:a.ActionType.UPDATE_CALLBACK_STORE,payload:{webRTCCallStatus:e}});t.setWebRTCCallStatus=g;const m=e=>({type:a.ActionType.UPDATE_CALLBACK_STORE,payload:{separateForm:e}});t.setSeparateForm=m;const _={initializeCallbackStore:(0,r.bindActionCreators)(i,o.reduxStore.dispatch),setCallbackAvailable:(0,r.bindActionCreators)(s,o.reduxStore.dispatch),setDelayedCallbackStatus:(0,r.bindActionCreators)(l,o.reduxStore.dispatch),setCallbackIsDelayed:(0,r.bindActionCreators)(u,o.reduxStore.dispatch),setCallbackStatus:(0,r.bindActionCreators)(c,o.reduxStore.dispatch),setCallbackError:(0,r.bindActionCreators)(d,o.reduxStore.dispatch),setDelayedTimezone:(0,r.bindActionCreators)(f,o.reduxStore.dispatch),setDelayedPeriods:(0,r.bindActionCreators)(p,o.reduxStore.dispatch),setActiveWebRTCCallMessageId:(0,r.bindActionCreators)(h,o.reduxStore.dispatch),setWebRTCCallStatus:(0,r.bindActionCreators)(g,o.reduxStore.dispatch),setSeparateForm:(0,r.bindActionCreators)(m,o.reduxStore.dispatch)};t.dispatchers=_},5597:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.updateCampaignPopup=t.setDisplay=t.setActiveScreen=t.resetCampaignPopup=t.dispatchers=void 0;var a=n(15857),o=n(2036),r=n(62096);const i=e=>({type:o.ActionType.UPDATE_CAMPAIGN_POPUP_CONFIG,payload:e});t.updateCampaignPopup=i;const s=e=>({type:o.ActionType.UPDATE_CAMPAIGN_POPUP_CONFIG,payload:{activeScreen:e}});t.setActiveScreen=s;const l=e=>({type:o.ActionType.UPDATE_CAMPAIGN_POPUP_CONFIG,payload:{display:e}});t.setDisplay=l;const u=()=>({type:o.ActionType.RESET_CAMPAIGN_POPUP_CONFIG});t.resetCampaignPopup=u;const c=(0,a.bindActionCreators)({updateCampaignPopup:i,setActiveScreen:s,setDisplay:l,resetCampaignPopup:u},r.reduxStore.dispatch);t.dispatchers=c},93141:function(e,t,n){"use strict";var a=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.setNoJoinedAgents=t.setJoinedBots=t.setJoinedAgents=t.setChatEvaluated=t.setAgentTyping=t.initializeChatsStore=t.dispatchers=t.createChats=t.addJoinedAgent=void 0;var o=a(n(61125)),r=n(15857),i=n(88928),s=n(2036),l=n(99131),u=n(62096),c=n(55623),d=n(45959),f=n(53139),p=a(n(26754)),h=a(n(14762)),g=n(92056);function m(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function _(e){for(var t=1;t{const t=(0,c.selectChatsIds)(e),n=(0,c.selectJoinedIdsByStatus)(e,"join"),a=n.agentIds,o=n.botIds,r=(0,d.selectClientEvaluate)(e),i=(0,d.selectDepartmentId)(e);return t.length?t.reduce(((e,t,n,s)=>(e.push(_(_(_({},l.chatTemplate),n===s.length-1&&{joinedAgents:a,joinedBots:o}),{},{departmentId:i,evaluated:r,id:t})),e)),[]):[_(_({},l.chatTemplate),{},{departmentId:i,evaluated:r,joinedAgents:a,joinedBots:o})]};t.createChats=v;const y=()=>(e,t)=>{const n=v(t());return e({type:s.ActionType.INIT_CHATS_STORE,payload:n})};t.initializeChatsStore=y;const b=e=>(p.default.typing=e,{type:s.ActionType.SET_AGENT_TYPING,payload:{agentTyping:!!e}});t.setAgentTyping=b;const E=e=>t=>(0,i.batch)((()=>{t({type:s.ActionType.SET_CURRENT_CHAT_EVALUATED,payload:{evaluated:e}}),t((0,g.setEvaluate)(e))}));t.setChatEvaluated=E;const T=e=>{h.default.updateAgentList(e);const t=h.default.getAgentIdsByStatus("join");return{type:s.ActionType.SET_JOINED_AGENTS_IN_CURRENT_CHAT,payload:{joinedAgents:t}}};t.setJoinedAgents=T;const C=()=>e=>{h.default.closeChat(),p.default.agent_id=0,(0,i.batch)((()=>{e({type:s.ActionType.CLOSE_CHAT,payload:{joinedAgents:[]}}),e((0,f.setAllAgentsLeft)())}))};t.setNoJoinedAgents=C;const O=e=>({type:s.ActionType.ADD_JOINED_AGENT_TO_CURRENT_CHAT,payload:{agentId:e}});t.addJoinedAgent=O;const S=e=>({type:s.ActionType.SET_JOINED_BOTS,payload:{joinedBots:null!=e?e:[]}});t.setJoinedBots=S;const w=(0,r.bindActionCreators)({initializeChatsStore:y,setAgentTyping:b,setChatEvaluated:E,setJoinedAgents:T,setNoJoinedAgents:C,addJoinedAgent:O,setJoinedBots:S},u.reduxStore.dispatch);t.dispatchers=w},92056:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.updateClient=t.setVisitorId=t.setUserToken=t.setUTM=t.setPaId=t.setLastMessage=t.setIsIntroduced=t.setInputText=t.setHasIntegration=t.setEvaluate=t.setEulaAccepted=t.setDepartmentId=t.setCustomData=t.setClientTags=t.setClientSessionId=t.setClientPhone=t.setClientName=t.setClientId=t.setClientEmail=t.setClientDescription=t.setClientContacts=t.setCaptchaToken=t.setAssignedAgentId=t.resetClient=t.dispatchers=void 0;var a=n(15857),o=n(2036),r=n(62096);const i=e=>({type:o.ActionType.UPDATE_CLIENT_STORE,payload:{hasIntegration:e}});t.setHasIntegration=i;const s=e=>({type:o.ActionType.UPDATE_CLIENT_STORE,payload:{lastMessage:e}});t.setLastMessage=s;const l=e=>({type:o.ActionType.UPDATE_CLIENT_STORE,payload:{isIntroduced:e}});t.setIsIntroduced=l;const u=e=>({type:o.ActionType.UPDATE_CLIENT_STORE,payload:{inputText:e}});t.setInputText=u;const c=e=>({type:o.ActionType.UPDATE_CLIENT_STORE,payload:{userToken:e}});t.setUserToken=c;const d=e=>({type:o.ActionType.UPDATE_CLIENT_STORE,payload:{customData:e}});t.setCustomData=d;const f=e=>({type:o.ActionType.UPDATE_CLIENT_STORE,payload:{captchaToken:e}});t.setCaptchaToken=f;const p=e=>({type:o.ActionType.UPDATE_CLIENT_STORE,payload:{priorityAgentId:e}});t.setPaId=p;const h=e=>({type:o.ActionType.UPDATE_CLIENT_STORE,payload:{email:e}});t.setClientEmail=h;const g=e=>({type:o.ActionType.UPDATE_CLIENT_STORE,payload:{eulaAccepted:e}});t.setEulaAccepted=g;const m=e=>({type:o.ActionType.UPDATE_CLIENT_STORE,payload:{phone:e}});t.setClientPhone=m;const _=e=>({type:o.ActionType.UPDATE_CLIENT_STORE,payload:{name:e}});t.setClientName=_;const v=e=>({type:o.ActionType.UPDATE_CLIENT_STORE,payload:{description:e}});t.setClientDescription=v;const y=e=>({type:o.ActionType.UPDATE_CLIENT_STORE,payload:{clientId:e}});t.setClientId=y;const b=e=>({type:o.ActionType.UPDATE_CLIENT_STORE,payload:{sessionId:e}});t.setClientSessionId=b;const E=e=>({type:o.ActionType.UPDATE_CLIENT_STORE,payload:{assignedAgentId:e}});t.setAssignedAgentId=E;const T=e=>({type:o.ActionType.UPDATE_CLIENT_STORE,payload:{departmentId:e}});t.setDepartmentId=T;t.setEvaluate=e=>({type:o.ActionType.UPDATE_CLIENT_STORE,payload:{evaluate:e}});const C=e=>({type:o.ActionType.UPDATE_CLIENT_STORE,payload:{utm:e}});t.setUTM=C;const O=e=>({type:o.ActionType.UPDATE_CLIENT_STORE,payload:e});t.setClientContacts=O;const S=e=>({type:o.ActionType.UPDATE_CLIENT_STORE,payload:{visitorId:e}});t.setVisitorId=S;const w=e=>({type:o.ActionType.UPDATE_CLIENT_STORE_MANUALLY,payload:e});t.updateClient=w;const A=()=>({type:o.ActionType.RESET_CLIENT_STORE});t.resetClient=A;const I=e=>({type:o.ActionType.UPDATE_CLIENT_STORE,payload:{tags:e}});t.setClientTags=I;const M=(0,a.bindActionCreators)({setHasIntegration:i,setLastMessage:s,setIsIntroduced:l,setInputText:u,setUserToken:c,setCustomData:d,setCaptchaToken:f,setPaId:p,setEulaAccepted:g,setClientEmail:h,setClientPhone:m,setClientName:_,setClientDescription:v,setClientId:y,setClientSessionId:b,setClientContacts:O,setAssignedAgentId:E,setDepartmentId:T,setVisitorId:S,setUTM:C,updateClient:w,resetClient:A,setClientTags:I},r.reduxStore.dispatch);t.dispatchers=M},84219:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.updateDesignerSettings=t.dispatchers=void 0;var a=n(15857),o=n(2036),r=n(62096);const i=e=>({type:o.ActionType.UPDATE_DESIGNER_SETTINGS,payload:e});t.updateDesignerSettings=i;const s=(0,a.bindActionCreators)({updateDesignerSettings:i},r.reduxStore.dispatch);t.dispatchers=s},66031:function(e,t,n){"use strict";var a=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.enablePrechat=t.dispatchers=t.disableFiletransfer=void 0;var o=n(2036),r=n(62096),i=n(15857),s=a(n(1039));const l=e=>(s.default.disable_filetranser=e,{type:o.ActionType.SET_DISABLE_FILETRANSFER,payload:{disableFiletransfer:e?1:0}});t.disableFiletransfer=l;const u=e=>(s.default.enable_prechat=e?1:0,{type:o.ActionType.SET_ENABLE_PRECHAT,payload:{prechat:e?1:0}});t.enablePrechat=u;const c=(0,i.bindActionCreators)({disableFiletransfer:l,enablePrechat:u},r.reduxStore.dispatch);t.dispatchers=c},26932:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.zoomDispatchers=t.zoom=t.userDispatchers=t.user=t.transitionDispatchers=t.transition=t.socialDispatchers=t.social=t.proactiveDispatchers=t.proactive=t.positionDispatchers=t.position=t.permissionsDispatchers=t.permissions=t.messagesDispatchers=t.messages=t.featuresDispatchers=t.features=t.designerDispatchers=t.designer=t.clientDispatchers=t.client=t.chatsDispatchers=t.chats=t.campaignPopupDispatchers=t.campaignPopup=t.callbackDispatchers=t.callback=t.botsDispatchers=t.bots=t.appDispatchers=t.app=t.agentsDispatchers=t.agents=void 0;var a=E(n(42932));t.app=a;var o=E(n(77004));t.position=o;var r=E(n(45689));t.callback=r;var i=E(n(27591));t.social=i;var s=E(n(50307));t.user=s;var l=E(n(53139));t.agents=l;var u=E(n(93141));t.chats=u;var c=E(n(5452));t.transition=c;var d=E(n(40099));t.messages=d;var f=E(n(92056));t.client=f;var p=E(n(66031));t.features=p;var h=E(n(13532));t.bots=h;var g=E(n(80429));t.zoom=g;var m=E(n(25925));t.proactive=m;var _=E(n(94539));t.permissions=_;var v=E(n(5597));t.campaignPopup=v;var y=E(n(84219));function b(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(b=function(e){return e?n:t})(e)}function E(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=b(t);if(n&&n.has(e))return n.get(e);var a={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var r in e)if("default"!==r&&Object.prototype.hasOwnProperty.call(e,r)){var i=o?Object.getOwnPropertyDescriptor(e,r):null;i&&(i.get||i.set)?Object.defineProperty(a,r,i):a[r]=e[r]}return a.default=e,n&&n.set(e,a),a}t.designer=y;const T=a.dispatchers;t.appDispatchers=T;const C=o.dispatchers;t.positionDispatchers=C;const O=r.dispatchers;t.callbackDispatchers=O;const S=i.dispatchers;t.socialDispatchers=S;const w=s.dispatchers;t.userDispatchers=w;const A=l.dispatchers;t.agentsDispatchers=A;const I=u.dispatchers;t.chatsDispatchers=I;const M=c.dispatchers;t.transitionDispatchers=M;const P=d.dispatchers;t.messagesDispatchers=P;const R=f.dispatchers;t.clientDispatchers=R;const k=p.dispatchers;t.featuresDispatchers=k;const N=h.dispatchers;t.botsDispatchers=N;const D=g.dispatchers;t.zoomDispatchers=D;const x=m.dispatchers;t.proactiveDispatchers=x;const L=_.dispatchers;t.permissionsDispatchers=L;const j=v.dispatchers;t.campaignPopupDispatchers=j;const B=y.dispatchers;t.designerDispatchers=B},40099:function(e,t,n){"use strict";var a=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.updateWebRTCCallStatus=t.updateMessages=t.updateMessageBody=t.updateMessage=t.initializeMessagesStore=t.editMessage=t.dispatchers=t.destroyByType=t.deleteMessageByPrivateId=t.addMessages=t.addMessage=void 0;var o=n(2036),r=n(62096),i=n(15857),s=a(n(14264));const l=()=>{const e=s.default.getAll().map((e=>e.store));return{type:o.ActionType.INIT_MESSAGES_STORE,payload:{messages:e}}};t.initializeMessagesStore=l;const u=(e,t)=>{let n=e;return t||(n=s.default.push(n).store),{type:o.ActionType.ADD_MESSAGE,payload:{message:n}}};t.addMessage=u;const c=e=>(s.default.pushAll(e),{type:o.ActionType.ADD_MESSAGES,payload:{messages:e}});t.addMessages=c;const d=e=>({type:o.ActionType.EDIT_MESSAGE,payload:e});t.editMessage=d;const f=(e,t)=>{const n=s.default.getMessageByPrivateId(e);return n&&n.set("body",t),{type:o.ActionType.UPDATE_MESSAGE_BODY,payload:{privateId:e,body:t}}};t.updateMessageBody=f;const p=(e,t)=>{let n=e.privateId,a=e.messageId;const r=n?s.default.getMessageByPrivateId(n):s.default.getMessageById(a);return r&&r.set(t),{type:o.ActionType.UPDATE_MESSAGE,payload:{privateId:n,messageId:a,newMessage:t}}};t.updateMessage=p;const h=(e,t)=>{let n=e.privateIds,a=e.messageIds;return s.default.getCurrentChatMessages().forEach((e=>{const o=e.toJSON(),r=o.msg_id,i=o.private_id;n&&n.includes(i)&&e.set(t),a&&a.includes(r)&&e.set(t)})),{type:o.ActionType.UPDATE_MESSAGES,payload:{privateIds:n,messageIds:a,update:t}}};t.updateMessages=h;const g=e=>{const t=s.default.getMessageByPrivateId(e);return t&&t.destroy(),{type:o.ActionType.DELETE_MESSAGE,payload:{privateId:e}}};t.deleteMessageByPrivateId=g;const m=e=>{const t=s.default.getMessagesByType(e);return t.length&&t.forEach((e=>{e&&e.destroy()})),{type:o.ActionType.DELETE_MESSAGE,payload:{type:e}}};t.destroyByType=m;const _=(e,t)=>{const n=s.default.getMessageByPrivateId(e);return n&&n.set("body",{webRTCCallStatus:t}),{type:o.ActionType.UPDATE_WEBRTCCALL_STATUS,payload:{privateId:e||null,webRTCCallStatus:t}}};t.updateWebRTCCallStatus=_;const v={initializeMessagesStore:(0,i.bindActionCreators)(l,r.reduxStore.dispatch),addMessage:(0,i.bindActionCreators)(u,r.reduxStore.dispatch),addMessages:(0,i.bindActionCreators)(c,r.reduxStore.dispatch),editMessage:(0,i.bindActionCreators)(d,r.reduxStore.dispatch),updateMessageBody:(0,i.bindActionCreators)(f,r.reduxStore.dispatch),deleteMessageByPrivateId:(0,i.bindActionCreators)(g,r.reduxStore.dispatch),destroyByType:(0,i.bindActionCreators)(m,r.reduxStore.dispatch),updateWebRTCCallStatus:(0,i.bindActionCreators)(_,r.reduxStore.dispatch),updateMessage:(0,i.bindActionCreators)(p,r.reduxStore.dispatch),updateMessages:(0,i.bindActionCreators)(h,r.reduxStore.dispatch)};t.dispatchers=v},94539:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.updatePermission=t.dispatchers=void 0;var a=n(2036),o=n(62096),r=n(15857);const i=(e,t)=>({type:a.ActionType.UPDATE_PERMISSION,payload:{permission:e,value:t}});t.updatePermission=i;const s={updatePermission:(0,r.bindActionCreators)(i,o.reduxStore.dispatch)};t.dispatchers=s},77004:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setWidgetPositionRight=t.setWidgetPositionLeft=t.setWidgetPositionHeight=t.initializePositionStore=t.dispatchers=void 0;var a=n(2036),o=n(62096),r=n(15857);const i=e=>{let t=e.height,n=e.left,o=e.right;return{type:a.ActionType.INIT_POSITION_STORE,payload:{height:t,left:n,right:o}}};t.initializePositionStore=i;const s=e=>({type:a.ActionType.CHANGE_POSITION_HEIGHT,payload:{height:e}});t.setWidgetPositionHeight=s;const l=e=>({type:a.ActionType.CHANGE_POSITION_LEFT,payload:{left:e}});t.setWidgetPositionLeft=l;const u=e=>({type:a.ActionType.CHANGE_POSITION_RIGHT,payload:{right:e}});t.setWidgetPositionRight=u;const c={initializePositionStore:(0,r.bindActionCreators)(i,o.reduxStore.dispatch),setWidgetPositionHeight:(0,r.bindActionCreators)(s,o.reduxStore.dispatch),setWidgetPositionLeft:(0,r.bindActionCreators)(l,o.reduxStore.dispatch),setWidgetPositionRight:(0,r.bindActionCreators)(u,o.reduxStore.dispatch)};t.dispatchers=c},25925:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setStatus=t.setName=t.dispatchers=t.addProactive=void 0;var a=n(2036),o=n(62096),r=n(15857);const i=e=>{let t=e.createdTs,n=e.name,o=e.privateId,r=e.status,i=e.text,s=e.agentId,l=e.botId,u=e.isMarkdown,c=e.prechats,d=e.campaignId;return{type:a.ActionType.ADD_PROACTIVE,payload:{createdTs:t,name:n,privateId:o,status:r,text:i,agentId:s,botId:l,isMarkdown:u,prechats:c,campaignId:d}}};t.addProactive=i;const s=e=>({type:a.ActionType.SET_PROACTIVE_STATUS,payload:{status:e}});t.setStatus=s;const l=e=>({type:a.ActionType.SET_PROACTIVE_NAME,payload:{name:e}});t.setName=l;const u={addProactive:(0,r.bindActionCreators)(i,o.reduxStore.dispatch),setStatus:(0,r.bindActionCreators)(s,o.reduxStore.dispatch),setName:(0,r.bindActionCreators)(l,o.reduxStore.dispatch)};t.dispatchers=u},27591:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.initializeSocialStore=t.dispatchers=void 0;var a=n(2036),o=n(62096),r=n(15857);const i=e=>{let t=e.vk,n=e.fb,o=e.mode;return{type:a.ActionType.INIT_SOCIAL_STORE,payload:{vk:t,fb:n,mode:o}}};t.initializeSocialStore=i;const s={initializeSocialStore:(0,r.bindActionCreators)(i,o.reduxStore.dispatch)};t.dispatchers=s},5452:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.startTransition=t.initializeTransitionStore=t.dispatchers=void 0;var a=n(2036),o=n(62096),r=n(15857);const i=e=>({type:a.ActionType.INIT_TRANSITION_STORE,payload:e});t.initializeTransitionStore=i;const s=e=>({type:a.ActionType.START_TRANSITION_SCRIPT,payload:{script:e}});t.startTransition=s;const l={initializeTransitionStore:(0,r.bindActionCreators)(i,o.reduxStore.dispatch),startTransition:(0,r.bindActionCreators)(s,o.reduxStore.dispatch)};t.dispatchers=l},50307:function(e,t,n){"use strict";var a=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.setWidgetPadding=t.setWidgetOrientation=t.setWidgetMobileOrientation=t.setWidgetLabelBubble=t.setWidgetFontType=t.setWidgetFontSize=t.setWidgetFontFamily=t.setWidgetFontColor=t.setWidgetColor2=t.setWidgetColor=t.setPrechat=t.setPowerGradient=t.setPowerButtonColor=t.setPattern=t.setOnlineLabel=t.setOfflineLabel=t.setOfflineFormTitle=t.setOfflineFormText=t.setMobileOffsetBottom=t.setCallbackButtonColor=t.setCallHeaderText=t.setBubbleColor=t.dispatchers=void 0;var o=n(2036),r=n(62096),i=n(15857),s=a(n(95003)),l=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=u(t);if(n&&n.has(e))return n.get(e);var a={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var r in e)if("default"!==r&&Object.prototype.hasOwnProperty.call(e,r)){var i=o?Object.getOwnPropertyDescriptor(e,r):null;i&&(i.get||i.set)?Object.defineProperty(a,r,i):a[r]=e[r]}a.default=e,n&&n.set(e,a);return a}(n(1039));function u(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(u=function(e){return e?n:t})(e)}const c=e=>(l.default.widget_color=e,s.default.widget_color=e,{type:o.ActionType.SET_WIDGET_COLOR,payload:{widgetColor:e}});t.setWidgetColor=c;const d=e=>(l.default.widget_color2=e,s.default.widget_color2=e,{type:o.ActionType.SET_WIDGET_COLOR2,payload:{widgetColor2:e}});t.setWidgetColor2=d;const f=e=>(l.default.widget_font_color=e,s.default.widget_font_color=e,{type:o.ActionType.SET_WIDGET_FONT_COLOR,payload:{widgetFontColor:e}});t.setWidgetFontColor=f;const p=e=>(l.default.widget_orientation=e,{type:o.ActionType.SET_WIDGET_ORIENTATION,payload:{widgetOrientation:e}});t.setWidgetOrientation=p;const h=e=>((0,l.setConfigParam)("widget_mobile_orientation",e),{type:o.ActionType.SET_MOBILE_WIDGET_ORIENTATION,payload:{widgetMobileOrientation:e}});t.setWidgetMobileOrientation=h;const g=e=>((0,l.setConfigParam)("mobile_offset_bottom",e),{type:o.ActionType.SET_MOBILE_OFFSET_BOTTOM,payload:{mobileOffsetBottom:e}});t.setMobileOffsetBottom=g;const m=e=>((0,l.setConfigParam)("power_gradient",e?1:0),{type:o.ActionType.SET_POWER_GRADIENT,payload:{powerGradient:!!e||null}});t.setPowerGradient=m;const _=e=>((0,l.setConfigParam)("power_button_color",e),{type:o.ActionType.SET_MOBILE_WIDGET_COLOR,payload:{powerButtonColor:e}});t.setPowerButtonColor=_;const v=e=>{const t=+e;return l.default.widget_padding=t,{type:o.ActionType.SET_WIDGET_PADDING,payload:{widgetPadding:t}}};t.setWidgetPadding=v;const y=e=>(l.default.online_widget_label=e,{type:o.ActionType.SET_ONLINE_WIDGET_LABEL,payload:{onlineWidgetLabel:e}});t.setOnlineLabel=y;const b=e=>(l.default.offline_widget_label=e,{type:o.ActionType.SET_OFFLINE_WIDGET_LABEL,payload:{offlineWidgetLabel:e}});t.setOfflineLabel=b;const E=e=>(l.default.font_size=e,{type:o.ActionType.SET_WIDGET_FONT_SIZE,payload:{fontSize:e}});t.setWidgetFontSize=E;const T=e=>(l.default.font_family=e,{type:o.ActionType.SET_WIDGET_FONT_FAMILY,payload:{fontFamily:e}});t.setWidgetFontFamily=T;const C=e=>(l.default.font_type=e,{type:o.ActionType.SET_WIDGET_FONT_TYPE,payload:{fontType:e}});t.setWidgetFontType=C;const O=e=>({type:o.ActionType.SET_WIDGET_LABEL_BUBBLE,payload:{labelBubble:e}});t.setWidgetLabelBubble=O;const S=e=>(s.default.callText=e,{type:o.ActionType.SET_CALL_HEADER_TEXT,payload:{callHeaderText:e}});t.setCallHeaderText=S;const w=e=>(l.default.pattern=e,{type:o.ActionType.SET_PATTERN,payload:{pattern:e}});t.setPattern=w;const A=e=>(l.default.callback_btn_color=e,{type:o.ActionType.SET_CALLBACK_BUTTON_COLOR,payload:{callbackButtonColor:e}});t.setCallbackButtonColor=A;const I=e=>(l.default.bubble_color=e,{type:o.ActionType.SET_BUBBLE_COLOR,payload:{bubbleColor:e}});t.setBubbleColor=I;const M=e=>(l.default.offline_form_title=e,{type:o.ActionType.SET_OFFLINE_FORM_TITLE,payload:{offlineFormTitle:e}});t.setOfflineFormTitle=M;const P=e=>(l.default.offline_form_text=e,{type:o.ActionType.SET_OFFLINE_FORM_TEXT,payload:{offlineFormText:e}});t.setOfflineFormText=P;const R=e=>(l.default.prechat=e,{type:o.ActionType.SET_PRECHAT,payload:{prechat:e}});t.setPrechat=R;const k={setWidgetColor:(0,i.bindActionCreators)(c,r.reduxStore.dispatch),setWidgetColor2:(0,i.bindActionCreators)(d,r.reduxStore.dispatch),setWidgetFontColor:(0,i.bindActionCreators)(f,r.reduxStore.dispatch),setWidgetOrientation:(0,i.bindActionCreators)(p,r.reduxStore.dispatch),setWidgetMobileOrientation:(0,i.bindActionCreators)(h,r.reduxStore.dispatch),setMobileOffsetBottom:(0,i.bindActionCreators)(g,r.reduxStore.dispatch),setPowerGradient:(0,i.bindActionCreators)(m,r.reduxStore.dispatch),setPowerButtonColor:(0,i.bindActionCreators)(_,r.reduxStore.dispatch),setWidgetPadding:(0,i.bindActionCreators)(v,r.reduxStore.dispatch),setOnlineLabel:(0,i.bindActionCreators)(y,r.reduxStore.dispatch),setOfflineLabel:(0,i.bindActionCreators)(b,r.reduxStore.dispatch),setWidgetFontSize:(0,i.bindActionCreators)(E,r.reduxStore.dispatch),setWidgetFontFamily:(0,i.bindActionCreators)(T,r.reduxStore.dispatch),setWidgetFontType:(0,i.bindActionCreators)(C,r.reduxStore.dispatch),setWidgetLabelBubble:(0,i.bindActionCreators)(O,r.reduxStore.dispatch),setCallHeaderText:(0,i.bindActionCreators)(S,r.reduxStore.dispatch),setPattern:(0,i.bindActionCreators)(w,r.reduxStore.dispatch),setCallbackButtonColor:(0,i.bindActionCreators)(A,r.reduxStore.dispatch),setBubbleColor:(0,i.bindActionCreators)(I,r.reduxStore.dispatch),setOfflineFormTitle:(0,i.bindActionCreators)(M,r.reduxStore.dispatch),setOfflineFormText:(0,i.bindActionCreators)(P,r.reduxStore.dispatch),setPrechat:(0,i.bindActionCreators)(R,r.reduxStore.dispatch)};t.dispatchers=k},80429:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.initializeZoomStore=t.dispatchers=void 0;var a=n(2036),o=n(62096),r=n(15857);const i=e=>{let t=e.user,n=e.page,o=e.app;return{type:a.ActionType.INIT_ZOOM_STORE,payload:{user:t,page:n,app:o}}};t.initializeZoomStore=i;const s={initializeZoomStore:(0,r.bindActionCreators)(i,o.reduxStore.dispatch)};t.dispatchers=s},2036:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActionType=void 0;t.ActionType={DO_NOTHING:"DO_NOTHING",INIT_POSITION_STORE:"INIT_POSITION_STORE",CHANGE_POSITION_HEIGHT:"CHANGE_POSITION_HEIGHT",CHANGE_POSITION_LEFT:"CHANGE_POSITION_LEFT",CHANGE_POSITION_RIGHT:"CHANGE_POSITION_RIGHT",INIT_CALLBACK_STORE:"INIT_CALLBACK_STORE",SET_CALL_AVAILABLE:"SET_CALL_AVAILABLE",SET_DELAYED_CALL_STATUS:"SET_DELAYED_CALL_STATUS",SET_CALL_IS_DELAYED:"SET_CALL_IS_DELAYED",SET_CALL_STATUS:"SET_CALL_STATUS",SET_CALL_ERROR:"SET_CALL_ERROR",SET_DELAYED_TIMEZONE:"SET_DELAYED_TIMEZONE",SET_DELAYED_PERIODS:"SET_DELAYED_PERIODS",SET_ACTIVE_WEBRTC_MESSAGE_ID:"SET_ACTIVE_WEBRTC_MESSAGE_ID",SET_WEBRTC_CALL_STATUS:"SET_WEBRTC_CALL_STATUS",UPDATE_CALLBACK_STORE:"UPDATE_CALLBACK_STORE",INIT_SOCIAL_STORE:"INIT_SOCIAL_STORE",INIT_APP_STORE:"INIT_APP_STORE",SET_APP_IS_ONLINE:"SET_APP_IS_ONLINE",SET_APP_IS_FOCUSED:"SET_APP_IS_FOCUSED",SET_APP_ROUTE:"SET_APP_ROUTE",SET_LAST_CHAT_OPENED:"SET_LAST_CHAT_OPENED",SET_IS_IN_DRAG:"SET_IS_IN_DRAG",SET_IS_CONTACT_FORM_FOCUSED:"SET_IS_CONTACT_FORM_FOCUSED",SET_IS_INPUT_DISABLED:"SET_IS_INPUT_DISABLED",SET_MAINTENANCE:"SET_MAINTENANCE",SET_CHAT_OPEN_BY_CLIENT:"SET_CHAT_OPEN_BY_CLIENT",UPDATE_APP_STORE:"UPDATE_APP_STORE",SET_LAST_CHAT_STATUS:"SET_LAST_CHAT_STATUS",SET_WIDGET_COLOR:"SET_WIDGET_COLOR",SET_WIDGET_COLOR2:"SET_WIDGET_COLOR2",SET_WIDGET_FONT_COLOR:"SET_WIDGET_FONT_COLOR",SET_WIDGET_ORIENTATION:"SET_WIDGET_ORIENTATION",SET_WIDGET_PADDING:"SET_WIDGET_PADDING",SET_ONLINE_WIDGET_LABEL:"SET_ONLINE_WIDGET_LABEL",SET_OFFLINE_WIDGET_LABEL:"SET_OFFLINE_WIDGET_LABEL",SET_WIDGET_FONT_SIZE:"SET_WIDGET_FONT_SIZE",SET_WIDGET_FONT_FAMILY:"SET_WIDGET_FONT_FAMILY",SET_WIDGET_FONT_TYPE:"SET_WIDGET_FONT_TYPE",SET_CALL_HEADER_TEXT:"SET_CALL_HEADER_TEXT",SET_PATTERN:"SET_PATTERN",SET_CALLBACK_BUTTON_COLOR:"SET_CALLBACK_BUTTON_COLOR",SET_BUBBLE_COLOR:"SET_BUBBLE_COLOR",SET_WIDGET_LABEL_BUBBLE:"SET_WIDGET_LABEL_BUBBLE",SET_PRECHAT:"SET_PRECHAT",SET_POWER_GRADIENT:"SET_POWER_GRADIENT",SET_MOBILE_OFFSET_BOTTOM:"SET_MOBILE_OFFSET_BOTTOM",SET_MOBILE_WIDGET_ORIENTATION:"SET_MOBILE_WIDGET_ORIENTATION",SET_MOBILE_WIDGET_COLOR:"SET_MOBILE_WIDGET_COLOR",INIT_AGENTS_STORE:"INIT_AGENTS_STORE",ADD_AGENT:"ADD_AGENT",UPDATE_AGENT:"UPDATE_AGENT",SET_ALL_AGENTS_LEFT:"SET_ALL_AGENTS_LEFT",INIT_BOTS_STORE:"INIT_BOTS_STORE",ADD_BOT:"ADD_BOT",INIT_CHATS_STORE:"INIT_CHATS_STORE",START_CHAT:"START_CHAT",CLOSE_CHAT:"CLOSE_CHAT",SET_JOINED_AGENTS_IN_CURRENT_CHAT:"SET_JOINED_AGENTS_IN_CURRENT_CHAT",ADD_JOINED_AGENT_TO_CURRENT_CHAT:"ADD_JOINED_AGENT_TO_CURRENT_CHAT",REMOVE_AGENT_FROM_CURRENT_CHAT:"REMOVE_AGENT_FROM_CHAT",SET_CURRENT_CHAT_EVALUATED:"SET_CHAT_EVALUATED",SET_AGENT_TYPING:"SET_AGENT_TYPING",SET_CURRENT_CHAT_DEPARTMENT_ID:"SET_CHAT_DEPARTMENT_ID",SET_JOINED_BOTS:"SET_JOINED_BOTS",UPDATE_CHATS_STORE:"UPDATE_CHATS_STORE",INIT_TRANSITION_STORE:"INIT_TRANSITION_STORE",START_TRANSITION_SCRIPT:"START_TRANSITION_SCRIPT",CONTINUE_TRANSITION_SCRIPT:"CONTINUE_TRANSITION_SCRIPT",STOP_TRANSITION_SCRIPT:"STOP_TRANSITION_SCRIPT",RESET_TRANSITON_SCRIPT:"RESET_TRANSITON_SCRIPT",INIT_MESSAGES_STORE:"INIT_MESSAGES_STORE",ADD_MESSAGE:"ADD_MESSAGE",ADD_MESSAGES:"ADD_MESSAGES",EDIT_MESSAGE:"EDIT_MESSAGE",DELETE_MESSAGE:"DELETE_MESSAGE",UPDATE_MESSAGE_BODY:"UPDATE_MESSAGE_BODY",UPDATE_MESSAGE_STATUS:"UPDATE_MESSAGE_STATUS",UPDATE_MESSAGE:"UPDATE_MESSAGE",UPDATE_MESSAGES:"UPDATE_MESSAGES",SET_OFFLINE_FORM_TITLE:"SET_OFFLINE_FORM_TITLE",SET_OFFLINE_FORM_TEXT:"SET_OFFLINE_FORM_TEXT",UPDATE_CLIENT_STORE:"UPDATE_CLIENT_STORE",UPDATE_CLIENT_STORE_MANUALLY:"UPDATE_CLIENT_STORE_MANUALLY",RESET_CLIENT_STORE:"RESET_CLIENT_STORE",SET_DISABLE_FILETRANSFER:"SET_DISABLE_FILETRANSFER",SET_ENABLE_PRECHAT:"SET_ENABLE_PRECHAT",INIT_ZOOM_STORE:"INIT_ZOOM_STORE",ADD_PROACTIVE:"ADD_PROACTIVE",SET_PROACTIVE_STATUS:"SET_PROACTIVE_STATUS",SET_PROACTIVE_NAME:"SET_PROACTIVE_NAME",UPDATE_WEBRTCCALL_STATUS:"UPDATE_WEBRTCCALL_STATUS",UPDATE_PERMISSION:"UPDATE_PERMISSION",UPDATE_CAMPAIGN_POPUP_CONFIG:"UPDATE_CAMPAIGN_POPUP_CONFIG",RESET_CAMPAIGN_POPUP_CONFIG:"RESET_CAMPAIGN_POPUP_CONFIG",UPDATE_DESIGNER_SETTINGS:"UPDATE_DESIGNER_SETTINGS"}},79156:function(e,t,n){"use strict";var a=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.storesMap=t.readoptReduxToClientStorage=t.adoptClientStorageToRedux=void 0;var o=a(n(61125)),r=n(28650),i=n(46322),s=n(71047),l=n(42344),u=n(34014);function c(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function d(e){for(var t=1;t{f.warn("ADOPT_CLIENT_STORAGE_TO_REDUX",{data:e,keysSet:t});const n=h[t],a=n.keys,o=n.initialState;if(!e)return o;const s={};for(const t in a){const n=a[t];var l;if((0,i.isObject)(n))for(const a in n)e[t]&&(0,r.hasOwn)(e[t],a)?s[n[a]]=e[t][a]:s[n[a]]=null;else s[n]=null!==(l=e[t])&&void 0!==l?l:o[n]}return s};t.readoptReduxToClientStorage=(e,t)=>{f.warn("READOPT_CLIENT_STORAGE_TO_REDUX",{data:e,keysSet:t});const n=d({},e),a=h[t].keys;for(const t in a){const o=a[t];if((0,i.isObject)(o))for(const a in o)n[t]=d(d({},n[t]),{},{[a]:e[o[a]]}),delete n[o[a]];else n[t]=e[o],t!==o&&delete n[o]}return n}},91133:function(e,t,n){"use strict";var a=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.mergeSafety=void 0;var o=a(n(61125)),r=n(98986);function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}t.mergeSafety=(e,t)=>Object.keys(t).reduce(((e,n)=>{const a=t[n];return(0,r.isNull)(a)||(e[n]=a),e}),function(e){for(var t=1;tt=>n=>{u.warn("DISPATCHING",n);const a=t(n);return i.default.getInstance()&&i.default.getInstance().saveReduxAction(l(l({},n),{},{ts:(new Date).getTime()})),u.warn("NEXT_STATE",e.getState()),a}},68031:function(e,t,n){"use strict";var a=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.subscribeOnStorage=t.statesToPersist=t.persistMiddleware=void 0;var o=n(16016),r=n(2036),i=n(79156),s=n(39715),l=n(71047),u=n(44733),c=a(n(1039)),d=n(55004);const f=u.StorageProvider.createKeyForStore(l.STORAGED_ID.POSITION),p=u.StorageProvider.createKeyForStore(l.STORAGED_ID.CLIENT),h={[l.STORAGED_ID.POSITION]:{storageKey:f,path:"position",onAdapter:null,onReadapter:null,onUpdate:null},[l.STORAGED_ID.CLIENT]:{storageKey:p,path:"client",onAdapter:e=>(0,i.adoptClientStorageToRedux)(e,l.STORAGED_ID.CLIENT),onReadapter:e=>(0,i.readoptReduxToClientStorage)(e,l.STORAGED_ID.CLIENT),onUpdate:e=>{c.default.cookie_domain&&u.StorageProvider.duplicateClientStateInCookie(e)}},[l.STORAGED_ID.CALLBACK]:{storageKey:p,path:"callback",onAdapter:e=>(0,i.adoptClientStorageToRedux)(e,l.STORAGED_ID.CALLBACK),onReadapter:e=>(0,i.readoptReduxToClientStorage)(e,l.STORAGED_ID.CALLBACK),onUpdate:null}};t.statesToPersist=h;const g={[r.ActionType.INIT_POSITION_STORE]:h[l.STORAGED_ID.POSITION],[r.ActionType.UPDATE_CLIENT_STORE]:h[l.STORAGED_ID.CLIENT],[r.ActionType.UPDATE_CLIENT_STORE_MANUALLY]:h[l.STORAGED_ID.CLIENT],[r.ActionType.RESET_CLIENT_STORE]:h[l.STORAGED_ID.CLIENT],[r.ActionType.UPDATE_CALLBACK_STORE]:h[l.STORAGED_ID.CALLBACK]};t.persistMiddleware=e=>t=>n=>{if(t(n),n.type===r.ActionType.SET_DID_FREEZE_DATA&&!0===n.payload.didFreezeData)return Object.values(h).forEach((e=>{let t=e.storageKey;return u.StorageProvider.remove(t)}));n.type===r.ActionType.RESET_CLIENT_STORE&&u.StorageProvider.remove(h[l.STORAGED_ID.CLIENT].storageKey);const a=e.getState();if(n.type in g&&!a.app.didFreezeData){const e=g[n.type],t=e.storageKey,o=e.path,r=e.onReadapter,i=e.onUpdate,l=(0,s.get)(a,o),c=u.StorageProvider.get(t),d=Object.assign({},c,r?r(l):l);u.StorageProvider.set(t,d),null==i||i(d);const f=v(n.type);u.StorageProvider.set(m,f)}};const m="sync",_=(0,o.generateGUID)(),v=e=>({actionType:e,sourceId:_,time:Date.now()});t.subscribeOnStorage=e=>{window.addEventListener("storage",(e=>t=>{let n=t.key;if((0,u.isJvKeyForStoreToGet)(n)){const t=u.StorageProvider.get(m);if(t&&t.sourceId!==_){const n=g[t.actionType],a=n.storageKey,o=n.onAdapter,r=u.StorageProvider.get(a);e.dispatch({type:t.actionType,payload:(0,d.isFunction)(o)?o(r):r})}}})(e))}},57157:function(e,t,n){"use strict";var a=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:u,t=arguments.length>1?arguments[1]:void 0;const n=t.type,a=t.payload;switch(n){case i.ActionType.INIT_AGENTS_STORE:if(a&&a.length){const e=a.filter((e=>!e.isBot));return(0,r.default)(e)}return(0,r.default)(e);case i.ActionType.ADD_AGENT:if(a){return e.find((e=>e.id===a.id))?e.map((e=>e.id===a.id?l(l({},e),a):e)):[].concat((0,r.default)(e),[l({},a)])}return(0,r.default)(e);case i.ActionType.UPDATE_AGENT:return a?e.map((e=>e.id===a.id?l(l({},e),a):e)):(0,r.default)(e);case i.ActionType.SET_ALL_AGENTS_LEFT:return e.map((e=>l(l({},e),{},{state:"left"})));default:return e}};var o=a(n(61125)),r=a(n(15687)),i=n(2036);function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function l(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:l,t=arguments.length>1?arguments[1]:void 0;const n=t.type,a=t.payload;switch(n){case r.ActionType.INIT_APP_STORE:return{isFocused:a.isFocused,isOnline:!!a.isOnline,route:a.route,tabRoute:a.tabRoute,lastChatOpened:a.lastChatOpened,isInDrag:a.isInDrag,isContactFormFocused:a.isContactFormFocused,isInputDisabled:a.isInputDisabled,maintenance:a.maintenance,chatOpenByClient:a.chatOpenByClient,chatStarted:a.chatStarted,chatAccepted:a.chatAccepted,lastMsgId:a.lastMsgId,lastMsgTime:a.lastMsgTime,started:a.started,showEula:a.showEula,viReconnectTime:a.viReconnectTime,didFreezeData:a.didFreezeData,lastChatStatus:a.lastChatStatus};case r.ActionType.SET_APP_IS_ONLINE:return s(s({},e),{},{isOnline:a.isOnline});case r.ActionType.SET_APP_IS_FOCUSED:return s(s({},e),{},{isFocused:a.isFocused});case r.ActionType.SET_CHAT_OPEN_BY_CLIENT:return s(s({},e),{},{chatOpenByClient:a.chatOpenByClient});case r.ActionType.SET_APP_ROUTE:return s(s({},e),{},{route:a.route});case r.ActionType.SET_LAST_CHAT_OPENED:return s(s({},e),{},{lastChatOpened:a.lastChatOpened});case r.ActionType.SET_IS_IN_DRAG:return s(s({},e),{},{isInDrag:a.isInDrag});case r.ActionType.SET_IS_CONTACT_FORM_FOCUSED:return s(s({},e),{},{isContactFormFocused:a.isContactFormFocused});case r.ActionType.SET_IS_INPUT_DISABLED:return s(s({},e),{},{isInputDisabled:a.isInputDisabled});case r.ActionType.SET_MAINTENANCE:return s(s({},e),{},{maintenance:a.maintenance});case r.ActionType.SET_LAST_CHAT_STATUS:return s(s({},e),{},{lastChatStatus:a.lastChatStatus});case r.ActionType.UPDATE_APP_STORE:return s(s({},e),a);default:return e}};var o=a(n(61125)),r=n(2036);function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function s(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:u,t=arguments.length>1?arguments[1]:void 0;const n=t.type,a=t.payload;switch(n){case i.ActionType.INIT_BOTS_STORE:if(a&&a.length){const e=a.filter((e=>e.isBot));return(0,r.default)(e)}return(0,r.default)(e);case i.ActionType.ADD_BOT:if(a){return e.find((e=>e.id===a.id))?e.map((e=>e.id===a.id?l(l({},e),a):e)):[].concat((0,r.default)(e),[l({},a)])}return(0,r.default)(e);default:return e}};var o=a(n(61125)),r=a(n(15687)),i=n(2036);function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function l(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:l,t=arguments.length>1?arguments[1]:void 0;const n=t.type,a=t.payload;if(n===r.ActionType.UPDATE_CALLBACK_STORE)return s(s({},e),a);return e},t.initialState=void 0;var o=a(n(61125)),r=n(2036);function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function s(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:c,t=arguments.length>1?arguments[1]:void 0;const n=t.type,a=t.payload;switch(n){case i.ActionType.INIT_CHATS_STORE:return a;case i.ActionType.SET_JOINED_AGENTS_IN_CURRENT_CHAT:return e.map(u((e=>{var t;return l(l({},e),{},{joinedAgents:null!==(t=a.joinedAgents)&&void 0!==t?t:[]})})));case i.ActionType.SET_JOINED_BOTS:return e.map(u((e=>{var t;return l(l({},e),{},{joinedBots:null!==(t=a.joinedBots)&&void 0!==t?t:[]})})));case i.ActionType.ADD_JOINED_AGENT_TO_CURRENT_CHAT:return a.agentId<0?e:e.map(u((e=>e.joinedAgents.includes(a.agentId)?e:l(l({},e),{},{joinedAgents:[].concat((0,o.default)(e.joinedAgents),[a.agentId])}))));case i.ActionType.SET_AGENT_TYPING:return e.map(u((e=>l(l({},e),{},{agentTyping:a.agentTyping}))));case i.ActionType.SET_CURRENT_CHAT_EVALUATED:return e.map(u((e=>l(l({},e),{},{evaluated:a.evaluated}))));case i.ActionType.CLOSE_CHAT:return e.map(u((e=>l(l({},e),{},{joinedAgents:[]}))));default:return e}};var o=a(n(15687)),r=a(n(61125)),i=n(2036);function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function l(e){for(var t=1;t(t,n,a)=>n!==a.length-1?t:e(t),c=[]},34014:function(e,t,n){"use strict";var a=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:u,t=arguments.length>1?arguments[1]:void 0;const n=t.type,a=t.payload;switch(n){case r.ActionType.UPDATE_CLIENT_STORE:return(0,i.mergeSafety)(e,a);case r.ActionType.UPDATE_CLIENT_STORE_MANUALLY:return l(l({},e),a);case r.ActionType.RESET_CLIENT_STORE:return u;default:return e}},t.initialState=void 0;var o=a(n(61125)),r=n(2036),i=n(91133);function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function l(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:u,t=arguments.length>1?arguments[1]:void 0;const n=t.type,a=t.payload;switch(n){case i.ActionType.INIT_MESSAGES_STORE:return a.messages?(0,r.default)(a.messages):(0,r.default)(e);case i.ActionType.ADD_MESSAGE:return a.message?[].concat((0,r.default)(e),[a.message]):(0,r.default)(e);case i.ActionType.ADD_MESSAGES:return a.messages&&a.messages.length?[].concat((0,r.default)(e),(0,r.default)(a.messages)):(0,r.default)(e);case i.ActionType.UPDATE_MESSAGE_BODY:return a.privateId&&a.body?(0,r.default)(e.map((e=>e.private_id===a.privateId?l(l({},e),{},{body:a.body}):e))):(0,r.default)(e);case i.ActionType.UPDATE_MESSAGE:return e.map((e=>a.messageId&&e.msg_id===a.messageId||a.privateId&&e.private_id===a.privateId?l(l({},e),a.newMessage):e));case i.ActionType.UPDATE_MESSAGES:return e.map((e=>a.messageIds&&a.messageIds.includes(e.msg_id)||a.privateIds&&a.privateIds.includes(e.private_id)?l(l({},e),a.update):e));case i.ActionType.EDIT_MESSAGE:case i.ActionType.DELETE_MESSAGE:return(0,r.default)(e);case i.ActionType.UPDATE_WEBRTCCALL_STATUS:return a.privateId&&a.webRTCCallStatus?(0,r.default)(e.map((e=>e.private_id===a.privateId?l(l({},e),{},{body:l(l({},e.body),{},{webRTCCallStatus:a.webRTCCallStatus})}):e))):(0,r.default)(e);default:return e}};var o=a(n(61125)),r=a(n(15687)),i=n(2036);function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function l(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:l,t=arguments.length>1?arguments[1]:void 0;const n=t.type,a=t.payload;switch(n){case r.ActionType.INIT_POSITION_STORE:return{height:a?a.height:e.height,left:a?a.left:e.left,right:a?a.right:e.right};case r.ActionType.CHANGE_POSITION_HEIGHT:return s(s({},e),{},{height:a?a.height:e.height});case r.ActionType.CHANGE_POSITION_LEFT:return s(s({},e),{},{left:a?a.left:e.left});case r.ActionType.CHANGE_POSITION_RIGHT:return s(s({},e),{},{right:a?a.right:e.right});default:return e}};var o=a(n(61125)),r=n(2036);function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function s(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:l,t=arguments.length>1?arguments[1]:void 0;const n=t.type,a=t.payload;switch(n){case r.ActionType.ADD_PROACTIVE:return a?{text:a.text||null,name:a.name||null,createdTs:a.createdTs||null,privateId:a.privateId||null,status:a.status||null,agentId:a.agentId||null,botId:a.botId||null,isMarkdown:a.isMarkdown||null,prechats:a.prechats||null,campaignId:a.campaignId||null}:e;case r.ActionType.SET_PROACTIVE_STATUS:return s(s({},e),{},{status:a.status});case r.ActionType.SET_PROACTIVE_NAME:return s(s({},e),{},{name:a.name});default:return e}},t.initialState=void 0;var o=a(n(61125)),r=n(2036);function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function s(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:l,t=arguments.length>1?arguments[1]:void 0;const n=t.type,a=t.payload;switch(n){case r.ActionType.UPDATE_CAMPAIGN_POPUP_CONFIG:return s(s({},e),a);case r.ActionType.RESET_CAMPAIGN_POPUP_CONFIG:return l;default:return e}}},49437:function(e,t,n){"use strict";var a=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.designer=void 0;var o=a(n(61125)),r=n(2036);function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function s(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:l,t=arguments.length>1?arguments[1]:void 0;const n=t.type,a=t.payload;return n===r.ActionType.UPDATE_DESIGNER_SETTINGS?s(s({},e),a):e}},37480:function(e,t,n){"use strict";var a=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.features=void 0;var o=a(n(61125)),r=n(2036),i=a(n(1039));function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function l(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:d,t=arguments.length>1?arguments[1]:void 0;const n=t.type,a=t.payload;switch(n){case r.ActionType.SET_DISABLE_FILETRANSFER:return l(l({},e),{},{disableFiletransfer:a.disableFiletransfer});case r.ActionType.SET_ENABLE_PRECHAT:return l(l({},e),{},{prechat:a.prechat});default:return e}}},77620:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=n(15857),o=n(37480),r=n(91444),i=n(78634),s=n(6511),l=n(27239),u=n(49437),c=(0,a.combineReducers)({features:o.features,system:r.system,user:i.user,permissions:s.permissions,campaignPopup:l.campaignPopup,designer:u.designer});t.default=c},6511:function(e,t,n){"use strict";var a=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.permissions=void 0;var o=a(n(61125)),r=n(2036),i=n(62168);function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function l(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:u,t=arguments.length>1?arguments[1]:void 0;const n=t.type,a=t.payload;return n===r.ActionType.UPDATE_PERMISSION?l(l({},e),{},{[a.permission]:a.value}):l({},e)}},91444:function(e,t,n){"use strict";var a=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.system=void 0;var o=a(n(1039));const r={abSegment:o.default.ab_segment||null,apiDomain:o.default.api_domain||null,apiHost:o.default.api_host||null,avatarUrl:o.default.avatar_url||null,baseUrl:o.default.base_url||null,botmode:!!o.default.botmode||null,buildNumber:o.default.build_number||null,chatHost:o.default.chat_host,configUpdatedTs:o.default.config_updated_ts||null,cookieDomain:o.default.cookie_domain||null,geoIp:o.default.geoip||null,hostBlacklist:o.default.host_blacklist||null,premium:o.default.options||null,siteId:o.default.site_id||null,telHost:o.default.telHost||null,unverified:o.default.unverified||null,viHost:o.default.vi_host||null,widgetId:o.default.widget_id||null,billRu:!!o.default.bill_ru,eula:o.default.eula||null};t.system=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:r,t=arguments.length>1?arguments[1]:void 0;t.type,t.payload;return e}},78634:function(e,t,n){"use strict";var a=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.user=void 0;var o,r=a(n(61125)),i=n(2036),s=a(n(1039)),l=a(n(84726));function u(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function c(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:d,t=arguments.length>1?arguments[1]:void 0;const n=t.type,a=t.payload;switch(n){case i.ActionType.SET_WIDGET_COLOR:return c(c({},e),{},{widgetColor:a.widgetColor});case i.ActionType.SET_WIDGET_COLOR2:return c(c({},e),{},{widgetColor2:a.widgetColor2});case i.ActionType.SET_WIDGET_FONT_COLOR:return c(c({},e),{},{widgetFontColor:a.widgetFontColor});case i.ActionType.SET_WIDGET_ORIENTATION:return c(c({},e),{},{widgetOrientation:a.widgetOrientation});case i.ActionType.SET_MOBILE_WIDGET_ORIENTATION:return c(c({},e),{},{widgetMobileOrientation:a.widgetMobileOrientation});case i.ActionType.SET_MOBILE_OFFSET_BOTTOM:return c(c({},e),{},{mobileOffsetBottom:a.mobileOffsetBottom});case i.ActionType.SET_POWER_GRADIENT:return c(c({},e),{},{powerGradient:a.powerGradient});case i.ActionType.SET_MOBILE_WIDGET_COLOR:return c(c({},e),{},{powerButtonColor:a.powerButtonColor});case i.ActionType.SET_WIDGET_PADDING:return c(c({},e),{},{widgetPadding:a.widgetPadding});case i.ActionType.SET_ONLINE_WIDGET_LABEL:return c(c({},e),{},{onlineWidgetLabel:a.onlineWidgetLabel});case i.ActionType.SET_OFFLINE_WIDGET_LABEL:return c(c({},e),{},{offlineWidgetLabel:a.offlineWidgetLabel});case i.ActionType.SET_WIDGET_FONT_FAMILY:return c(c({},e),{},{fontFamily:a.fontFamily});case i.ActionType.SET_WIDGET_FONT_SIZE:return c(c({},e),{},{fontSize:a.fontSize});case i.ActionType.SET_WIDGET_FONT_TYPE:return c(c({},e),{},{fontType:a.fontType});case i.ActionType.SET_CALL_HEADER_TEXT:return c(c({},e),{},{callHeaderText:a.callHeaderText});case i.ActionType.SET_PATTERN:return c(c({},e),{},{pattern:a.pattern});case i.ActionType.SET_CALLBACK_BUTTON_COLOR:return c(c({},e),{},{callbackButtonColor:a.callbackButtonColor});case i.ActionType.SET_BUBBLE_COLOR:return c(c({},e),{},{bubbleColor:a.bubbleColor});case i.ActionType.SET_WIDGET_LABEL_BUBBLE:return c(c({},e),{},{labelBubble:a.labelBubble});case i.ActionType.SET_OFFLINE_FORM_TITLE:return c(c({},e),{},{offlineFormTitle:a.offlineFormTitle});case i.ActionType.SET_OFFLINE_FORM_TEXT:return c(c({},e),{},{offlineFormText:a.offlineFormText});case i.ActionType.SET_PRECHAT:return c(c({},e),{},{prechat:a.prechat});default:return e}}},78135:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:o,t=arguments.length>1?arguments[1]:void 0;const n=t.type,r=t.payload;if(n===a.ActionType.INIT_SOCIAL_STORE)return r?{vk:r.vk||null,fb:r.fb||null,mode:r.mode||null}:e;return e};var a=n(2036);const o={vk:null,fb:null,mode:null}},31147:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:o,t=arguments.length>1?arguments[1]:void 0;const n=t.type,r=t.payload;switch(n){case a.ActionType.INIT_TRANSITION_STORE:return{currentScript:r&&r.currentScript||null};case a.ActionType.START_TRANSITION_SCRIPT:return{currentScript:r&&r.script||e.currentScript};default:return e}},t.initialState=void 0;var a=n(2036);const o={currentScript:null};t.initialState=o},40289:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:o,t=arguments.length>1?arguments[1]:void 0;const n=t.type,r=t.payload;if(n===a.ActionType.INIT_ZOOM_STORE)return r?{user:r.user||null,page:r.page||null,app:r.app||null}:e;return e};var a=n(2036);const o={user:null,page:null,app:null}},99258:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.selectAgents=t.selectAgentById=void 0;const n=e=>e.agents;t.selectAgents=n;t.selectAgentById=(e,t)=>n(e).find((e=>e.id===t))},35233:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.selectShowEula=t.selectRoute=t.selectLastChatOpened=t.selectIsOnline=t.selectIsInDrag=t.selectIsFocused=t.selectChatStarted=t.selectApp=void 0;const n=e=>e.app;t.selectApp=n;t.selectIsOnline=e=>n(e).isOnline;t.selectIsFocused=e=>n(e).isFocused;t.selectRoute=e=>n(e).route;t.selectShowEula=e=>n(e).showEula;t.selectChatStarted=e=>n(e).chatStarted;t.selectLastChatOpened=e=>n(e).lastChatOpened;t.selectIsInDrag=e=>n(e).isInDrag},14376:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.selectBots=t.selectBotById=void 0;const n=e=>e.bots;t.selectBots=n;t.selectBotById=(e,t)=>n(e).find((e=>e.id===t))},65210:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.selectIsCallbackDelayed=t.selectIsCallbackAvailable=t.selectCallback=void 0;const n=e=>e.callback;t.selectCallback=n;t.selectIsCallbackAvailable=e=>n(e).available;t.selectIsCallbackDelayed=e=>n(e).isDelayed},55623:function(e,t,n){"use strict";var a=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.selectJoinedIdsByStatus=t.selectIsChatNotStarted=t.selectIsChatEvaluated=t.selectCurrentChat=t.selectChatsIds=t.selectChats=void 0;var o=a(n(15687)),r=n(79257),i=n(99258),s=n(14376),l=n(66311);const u=e=>e.chats;t.selectChats=u;const c=e=>{const t=u(e);return(0,r.last)(t)};t.selectCurrentChat=c;t.selectIsChatEvaluated=e=>{var t;const n=c(e);return null!==(t=null==n?void 0:n.evaluated)&&void 0!==t&&t};t.selectIsChatNotStarted=e=>{const t=c(e);return!(null!=t&&t.joinedAgents.length||null!=t&&t.joinedBots.length)};t.selectChatsIds=e=>{const t=(0,l.selectMessages)(e);return(0,o.default)(t.reduce(((e,t)=>(null!=t&&t.chat_id&&(e.has(t.chat_id)||e.add(t.chat_id)),e)),new Set))};t.selectJoinedIdsByStatus=(e,t)=>{const n=(0,i.selectAgents)(e),a=(0,s.selectBots)(e);return[].concat((0,o.default)(n),(0,o.default)(a)).reduce(((e,n)=>(n.state===t&&(n.isBot?e.botIds.push(n.id):e.agentIds.push(n.id)),e)),{agentIds:[],botIds:[]})}},45959:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.selectLastMessage=t.selectIsIntroduced=t.selectInputText=t.selectEulaAccepted=t.selectDescription=t.selectDepartmentId=t.selectClientPhone=t.selectClientName=t.selectClientId=t.selectClientEvaluate=t.selectClientEmail=t.selectClient=void 0;const n=e=>e.client;t.selectClient=n;t.selectClientId=e=>n(e).clientId;t.selectEulaAccepted=e=>n(e).eulaAccepted;t.selectClientEvaluate=e=>n(e).evaluate;t.selectDepartmentId=e=>n(e).departmentId;t.selectClientName=e=>n(e).name||"";t.selectClientPhone=e=>n(e).phone||"";t.selectClientEmail=e=>n(e).email||"";t.selectInputText=e=>n(e).inputText||"";t.selectDescription=e=>n(e).description;t.selectLastMessage=e=>n(e).lastMessage||"";t.selectIsIntroduced=e=>n(e).isIntroduced},95448:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.selectFeatures=t.selectCampaigns=void 0;const n=e=>e.settings.features;t.selectFeatures=n;t.selectCampaigns=e=>n(e).campaigns},66311:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.selectSendedMessages=t.selectMessages=t.selectMessageByPrivateId=t.selectLastMessage=t.selectLastClientMessage=t.selectClientMessages=t.selectBotBlockedMessages=void 0;var a=n(81152);const o=e=>e.messages;t.selectMessages=o;t.selectSendedMessages=e=>o(e).filter((e=>e.status===a.MessageStatus.SENT));const r=e=>o(e).filter((e=>e.from===a.MessageInitiator.CLIENT));t.selectClientMessages=r;t.selectLastClientMessage=e=>{const t=r(e);if(t.length>0)return t[t.length-1]};t.selectLastMessage=e=>{const t=o(e);if(t.length>0)return t[t.length-1]};t.selectMessageByPrivateId=(e,t)=>o(e).find((e=>e.private_id===t));t.selectBotBlockedMessages=e=>!!(o(e)||[]).find((e=>{var t,n;return e.type==a.MessageType.LISTPICKER&&e.body&&(null===(t=e.body)||void 0===t?void 0:t.force_reply)&&!(null!==(n=e.body)&&void 0!==n&&n.answer_id)}))},7193:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.selectProactive=void 0;t.selectProactive=e=>e.proactive},87692:function(e,t,n){"use strict";var a=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.selectWixAgentTitle=t.selectWixAgentDisplayName=t.selectWidgetPadding=t.selectWidgetOrientation=t.selectWidgetMobileOrientation=t.selectWidgetId=t.selectWidgetFontColor=t.selectWidgetColor2=t.selectWidgetColor=t.selectUserCallbackTime=t.selectSettings=t.selectRateSettings=t.selectPrechat=t.selectPowerGradient=t.selectPowerButtonPhone=t.selectPowerButtonColor=t.selectPattern=t.selectOfflineWidgetLabel=t.selectOfflineFormTitle=t.selectMobileProactive=t.selectMobileOffsetBottom=t.selectLocale=t.selectLabelBubble=t.selectJoint=t.selectIsPremium=t.selectGeoIp=t.selectEulaEnabled=t.selectEula=t.selectEnablePrechat=t.selectDisableEmoji=t.selectDisableBotLabel=t.selectDesigner=t.selectDepartments=t.selectContactsSettingsToShow=t.selectContactsSettings=t.selectContactsAsk=t.selectCampaignPopup=t.selectCallHeaderText=t.selectBubbleColor=t.selectBillRu=t.selectBaseUrl=t.selectAvatarUrl=t.selectApiDomain=void 0;var o=a(n(67375)),r=n(98986),i=n(28008);const s=e=>e.settings;t.selectSettings=s;const l=e=>s(e).features,u=e=>s(e).system,c=e=>s(e).user;t.selectEnablePrechat=e=>l(e).prechat;t.selectDisableEmoji=e=>l(e).disableEmoji;t.selectDisableBotLabel=e=>l(e).disableBotLabel;t.selectEula=e=>l(e).eula;t.selectJoint=e=>l(e).joint;t.selectMobileProactive=e=>l(e).mobileProactive;t.selectCampaignPopup=e=>s(e).campaignPopup;t.selectDesigner=e=>s(e).designer;t.selectApiDomain=e=>u(e).apiDomain;t.selectAvatarUrl=e=>u(e).avatarUrl;t.selectIsPremium=e=>u(e).premium;t.selectBillRu=e=>u(e).billRu;t.selectBaseUrl=e=>u(e).baseUrl;t.selectWidgetId=e=>u(e).widgetId;t.selectGeoIp=e=>u(e).geoIp;t.selectEulaEnabled=e=>u(e).eula;t.selectBubbleColor=e=>c(e).bubbleColor||"green";t.selectPrechat=e=>c(e).prechat;t.selectLocale=e=>c(e).locale;t.selectDepartments=e=>c(e).departments||[];const d=e=>c(e).contactsSettings;t.selectContactsSettings=d;t.selectWidgetOrientation=e=>c(e).widgetOrientation;t.selectWidgetMobileOrientation=e=>c(e).widgetMobileOrientation;t.selectMobileOffsetBottom=e=>c(e).mobileOffsetBottom;t.selectCallHeaderText=e=>c(e).callHeaderText;t.selectWidgetPadding=e=>c(e).widgetPadding;t.selectRateSettings=e=>c(e).rateSettings||null;t.selectWidgetFontColor=e=>c(e).widgetFontColor||null;t.selectWidgetColor=e=>c(e).widgetColor||null;t.selectWidgetColor2=e=>c(e).widgetColor2||null;t.selectUserCallbackTime=e=>c(e).callback.time;t.selectPowerButtonPhone=e=>c(e).powerButtonPhone;t.selectPattern=e=>c(e).pattern;t.selectPowerButtonColor=e=>c(e).powerButtonColor;t.selectPowerGradient=e=>c(e).powerGradient;t.selectWixAgentDisplayName=e=>c(e).wixAgentDisplayName;t.selectWixAgentTitle=e=>c(e).wixAgentTitle;t.selectOfflineWidgetLabel=e=>c(e).offlineWidgetLabel;t.selectOfflineFormTitle=e=>c(e).offlineFormTitle;t.selectContactsAsk=e=>c(e).contactsAsk;t.selectLabelBubble=e=>c(e).labelBubble;t.selectContactsSettingsToShow=e=>{const t=d(e);return(0,r.isNull)(t)||(0,i.isUndefined)(t)?{}:Object.entries(t).reduce(((e,t)=>{let n=(0,o.default)(t,2),a=n[0],r=n[1];return r.show&&(e[a]=r),e}),{})}},92400:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.selectTransitionCurrentScript=void 0;t.selectTransitionCurrentScript=e=>e.transition.currentScript},28549:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.selectZoom=t.selectUserZoom=t.selectAppZoom=void 0;const n=e=>e.zoom;t.selectZoom=n;t.selectAppZoom=e=>n(e).app;t.selectUserZoom=e=>n(e).user},62096:function(e,t,n){"use strict";var a=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.reduxStore=void 0;var o=n(15857),r=a(n(53894)),i=n(9393),s=n(28240),l=n(75291),u=n(68031),c=n(44733),d=a(n(94514));const f=(0,o.createStore)(d.default,function(){const e={};return(0,i.each)(u.statesToPersist,(function(t){let n=t.storageKey,a=t.path,o=t.onAdapter;const r=c.StorageProvider.get(n);r&&(0,l.set)(e,a,o?o(r):r)})),e}(),(0,o.applyMiddleware)(r.default,s.loggerMiddleware,u.persistMiddleware));t.reduxStore=f,(0,u.subscribeOnStorage)(f)},5735:function(e,t,n){"use strict";var a=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=a(n(61125)),r=n(68403),i=n(21951),s=n(9393),l=n(43374),u=n(31484),c=a(n(1039)),d=a(n(26754)),f=a(n(138)),p=a(n(92443)),h=a(n(14264)),g=a(n(71277)),m=a(n(2833)),_=n(81152),v=n(21476),y=n(47060),b=n(65465),E=n(4425),T=a(n(66547)),C=a(n(73687)),O=a(n(4855)),S=n(13077),w=n(26932),A=n(44145),I=n(69882),M=n(83907),P=n(94537),R=n(48999);function k(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function N(e){for(var t=1;t!e.end_ts||t<1e3*e.end_ts)),this.isCampaignsEnable=this.campaigns&&this.campaigns.length>0,(0,S.setRuleLocal)("pageEnterTime",t),(0,S.addPageView)(),d.default.agent_id&&(0,A.getApp)().chatStarted&&(0,A.getApp)().isOnline||this.ready()},ready:function(){const e=this.rules;D.log("RULE MANAGER READY",e),this.rules=[];for(let t=0;t{const a=e.rules,o=!e.end_ts||(new Date).getTime()<=1e3*e.end_ts;if(a.conditions&&o){var r,i,s,l,u,c,d,f;const o=null!==(r=null===(i=e.content)||void 0===i||null===(s=i.widget_settings)||void 0===s?void 0:s.prechat_buttons)&&void 0!==r?r:null===(l=e.content)||void 0===l?void 0:l.prechat_buttons;a.campaign_id=e.campaign_id,a.popup_settings=null!==(u=null===(c=e.content)||void 0===c?void 0:c.popup_settings)&&void 0!==u?u:null,a.widget_settings=null!==(d=null===(f=e.content)||void 0===f?void 0:f.widget_settings)&&void 0!==d?d:null,a.prechats=null!=o?o:null,a.name=e.title?e.title:`Campaign ${a.campaign_id}`,this.rules.push(new U(a,n+t))}})),D.warn("final rules",this.rules))},moveCloseButton:function(){(0,s.each)(this.rules,(function(e){(0,S.setRuleLocal)("movedToCloseButton",!0),e.tick()}),this)},mouseScroll:function(e){(0,s.each)(this.rules,(function(t){(0,S.setRuleLocal)("scrollPosition",e),t.tick()}),this)},cancelRule:function(e){D.log("canceling rule",e);for(var t=0;t+e.id==t))))return void D.info(`${s} department id ${t} is not found.`);m.default.getActiveAgent((i=>{D.log("widget status",i);const l=(0,A.getClient)();(0,A.getApp)().isOnline||(0,A.getAgents)().length?(0,A.getProactive)().text||!i||v.Router.getCurrentRoute()!==y.Route.LABEL&&!(0,I.isChatPage)()?D.log('invitation failed, no agent OR route != "label" OR proactive already shown'):(i.bot_id||l.priorityAgentId&&l.priorityAgentId===i.agent_id||w.clientDispatchers.setPaId(i.agent_id),t&&w.clientDispatchers.setDepartmentId(t),o&&(w.featuresDispatchers.enablePrechat(!0),w.userDispatchers.setPrechat(o)),p.default.proactive({message:e,agentInfo:i,name:n,isMarkdown:a,prechats:o,campaignId:r}),(0,S.setInvitationTime)(),L.emit("show_proactive"),g.default.play("notification"),b.messageActions.destroyByType(_.MessageType.LISTPICKER),b.messageActions.addPrechatMessage(),r?f.default.trackCampaignShown(n):f.default.trackProactiveInvitationShown(n)):D.info(`${s} for offline`)}),t)},showCallForm:function(e,t){const n=(0,A.getProactive)();(0,A.getApp)().route!=y.Route.LABEL||n.text&&n.status!=_.MessageStatus.READ?D.warn("ignore showCallForm due to proactive"):p.default.showCallForm(e,(()=>{L.emit("show_proactive"),g.default.play("notification"),(0,S.setInvitationTime)(),f.default.trackCallWidgetInvitationShown(t)}))},showCampaignPopup:function(e){const t=e.campaignId,n=(0,A.getApp)().chatAccepted,a=(0,A.getSettings)().campaignPopup,o=a.campaignId,r=a.display,i=C.default.get(`${M.RuleTypes.SHOW_POPUP}_${t}`);r?D.warn(`CampaignPopup already have config from campaign #${o}.`):i?D.warn(`Campaign ${t} has already been shown.`):n?D.warn("Chat accepted by agent. CampaignPopup disabled."):p.default.showPopup(e)}});let j,B;const F=Object.assign(x,{inited:!1,initialize:function(){this.inited||(this.initScroll(),this.initClose(),this.inited=!0)},initScroll:function(){j=(0,l.throttle)(this._scroll.bind(this),150),(0,i.addListener)(window.parent,"scroll",j)},initClose:function(){this.last_position={},B=(0,l.throttle)(this._mouse.bind(this),100),(0,i.addListener)(window.parent,"mousemove",B)},_mouse:function(e){if(this.timerId&&clearTimeout(this.timerId),void 0!==this.last_position.x){var t=this.last_position.x-e.clientX,n=this.last_position.y-e.clientY,a=Math.abs(n)>Math.abs(t)&&n>0,o=e.clientY>>0==0,r=e.clientY<=30,i=e.clientY<=this.last_position.dY+30&&n>e.clientY&&n>25;a&&(o||r&&i)&&(this.timerId=setTimeout((()=>{L.moveCloseButton()}),200))}this.last_position={x:e.clientX,y:e.clientY,dY:this.last_position.y-e.clientY}},_scroll:function(){const e=window.parent.document;let t=e.documentElement.clientHeight;t===e.documentElement.scrollHeight&&(t=e.body.clientHeight),L.mouseScroll(Math.round((e.documentElement.scrollTop+e.body.scrollTop)/(e.documentElement.scrollHeight-t)*100))},removeEvents:function(){j&&(0,i.removeEvent)(window.parent,"scroll",j),B&&(0,i.removeEvent)(window.parent,"scroll",B)}}),U=function(e,t){const n={initialize:function(){(0,u.defaults)(this,e),this.index=t,this.isCampaign=Boolean(e.campaign_id),(0,s.each)(this.conditions,(function(e){e.condition===M.RuleConditions.WEEK_DAY&&"0"===e.value&&(e.value="7")})),this.timeConditions=[];const n=this.commands[0];let a=!1;const o=this.id?"id"+this.id:"i"+this.index,r=n.command+"_onceADay_"+o,i=C.default.get(r),l=(0,S.hasOnceCondition)(this.conditions);if(l&&i){if(!1!==l.value)return D.log(`Ignore "${this.name}" rule, already triggered today.`),void this.cancel();C.default.set(r,null,1)}if(!l&&n.params&&(n.params.once_aday||n.params.onceADay)&&i)D.log("is once a day rule",this.name);else{if(this.conditions)for(let e=0;e0?(0,S.checkTimeConditions)(this.timeConditions,this.type,this.name)?this.triggered():this.timeWait():a&&this.triggered()}},timeWait:function(){var e=this;clearTimeout(this.timeWaitTimeout),this.timeWaitTimeout=setTimeout((function(){e.tick()}),1e3)},tick:function(){!this.isTriggered&&(0,S.checkTimeConditions)(this.conditions,this.type,this.name)?this.triggered():this.timeWait()},cancel:function(){clearTimeout(this.timeWaitTimeout),this.isTriggered=!0},triggered:function(){var e,t,n,a,o;D.log("triggered",this.name);const i=this.commands[0];clearTimeout(this.timeWaitTimeout),this.isTriggered=!0;let s={};i.params&&"object"==typeof i.params&&(s={name:i.command+"_onceADay",value:i.params.once_aday||i.params.onceADay?1:null});const l=(0,S.hasOnceCondition)(this.conditions);D.log("onceCondition",l,this.conditions),l&&(s={name:i.command+"_onceADay",value:l.value});const u=(0,S.isPopupCommand)(i.command),c=(0,A.getApp)().route,d=(0,A.getApp)().isOnline;if(c!==y.Route.LABEL&&u&&(0,A.getApp)().chatOpenByClient||(0,I.isChatPage)()&&[y.Route.DEPARTMENTS,y.Route.INTRODUCE].includes(c))return void D.log("cant show proactive",c);const m=(0,A.getClient)();if(u&&(0,S.isYandexMarketClient)(m.utm))return void D.log("ignore proactive for YMarket");const v=null!==(e=this.widget_settings)&&void 0!==e?e:i.params,T=this.campaign_id&&v?(0,R.formatProactiveContent)(v):null===(t=i.params)||void 0===t?void 0:t.message,C=(0,A.getUserSettings)(),O=C.contactsAsk,k=C.chatMode;switch(i.command){case M.RuleTypes.PROACTIVE:L.showProactive(T,+(null===(n=i.params)||void 0===n?void 0:n.department),this.name,!!this.campaign_id||this.isMarkdown,this.prechats,this.campaign_id);break;case M.RuleTypes.OPEN_OFFLINE:if(k===E.ChatMode.ONLINE||c!==y.Route.LABEL)return;(0,S.setInvitationTime)(),i.params&&(i.params.title&&w.userDispatchers.setOfflineFormTitle(i.params.title),i.params.message&&(b.messageActions.deleteOfflineSystemInvites(),w.userDispatchers.setOfflineFormText(i.params.message))),p.default.openOffline(),L.emit("show_proactive"),g.default.play("notification"),f.default.trackProactiveInvitationShown(this.name),L.cancelRule(M.RuleTypes.OPEN_OFFLINE);break;case M.RuleTypes.HIDE:w.appDispatchers.setAppRoute(y.Route.HIDDEN),g.default.disableSoundPlayer();break;case M.RuleTypes.SYSTEM_MESSAGE:if(d){var x,j;const e=h.default.getLastMessage();e&&e.get("type")===_.MessageType.SYSTEM&&e.get("text")===(null===(x=i.params)||void 0===x?void 0:x.message)&&e.destroy(),(0,S.setInvitationTime)(),p.default.systemMessage(null===(j=i.params)||void 0===j?void 0:j.message),b.messageActions.addPrechatMessage()}break;case M.RuleTypes.SYSTEM_EMAIL:if(!d)return;if(d&&O===P.ContactsType.SOCIAL)return void D.log("systemMessageEmail failed, contact settings is social");if(m.email)return void D.log("Client already has email. Rule ignored.");if((0,r.hasIntegration)(m.hasIntegration))return void D.log("systemMessageEmail failed, client has integration");(0,S.setInvitationTime)(),p.default.systemMessageEmail(null===(a=i.params)||void 0===a?void 0:a.message),b.messageActions.addPrechatMessage();break;case M.RuleTypes.SHOW_CALLFORM:L.showCallForm((null===(o=i.params)||void 0===o?void 0:o.title).replace("
","").replace("","").replace("","").replace("",""),this.name);break;case M.RuleTypes.SHOW_POPUP:const e=this.campaign_id,t=this.popup_settings;L.showCampaignPopup(N(N({},t),{},{campaignId:e}))}L.handleOnceADay(s,this)}};return n.initialize(),n};d.default.addListener((function(){d.default.agent_id&&(0,A.getApp)().chatStarted&&(0,A.getApp)().isOnline&&L.allRulesCancel()})),h.default.on("create",(()=>{h.default.getCurrentClientMessages().length&&!(0,S.getRuleLocal)("firstMessageTime")&&(D.log("cancelRules, we have client messsages."),L.cancelRule(M.RuleTypes.PROACTIVE),L.cancelRule(M.RuleTypes.SHOW_CALLFORM));const e=h.default.getLastMessage();e&&e.get("type")===M.RuleTypes.PROACTIVE&&L.cancelRule(M.RuleTypes.PROACTIVE),h.default.getAgentTextMessages().length&&e.get("from")!==_.MessageInitiator.CLIENT&&(D.log("cancel system_message, we have agentMessage"),L.cancelRule(M.RuleTypes.SYSTEM_MESSAGE))})),(0,i.addListener)(window.parent,"jBeforeunload",F.removeEvents);var W=L;t.default=W},26754:function(e,t,n){"use strict";var a=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.agentToReduxFormat=void 0;var o=a(n(85948));const r=e=>({avatarUrl:e.avatar_url||null,id:e.agent_id||e.bot_id,name:e.display_name||null,title:e.title||null,isBot:!!e.bot_id,state:e.state||null,type:e.type||null});t.agentToReduxFormat=r;const i=(0,o.default)({agent_id:0,bot_id:0,display_name:null,title:null,avatar_url:null,typing:0,state:null});i.toReduxFormat=()=>r(i);var s=i;t.default=s},95003:function(e,t,n){"use strict";var a=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=a(n(1039)),r=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=b(t);if(n&&n.has(e))return n.get(e);var a={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var r in e)if("default"!==r&&Object.prototype.hasOwnProperty.call(e,r)){var i=o?Object.getOwnPropertyDescriptor(e,r):null;i&&(i.get||i.set)?Object.defineProperty(a,r,i):a[r]=e[r]}a.default=e,n&&n.set(e,a);return a}(n(85948)),i=a(n(19955)),s=n(69882),l=n(9393),u=n(31484),c=n(13077),d=n(47060),f=n(4425),p=a(n(73687)),h=n(44733),g=n(71047),m=n(44145),_=n(97615),v=n(94537),y=n(83907);function b(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(b=function(e){return e?n:t})(e)}const E={route:d.Route.LABEL,is_online:0,is_focused:!1,chat_started:!1,chat_accepted:!1,widget_color:o.default.widget_color,widget_color2:o.default.widget_color2,widget_font_color:o.default.widget_font_color,cap_id:null,forcedOffline:!1,callText:null,eula_accepted:!1,show_eula:!1,width:!1,height:!1,viReconnectTime:null,lastMsgId:null,lastChatOpened:null,started:!1,lastMsgTime:null,didFreezeData:!1,lastChatStatus:null},T=_.EnvironmentManager.isDesignerEditor()?null:h.StorageProvider.createKeyForStore(g.STORAGED_ID.APP),C=(0,r.default)(E,T),O=(0,m.getClient)(),S=(0,m.getUserSettings)();C.widget_color=o.default.widget_color,C.widget_color2=o.default.widget_color2,C.widget_font_color=o.default.widget_font_color,C.is_online=o.default.chat_mode===f.ChatMode.ONLINE?1:0;o.default.chat_mode===f.ChatMode.OFFLINE||null!==O.sessionId||(C.chat_started=!1),(0,s.isWixEditor)()&&(C.chat_started=!1),i.default.mobileOrTablet()&&(C.route=d.Route.LABEL),(0,u.defaults)(o.default,{contacts_settings:{name:{show:!1,required:!1},phone:{show:!1,required:!1},email:{show:!1,required:!1}}});let w=!0;(0,l.each)(["name","phone","email"],(function(e){o.default.contacts_settings[e].show&&(w=!1)}),void 0),w&&(o.default.contacts_ask=2),1!=o.default.hide_offline||512&o.default.options||(o.default.hide_offline=0),1!=o.default.show_rate_form||64&o.default.options||(o.default.show_rate_form=0);let A=!1;(0,l.each)(o.default.rules,(e=>{e.commands[0].command===y.RuleTypes.HIDE&&(0,c.checkTimeConditions)(e.conditions,e.type,e.name)&&(A=!0)})),A&&(0,r.addSyncExclude)("route"),C.route==d.Route.HIDDEN&&(C.route=d.Route.LABEL);let I=!1;C.chat_started&&C.chat_accepted&&!i.default.mobileOrTablet()?(S.labelBubble?C.route=C.route===d.Route.LABEL?d.Route.LABEL:d.Route.CHAT:C.route=C.route===d.Route.CHAT_MIN?d.Route.CHAT_MIN:d.Route.CHAT,I=!0):C.route=d.Route.LABEL,C.route==d.Route.INTRODUCE&&o.default.contacts_ask!==v.ContactsType.BEFORE_CHAT&&(C.route=d.Route.CHAT),C.route==d.Route.INTRODUCE&&O.isIntroduced&&(C.route=d.Route.CHAT),C.route!=d.Route.INTRODUCE||C.is_online||(C.route=d.Route.CHAT),C.route==d.Route.CHAT_SOCIAL&&(C.route=d.Route.CHAT),C.route==d.Route.CHAT_EULA&&(C.route=d.Route.CHAT),C.route==d.Route.CALL_EULA&&(C.route=d.Route.CALL),C.route!=d.Route.CHAT_EVAL&&C.route!=d.Route.CHAT_INTRODUCE||(C.route=d.Route.CHAT),!i.default.mobile()&&C.zoom&&(C.zoom=null),C.show_eula=!1,_.EnvironmentManager.isRegPage()&&(C.route=d.Route.CHAT);const M=o.default.contacts_ask===v.ContactsType.BEFORE_CHAT&&!O.isIntroduced&&C.is_online;(0,s.isChatPage)()?M?C.route=d.Route.INTRODUCE:o.default.departments&&!C.chat_started&&C.is_online?C.route=d.Route.DEPARTMENTS:C.route=d.Route.CHAT:M&&C.route==d.Route.CHAT&&(C.route=d.Route.INTRODUCE),(!C.is_online&&o.default.hide_offline&&!I||p.default.get("is_blacklisted")||A||i.default.mobileOrTablet()&&o.default.disable_mobile||(0,s.isAppCobrowse)())&&(C.route=d.Route.HIDDEN),o.default.cookie_domain&&h.StorageProvider.migrate();var P=C;t.default=P},32710:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.bind=function(e,t,n){if(!(0,a.isFunction)(e))throw new TypeError("Bind must be called on a function.");return e.bind(t,n)};var a=n(55004)},10895:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.compose=function(){for(var e=arguments.length,t=new Array(e),n=0;n0;)e=n.pop()(e);return e}}},53401:function(e,t,n){"use strict";var a=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.splitCookieOnEntries=t.setCookie=t.parseCookies=t.getCookie=t.deleteCookie=void 0;var o=a(n(67375)),r=n(80210),i=n(64249),s=n(79641),l=n(21733),u=n(82138),c=n(10895);const d=e=>e.toUTCString(),f=e=>e.map((e=>e.trim())),p=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:432e5;const t=(new Date).getTime()+e;return d(new Date(t))},h=e=>{const t=new Date;return t.setDate(t.getDate()+e),d(t)};t.getCookie=e=>{const t=(0,u.isRegExp)(e)?e:new RegExp(e+"=([^;]*)"),n=document.cookie.match(t),a=(0,c.compose)(JSON.parse,decodeURIComponent);return n?a(n[1]):null};const g=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const a=Object.assign({path:"/",expires:p()},n);(0,i.isDate)(a.expires)&&(a.expires=d(a.expires)),(0,s.isNumber)(a.expires)&&(a.expires=h(a.expires));const u=Object.entries(a),c=(0,l.isString)(t)?t:JSON.stringify(t),f=(0,r.encodeAndJoinPair)([e,c]),g=u.reduceRight(((e,t)=>{let n=(0,o.default)(t,2);return e+`; ${n[0]}=${n[1]}`}),f);return document.cookie=g};t.setCookie=g;t.deleteCookie=e=>g(e,"",{"max-age":-1});t.parseCookies=()=>document.cookie.split(";").reduce(((e,t)=>{var n;const a=(0,r.splitAndDecodePair)(t),o=a[0].trim(),i=null!==(n=a[1])&&void 0!==n?n:"";return e[o]=i.trim(),e}),{});t.splitCookieOnEntries=()=>{const e=document.cookie.split(";"),t=(0,c.compose)(f,r.splitAndDecodePair);return e.map(t)}},90991:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.debounce=function(e,t,n){let a,o,r,i,s;const l=function(){const u=Date.now()-o;t>u?a=setTimeout(l,t-u):(a=null,n||(i=e.apply(s,r)),a||(r=s=null))},u=function(){return s=this,r=arguments,o=Date.now(),a||(a=setTimeout(l,t),n&&(i=e.apply(s,r))),i};return u.cancel=function(){clearTimeout(a),a=r=s=null},u}},31484:function(e,t,n){"use strict";var a=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.defaults=function(){for(var e=arguments.length,t=new Array(e),n=0;n{if((0,a.isUndefined)(t))return e;const n=new Set(t);return e.filter((e=>!n.has(e)))}},47713:function(e,t,n){"use strict";var a=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.onClickHandler=void 0;var o=a(n(19955));const r=o.default.mobileOrTablet()&&o.default.isTouchEnabled()?"onTouchStart":"onClick";t.onClickHandler=function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return{[r]:a=>{n&&a.preventDefault(),t&&(a.stopPropagation(),a.nativeEvent.stopImmediatePropagation()),e(a)}}}},9393:function(e,t,n){"use strict";var a=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.each=function(e,t,n){const a=n?function(e,a,o){return t.call(n,e,a,o)}:t;(0,r.isArray)(e)&&e.forEach(a);(0,i.isObject)(e)&&Object.entries(e).forEach(((e,t,n)=>{let r=(0,o.default)(e,2),i=r[0],s=r[1];return a(s,i,n)}));((0,s.isNodeList)(e)||(0,l.isHTMLCollection)(e))&&Array.from(e).forEach(a);return e};var o=a(n(67375)),r=n(90872),i=n(46322),s=n(82384),l=n(2423)},11413:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.escape=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return e.replace(/[&<>"']/g,(e=>n[e]))};const n={"&":"&","<":"<",">":">",'"':""","'":"'"}},60277:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.extend=void 0;t.extend=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),a=1;a{const t=(0,r.splitString)(e,"."),n=(0,o.default)(t,2);return{name:n[0],ext:n[1]}}},58271:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.fileSize=t.bytesToMB=void 0;const n=["B","KB","MB","gB","tB"];t.fileSize=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(0===e)return"0";const a=Math.floor(Math.log(e)/Math.log(1024)),o=e/1024**a,r=t?Math.round(o):o.toFixed(2),i=n[a];return r+i};t.bytesToMB=e=>e/1048576},37578:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.filterObj=void 0;var a=n(28650);t.filterObj=(e,t)=>Object.keys(e).reduce(((n,o)=>((0,a.hasOwn)(e,o)&&t(e[o],o)&&(n[o]=e[o]),n)),{})},39715:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.get=function(e,t,n){return(0,o.isString)(t)?r(t.match(/([^[.\]])+/g)):(0,a.isArray)(t)?r(t):void 0;function r(t){return t.reduce(((e,t)=>{try{e=e[t]}catch(e){return n}return e}),e)}};var a=n(90872),o=n(21733)},28650:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.hasOwn=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)}},35967:function(e,t,n){"use strict";var a=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.intersection=void 0;var o=a(n(55067));t.intersection=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),a=1;ar.has(e)))}},90872:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isArray=function(e){return Array.isArray(e)}},64249:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isDate=function(e){return e instanceof Date&&!isNaN(e)}},92560:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isEmpty=void 0;var a=n(98986),o=n(28008),r=n(46322),i=n(90872);t.isEmpty=e=>""===e||(0,a.isNull)(e)||(0,o.isUndefined)(e)||((0,r.isObject)(e)||(0,i.isArray)(e))&&0===Object.keys(e).length},55004:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isFunction=function(e){return"function"==typeof e}},2423:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isHTMLCollection=void 0;t.isHTMLCollection=e=>!!e&&"HTMLCollection"===e.constructor.name},82384:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isNodeList=void 0;t.isNodeList=e=>!!e&&"NodeList"===e.constructor.name},98986:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isNull=void 0;t.isNull=e=>null===e},79641:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isNumber=function(e){return"number"==typeof e}},46322:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isObject=void 0;t.isObject=e=>!!e&&"Object"===e.constructor.name},82138:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isRegExp=function(e){return e instanceof RegExp}},21733:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isString=function(e){return"string"==typeof e}},28008:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isUndefined=function(e){return void 0===e}},79257:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.last=void 0;t.last=e=>e.length?e[e.length-1]:void 0},82956:function(e,t,n){"use strict";var a=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.xhrPromised=t.xhr=t.createCancelablePromise=t.CancelError=void 0;var o=a(n(92664)),r=a(n(33119)),i=a(n(7819)),s=a(n(84827)),l=a(n(85299)),u=a(n(55536)),c=a(n(51398)),d=a(n(61125)),f=a(n(67375));function p(e){var t=function(){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}}();return function(){var n,a=(0,u.default)(e);if(t){var o=(0,u.default)(this).constructor;n=Reflect.construct(a,arguments,o)}else n=a.apply(this,arguments);return(0,l.default)(this,n)}}const h=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return e.trim().split(/[\r\n]+/).reduce(((e,t)=>{const n=t.split(": "),a=(0,f.default)(n,2),o=a[0],r=a[1];return e[o]=r,e}),{})},g=(e,t,n,a)=>{const o=new XMLHttpRequest;return o.open(t,e,!0),n.headers&&Object.keys(n.headers).forEach((e=>{o.setRequestHeader(e,n.headers[e])})),o.timeout=n.timeout,o.responseType=n.responseType,o.withCredentials=n.withCredentials,o.onload=()=>n.validateStatus(o.status)?a(null,{data:o.response,status:o.status,statusText:o.statusText,headers:h(o.getAllResponseHeaders())}):a({status:o.status,statusText:o.statusText}),o.onerror=()=>a({status:o.status,statusText:o.statusText}),o.upload.onprogress=n.onUpload,o.onprogress=n.onDownload,o.ontimeout=n.onTimeout||a,o.send(n.body),o};t.xhr=g;t.xhrPromised=(e,t,n)=>new Promise(((a,o)=>g(e,t,n,((e,t)=>e?o(e):a(t)))));let m=function(e){(0,s.default)(n,e);var t=p(n);function n(){var e;(0,r.default)(this,n);for(var a=arguments.length,o=new Array(a),s=0;s{let t=!1;const n=new m;return{promise:new Promise(((a,o)=>{e.then((e=>t?o(n):a(e))).catch((e=>o(t?n:e)))})),cancel:()=>t=!0,isCanceled:t}}},42687:function(e,t,n){"use strict";var a=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.omit=void 0;var o=a(n(61125));function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function i(e){for(var t=1;t1?t-1:0),a=1;adelete e[t])),e):e}},38392:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.pick=void 0;var a=n(28008);t.pick=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),o=1;o(n in e&&(t[n]=e[n]),t)),{})}},80210:function(e,t,n){"use strict";var a=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.encodeAndJoinPair=i,t.querystring=void 0,t.splitAndDecodePair=s;var o=a(n(67375)),r=n(39731);function i(e){return e.map(encodeURIComponent).join("=")}function s(e){return e.split("=").map(decodeURIComponent)}function l(e){return function(e){if(!e||!e[Symbol.iterator])throw new Error("Object.fromEntries() requires a single iterable argument");let t={};for(let a of e){var n=(0,o.default)(a,2);let e=n[0],r=n[1];t[e]=r}return t}(e.split("&").map(s))}const u={create:e=>e?function(e){return Object.entries(e).map(i).join("&")}(e):"",parse:e=>{if(e){const t=(0,r.splitString)(e,"?");return l((0,o.default)(t,2)[1])}}};t.querystring=u},34425:function(e,t,n){"use strict";var a=n(17907);Object.defineProperty(t,"__esModule",{value:!0}),t.redefineProps=void 0;var o=a(n(61125));function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function i(e){for(var t=1;t2&&void 0!==arguments[2]&&arguments[2];const a=i({},e);for(const e in t)Object.hasOwnProperty.call(a,e)&&(n?(a[t[e]]=a[e],delete a[e]):a[e]=t[e]);return a}},53489:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sanitize=function(e){if(!1===(0,a.isString)(e))throw new TypeError("Filename must be string.");const t=(0,o.fileName)(e),n=t.name,s=t.ext,l=n.replace(r,"").replace(i,"_");return(l.length?l:"Untitled")+"."+s};var a=n(21733),o=n(21434);const r=/[/?<>\\:*|"%#]/g,i=/\s+/g},75291:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.set=function(e,t,n){if((0,o.isString)(t))return i(t.match(/([^[.\]])+/g));if((0,a.isArray)(t))return i(t);function i(t){t.reduce(((e,t,a,o)=>((0,r.isUndefined)(e[t])&&(e[t]={}),a===o.length-1&&(e[t]=n),e[t])),e)}};var a=n(90872),o=n(21733),r=n(28008)},45950:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sortBy=void 0;var a=n(55004);t.sortBy=(e,t)=>{if(null==e||!e.length||!t)return[];const n=e=>(0,a.isFunction)(t)?t(e):e[t];return e.slice().sort(((e,t)=>n(e)>n(t)?1:n(t)>n(e)?-1:0))}},39731:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.splitString=void 0;t.splitString=(e,t,n)=>{const a=e[n?"indexOf":"lastIndexOf"](t),o=e.substring(0,a);return[o,e.substring(a+(o?t.length:1))]}},38632:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parentSS=t.parentLS=void 0;var a=n(21733),o=n(4623),r=n(69882),i=n(71047);const s=u(i.STORAGE_TYPE.LOCAL);t.parentLS=s;const l=u(i.STORAGE_TYPE.SESSION);function u(e,t){(0,o.tryCatch)((()=>e=(0,r.getPageWindow)()[e]));const n=e=>(0,o.tryCatch)(e,t);return{get(t){return n((()=>{const n=e.getItem(t);return JSON.parse(n)}))},set(t,o){return n((()=>{const n=(0,a.isString)(o)?o:JSON.stringify(o);return e.setItem(t,n),o}))},remove(t){return n((()=>e.removeItem(t)))},keys(){return n((()=>Object.keys(e)))},values(){return n((()=>Object.values(e).map(JSON.parse)))},all(){return n((()=>Object.assign({},e)))},clear(){return n((()=>e.clear()))},status(){return function(e){return(0,o.tryCatch)((()=>{const t="__storage_test__";return e.setItem(t,t),e.removeItem(t),i.STORAGE_STATUS.AVAILABLE}),(t=>{return t instanceof DOMException&&function(e){return e&&0!==e.length}(e)&&(22===(n=t).code||1014===n.code||"QuotaExceededError"===n.name||"NS_ERROR_DOM_QUATA_REACHED"===n.name)?i.STORAGE_STATUS.EXCEED:i.STORAGE_STATUS.UNAVAILABLE;var n}))}(e)}}}t.parentSS=l},43374:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.throttle=function(e,t,n){let a,o,r,i,s=0;n||(n={});const l=function(){s=!1===n.leading?0:Date.now(),a=null,i=e.apply(o,r),a||(o=r=null)},u=function(){const u=Date.now();s||!1!==n.leading||(s=u);const c=t-(u-s);return o=this,r=arguments,c<=0||c>t?(a&&(clearTimeout(a),a=null),s=u,i=e.apply(o,r),a||(o=r=null)):a||!1===n.trailing||(a=setTimeout(l,c)),i};return u.cancel=function(){clearTimeout(a),s=0,a=o=r=null},u}},4623:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.tryCatch=function(e,t){try{return e()}catch(e){return(0,a.isFunction)(t)?t(e):t}};var a=n(55004)},76784:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.union=void 0;var a=n(99830);t.union=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),o=1;oArray.from(new Set(e))},15201:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.without=void 0;t.without=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),a=1;a!o.has(e)))}},94184:function(e,t){var n; /*! Copyright (c) 2018 Jed Watson. Licensed under the MIT License (MIT), see http://jedwatson.github.io/classnames */!function(){"use strict";var a={}.hasOwnProperty;function o(){for(var e=[],t=0;t1?arguments[1]:void 0,m=void 0!==g;m&&(g=a(g,h>2?arguments[2]:void 0));var _,v,y,b,E,T,C=f(t),O=0;if(!C||this===p&&s(C))for(_=u(t),v=n?new this(_):p(_);_>O;O++)T=m?g(t[O],O):t[O],c(v,O,T);else for(E=(b=d(t,C)).next,v=n?new this:[];!(y=o(E,b)).done;O++)T=m?i(b,g,[y.value,O],!0):y.value,c(v,O,T);return v.length=O,v}},31692:function(e,t,n){var a=n(74529),o=n(59413),r=n(10623),i=function(e){return function(t,n,i){var s,l=a(t),u=r(l),c=o(i,u);if(e&&n!=n){for(;u>c;)if((s=l[c++])!=s)return!0}else for(;u>c;c++)if((e||c in l)&&l[c]===n)return e||c||0;return!e&&-1}};e.exports={includes:i(!0),indexOf:i(!1)}},3610:function(e,t,n){var a=n(86843),o=n(95329),r=n(37026),i=n(89678),s=n(10623),l=n(64692),u=o([].push),c=function(e){var t=1==e,n=2==e,o=3==e,c=4==e,d=6==e,f=7==e,p=5==e||d;return function(h,g,m,_){for(var v,y,b=i(h),E=r(b),T=a(g,m),C=s(E),O=0,S=_||l,w=t?S(h,C):n||f?S(h,0):void 0;C>O;O++)if((p||O in E)&&(y=T(v=E[O],O,b),e))if(t)w[O]=y;else if(y)switch(e){case 3:return!0;case 5:return v;case 6:return O;case 2:u(w,v)}else switch(e){case 4:return!1;case 7:u(w,v)}return d?-1:o||c?c:w}};e.exports={forEach:c(0),map:c(1),filter:c(2),some:c(3),every:c(4),find:c(5),findIndex:c(6),filterReject:c(7)}},50568:function(e,t,n){var a=n(95981),o=n(99813),r=n(53385),i=o("species");e.exports=function(e){return r>=51||!a((function(){var t=[];return(t.constructor={})[i]=function(){return{foo:1}},1!==t[e](Boolean).foo}))}},34194:function(e,t,n){"use strict";var a=n(95981);e.exports=function(e,t){var n=[][e];return!!n&&a((function(){n.call(null,t||function(){return 1},1)}))}},15790:function(e,t,n){var a=n(59413),o=n(10623),r=n(55449),i=Array,s=Math.max;e.exports=function(e,t,n){for(var l=o(e),u=a(t,l),c=a(void 0===n?l:n,l),d=i(s(c-u,0)),f=0;u1?arguments[1]:void 0;return i(this),(t=void 0!==p)&&r(p),s(e)?new this:(n=[],t?(c=0,d=a(p,f>2?arguments[2]:void 0),l(e,(function(e){o(u,n,d(e,c++))}))):l(e,u,{that:n}),new this(n))}},45226:function(e,t,n){"use strict";var a=n(93765);e.exports=function(){return new this(a(arguments))}},85616:function(e,t,n){"use strict";var a=n(65988).f,o=n(29290),r=n(94380),i=n(86843),s=n(5743),l=n(82119),u=n(93091),c=n(75105),d=n(23538),f=n(94431),p=n(55746),h=n(21647).fastKey,g=n(45402),m=g.set,_=g.getterFor;e.exports={getConstructor:function(e,t,n,c){var d=e((function(e,a){s(e,f),m(e,{type:t,index:o(null),first:void 0,last:void 0,size:0}),p||(e.size=0),l(a)||u(a,e[c],{that:e,AS_ENTRIES:n})})),f=d.prototype,g=_(t),v=function(e,t,n){var a,o,r=g(e),i=y(e,t);return i?i.value=n:(r.last=i={index:o=h(t,!0),key:t,value:n,previous:a=r.last,next:void 0,removed:!1},r.first||(r.first=i),a&&(a.next=i),p?r.size++:e.size++,"F"!==o&&(r.index[o]=i)),e},y=function(e,t){var n,a=g(e),o=h(t);if("F"!==o)return a.index[o];for(n=a.first;n;n=n.next)if(n.key==t)return n};return r(f,{clear:function(){for(var e=g(this),t=e.index,n=e.first;n;)n.removed=!0,n.previous&&(n.previous=n.previous.next=void 0),delete t[n.index],n=n.next;e.first=e.last=void 0,p?e.size=0:this.size=0},delete:function(e){var t=this,n=g(t),a=y(t,e);if(a){var o=a.next,r=a.previous;delete n.index[a.index],a.removed=!0,r&&(r.next=o),o&&(o.previous=r),n.first==a&&(n.first=o),n.last==a&&(n.last=r),p?n.size--:t.size--}return!!a},forEach:function(e){for(var t,n=g(this),a=i(e,arguments.length>1?arguments[1]:void 0);t=t?t.next:n.first;)for(a(t.value,t.key,this);t&&t.removed;)t=t.previous},has:function(e){return!!y(this,e)}}),r(f,n?{get:function(e){var t=y(this,e);return t&&t.value},set:function(e,t){return v(this,0===e?0:e,t)}}:{add:function(e){return v(this,e=0===e?0:e,e)}}),p&&a(f,"size",{get:function(){return g(this).size}}),d},setStrong:function(e,t,n){var a=t+" Iterator",o=_(t),r=_(a);c(e,t,(function(e,t){m(this,{type:a,target:e,state:o(e),kind:t,last:void 0})}),(function(){for(var e=r(this),t=e.kind,n=e.last;n&&n.removed;)n=n.previous;return e.target&&(e.last=n=n?n.next:e.state.first)?d("keys"==t?n.key:"values"==t?n.value:[n.key,n.value],!1):(e.target=void 0,d(void 0,!0))}),n?"entries":"values",!n,!0),f(t)}}},24683:function(e,t,n){"use strict";var a=n(76887),o=n(21899),r=n(21647),i=n(95981),s=n(32029),l=n(93091),u=n(5743),c=n(57475),d=n(10941),f=n(90904),p=n(65988).f,h=n(3610).forEach,g=n(55746),m=n(45402),_=m.set,v=m.getterFor;e.exports=function(e,t,n){var m,y=-1!==e.indexOf("Map"),b=-1!==e.indexOf("Weak"),E=y?"set":"add",T=o[e],C=T&&T.prototype,O={};if(g&&c(T)&&(b||C.forEach&&!i((function(){(new T).entries().next()})))){var S=(m=t((function(t,n){_(u(t,S),{type:e,collection:new T}),null!=n&&l(n,t[E],{that:t,AS_ENTRIES:y})}))).prototype,w=v(e);h(["add","clear","delete","forEach","get","has","set","keys","values","entries"],(function(e){var t="add"==e||"set"==e;!(e in C)||b&&"clear"==e||s(S,e,(function(n,a){var o=w(this).collection;if(!t&&b&&!d(n))return"get"==e&&void 0;var r=o[e](0===n?0:n,a);return t?this:r}))})),b||p(S,"size",{configurable:!0,get:function(){return w(this).collection.size}})}else m=n.getConstructor(t,e,y,E),r.enable();return f(m,e,!1,!0),O[e]=m,a({global:!0,forced:!0},O),b||n.setStrong(m,e,y),m}},64160:function(e,t,n){var a=n(95981);e.exports=!a((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}))},23538:function(e){e.exports=function(e,t){return{value:e,done:t}}},32029:function(e,t,n){var a=n(55746),o=n(65988),r=n(31887);e.exports=a?function(e,t,n){return o.f(e,t,r(1,n))}:function(e,t,n){return e[t]=n,e}},31887:function(e){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},55449:function(e,t,n){"use strict";var a=n(83894),o=n(65988),r=n(31887);e.exports=function(e,t,n){var i=a(t);i in e?o.f(e,i,r(0,n)):e[i]=n}},95929:function(e,t,n){var a=n(32029);e.exports=function(e,t,n,o){return o&&o.enumerable?e[t]=n:a(e,t,n),e}},94380:function(e,t,n){var a=n(95929);e.exports=function(e,t,n){for(var o in t)n&&n.unsafe&&e[o]?e[o]=t[o]:a(e,o,t[o],n);return e}},75609:function(e,t,n){var a=n(21899),o=Object.defineProperty;e.exports=function(e,t){try{o(a,e,{value:t,configurable:!0,writable:!0})}catch(n){a[e]=t}return t}},55746:function(e,t,n){var a=n(95981);e.exports=!a((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}))},76616:function(e){var t="object"==typeof document&&document.all,n=void 0===t&&void 0!==t;e.exports={all:t,IS_HTMLDDA:n}},61333:function(e,t,n){var a=n(21899),o=n(10941),r=a.document,i=o(r)&&o(r.createElement);e.exports=function(e){return i?r.createElement(e):{}}},66796:function(e){var t=TypeError;e.exports=function(e){if(e>9007199254740991)throw t("Maximum allowed index exceeded");return e}},63281:function(e){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}},2861:function(e,t,n){var a=n(626);e.exports=a("navigator","userAgent")||""},53385:function(e,t,n){var a,o,r=n(21899),i=n(2861),s=r.process,l=r.Deno,u=s&&s.versions||l&&l.version,c=u&&u.v8;c&&(o=(a=c.split("."))[0]>0&&a[0]<4?1:+(a[0]+a[1])),!o&&i&&(!(a=i.match(/Edge\/(\d+)/))||a[1]>=74)&&(a=i.match(/Chrome\/(\d+)/))&&(o=+a[1]),e.exports=o},35703:function(e,t,n){var a=n(54058);e.exports=function(e){return a[e+"Prototype"]}},56759:function(e){e.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},76887:function(e,t,n){"use strict";var a=n(21899),o=n(79730),r=n(97484),i=n(57475),s=n(49677).f,l=n(37252),u=n(54058),c=n(86843),d=n(32029),f=n(90953),p=function(e){var t=function(n,a,r){if(this instanceof t){switch(arguments.length){case 0:return new e;case 1:return new e(n);case 2:return new e(n,a)}return new e(n,a,r)}return o(e,this,arguments)};return t.prototype=e.prototype,t};e.exports=function(e,t){var n,o,h,g,m,_,v,y,b=e.target,E=e.global,T=e.stat,C=e.proto,O=E?a:T?a[b]:(a[b]||{}).prototype,S=E?u:u[b]||d(u,b,{})[b],w=S.prototype;for(h in t)n=!l(E?h:b+(T?".":"#")+h,e.forced)&&O&&f(O,h),m=S[h],n&&(_=e.dontCallGetSet?(y=s(O,h))&&y.value:O[h]),g=n&&_?_:t[h],n&&typeof m==typeof g||(v=e.bind&&n?c(g,a):e.wrap&&n?p(g):C&&i(g)?r(g):g,(e.sham||g&&g.sham||m&&m.sham)&&d(v,"sham",!0),d(S,h,v),C&&(f(u,o=b+"Prototype")||d(u,o,{}),d(u[o],h,g),e.real&&w&&!w[h]&&d(w,h,g)))}},95981:function(e){e.exports=function(e){try{return!!e()}catch(e){return!0}}},45602:function(e,t,n){var a=n(95981);e.exports=!a((function(){return Object.isExtensible(Object.preventExtensions({}))}))},79730:function(e,t,n){var a=n(18285),o=Function.prototype,r=o.apply,i=o.call;e.exports="object"==typeof Reflect&&Reflect.apply||(a?i.bind(r):function(){return i.apply(r,arguments)})},86843:function(e,t,n){var a=n(97484),o=n(24883),r=n(18285),i=a(a.bind);e.exports=function(e,t){return o(e),void 0===t?e:r?i(e,t):function(){return e.apply(t,arguments)}}},18285:function(e,t,n){var a=n(95981);e.exports=!a((function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")}))},98308:function(e,t,n){"use strict";var a=n(95329),o=n(24883),r=n(10941),i=n(90953),s=n(93765),l=n(18285),u=Function,c=a([].concat),d=a([].join),f={},p=function(e,t,n){if(!i(f,t)){for(var a=[],o=0;ov;v++)if((b=P(e[v]))&&u(g,b))return b;return new h(!1)}m=c(e,_)}for(E=S?e.next:m.next;!(T=o(E,m)).done;){try{b=P(T.value)}catch(e){f(m,"throw",e)}if("object"==typeof b&&b&&u(g,b))return b}return new h(!1)}},7609:function(e,t,n){var a=n(78834),o=n(96059),r=n(14229);e.exports=function(e,t,n){var i,s;o(e);try{if(!(i=r(e,"return"))){if("throw"===t)throw n;return n}i=a(i,e)}catch(e){s=!0,i=e}if("throw"===t)throw n;if(s)throw i;return o(i),n}},53847:function(e,t,n){"use strict";var a=n(35143).IteratorPrototype,o=n(29290),r=n(31887),i=n(90904),s=n(12077),l=function(){return this};e.exports=function(e,t,n,u){var c=t+" Iterator";return e.prototype=o(a,{next:r(+!u,n)}),i(e,c,!1,!0),s[c]=l,e}},75105:function(e,t,n){"use strict";var a=n(76887),o=n(78834),r=n(82529),i=n(79417),s=n(57475),l=n(53847),u=n(249),c=n(88929),d=n(90904),f=n(32029),p=n(95929),h=n(99813),g=n(12077),m=n(35143),_=i.PROPER,v=i.CONFIGURABLE,y=m.IteratorPrototype,b=m.BUGGY_SAFARI_ITERATORS,E=h("iterator"),T="keys",C="values",O="entries",S=function(){return this};e.exports=function(e,t,n,i,h,m,w){l(n,t,i);var A,I,M,P=function(e){if(e===h&&x)return x;if(!b&&e in N)return N[e];switch(e){case T:case C:case O:return function(){return new n(this,e)}}return function(){return new n(this)}},R=t+" Iterator",k=!1,N=e.prototype,D=N[E]||N["@@iterator"]||h&&N[h],x=!b&&D||P(h),L="Array"==t&&N.entries||D;if(L&&(A=u(L.call(new e)))!==Object.prototype&&A.next&&(r||u(A)===y||(c?c(A,y):s(A[E])||p(A,E,S)),d(A,R,!0,!0),r&&(g[R]=S)),_&&h==C&&D&&D.name!==C&&(!r&&v?f(N,"name",C):(k=!0,x=function(){return o(D,this)})),h)if(I={values:P(C),keys:m?x:P(T),entries:P(O)},w)for(M in I)(b||k||!(M in N))&&p(N,M,I[M]);else a({target:t,proto:!0,forced:b||k},I);return r&&!w||N[E]===x||p(N,E,x,{name:h}),g[t]=x,I}},35143:function(e,t,n){"use strict";var a,o,r,i=n(95981),s=n(57475),l=n(10941),u=n(29290),c=n(249),d=n(95929),f=n(99813),p=n(82529),h=f("iterator"),g=!1;[].keys&&("next"in(r=[].keys())?(o=c(c(r)))!==Object.prototype&&(a=o):g=!0),!l(a)||i((function(){var e={};return a[h].call(e)!==e}))?a={}:p&&(a=u(a)),s(a[h])||d(a,h,(function(){return this})),e.exports={IteratorPrototype:a,BUGGY_SAFARI_ITERATORS:g}},12077:function(e){e.exports={}},10623:function(e,t,n){var a=n(43057);e.exports=function(e){return a(e.length)}},48721:function(e,t,n){"use strict";var a=n(78834),o=n(24883),r=n(96059);e.exports=function(e,t){var n,i,s=r(this),l=o(s.get),u=o(s.has),c=o(s.set);return a(u,s,e)?(n=a(l,s,e),"update"in t&&(n=t.update(n,e,s),a(c,s,e,n)),n):(i=t.insert(e,s),a(c,s,e,i),i)}},20716:function(e,t,n){"use strict";var a=n(78834),o=n(24883),r=n(57475),i=n(96059),s=TypeError;e.exports=function(e,t){var n,l=i(this),u=o(l.get),c=o(l.has),d=o(l.set),f=arguments.length>2?arguments[2]:void 0;if(!r(t)&&!r(f))throw s("At least one callback required");return a(c,l,e)?(n=a(u,l,e),r(t)&&(n=t(n),a(d,l,e,n))):r(f)&&(n=f(),a(d,l,e,n)),n}},35331:function(e){var t=Math.ceil,n=Math.floor;e.exports=Math.trunc||function(e){var a=+e;return(a>0?n:t)(a)}},24420:function(e,t,n){"use strict";var a=n(55746),o=n(95329),r=n(78834),i=n(95981),s=n(14771),l=n(87857),u=n(36760),c=n(89678),d=n(37026),f=Object.assign,p=Object.defineProperty,h=o([].concat);e.exports=!f||i((function(){if(a&&1!==f({b:1},f(p({},"a",{enumerable:!0,get:function(){p(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var e={},t={},n=Symbol(),o="abcdefghijklmnopqrst";return e[n]=7,o.split("").forEach((function(e){t[e]=e})),7!=f({},e)[n]||s(f({},t)).join("")!=o}))?function(e,t){for(var n=c(e),o=arguments.length,i=1,f=l.f,p=u.f;o>i;)for(var g,m=d(arguments[i++]),_=f?h(s(m),f(m)):s(m),v=_.length,y=0;v>y;)g=_[y++],a&&!r(p,m,g)||(n[g]=m[g]);return n}:f},29290:function(e,t,n){var a,o=n(96059),r=n(59938),i=n(56759),s=n(27748),l=n(15463),u=n(61333),c=n(44262),d=c("IE_PROTO"),f=function(){},p=function(e){return"