/** * body-scroll-lock * * Copyright (c) 2018 Will Po * @license Licensed under MIT license * * You can obtain a copy of the License at * gis.goinstore.com/static-common/licenses/MIT-License.txt */ var gisAppLib= gisAppLib || {}; !function(e,o){var t={};o(t),e.bodyScrollLock=t}(gisAppLib,function(exports){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=!1;if("undefined"!=typeof window){var e={get passive(){t=!0}};window.addEventListener("testPassive",null,e),window.removeEventListener("testPassive",null,e)}function d(o){return s.some(function(e){return!(!e.options.allowTouchMove||!e.options.allowTouchMove(o))})}function l(e){var o=e||window.event;return!!d(o.target)||(1c)return!1;var d=a.indexOf(";",c+1);return d=0>d?a.length:d,a.slice(c+m,d)},setCookie:function(a){b.cookie=l+"="+a}};var o=a._LTracker,p=new d;if(o&&o.length){var q=0,r=o.length;for(q=0;r>q;q++)p.push(o[q])}a._LTracker=p,a.LogglyTracker=d}(window,document); /** * post-robot * * Copyright 2016 PayPal * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * http://www.apache.org/licenses/LICENSE-2.0 * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ var gisAppLib= gisAppLib || {}; !function(n,e){n.postRobot=e()}(gisAppLib,(function(){return function(n){var e={};function t(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return n[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}return t.m=n,t.c=e,t.d=function(n,e,r){t.o(n,e)||Object.defineProperty(n,e,{enumerable:!0,get:r})},t.r=function(n){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(n,"__esModule",{value:!0})},t.t=function(n,e){if(1&e&&(n=t(n)),8&e)return n;if(4&e&&"object"==typeof n&&n&&n.__esModule)return n;var r=Object.create(null);if(t.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:n}),2&e&&"string"!=typeof n)for(var o in n)t.d(r,o,function(e){return n[e]}.bind(null,o));return r},t.n=function(n){var e=n&&n.__esModule?function(){return n.default}:function(){return n};return t.d(e,"a",e),e},t.o=function(n,e){return{}.hasOwnProperty.call(n,e)},t.p="",t(t.s=0)}([function(n,e,t){"use strict";function r(n){return"[object RegExp]"==={}.toString.call(n)}t.r(e),t.d(e,"Promise",(function(){return A})),t.d(e,"TYPES",(function(){return Zn})),t.d(e,"ProxyWindow",(function(){return En})),t.d(e,"setup",(function(){return Kn})),t.d(e,"destroy",(function(){return Yn})),t.d(e,"serializeMessage",(function(){return Bn})),t.d(e,"deserializeMessage",(function(){return Jn})),t.d(e,"createProxyWindow",(function(){return Hn})),t.d(e,"toProxyWindow",(function(){return Un})),t.d(e,"on",(function(){return Ln})),t.d(e,"once",(function(){return qn})),t.d(e,"send",(function(){return Fn})),t.d(e,"markWindowKnown",(function(){return ln})),t.d(e,"cleanUpWindow",(function(){return $n})),t.d(e,"bridge",(function(){}));var o="Call was rejected by callee.\r\n";function i(n){return void 0===n&&(n=window),"about:"===n.location.protocol}function a(n){if(void 0===n&&(n=window),n)try{if(n.parent&&n.parent!==n)return n.parent}catch(n){}}function u(n){if(void 0===n&&(n=window),n&&!a(n))try{return n.opener}catch(n){}}function c(n){try{return!0}catch(n){}return!1}function s(n){void 0===n&&(n=window);var e=n.location;if(!e)throw new Error("Can not read window location");var t=e.protocol;if(!t)throw new Error("Can not read window protocol");if("file:"===t)return"file://";if("about:"===t){var r=a(n);return r&&c()?s(r):"about://"}var o=e.host;if(!o)throw new Error("Can not read window host");return t+"//"+o}function f(n){void 0===n&&(n=window);var e=s(n);return e&&n.mockDomain&&0===n.mockDomain.indexOf("mock:")?n.mockDomain:e}function d(n){if(!function(n){try{if(n===window)return!0}catch(n){}try{var e=Object.getOwnPropertyDescriptor(n,"location");if(e&&!1===e.enumerable)return!1}catch(n){}try{if(i(n)&&c())return!0}catch(n){}try{if(s(n)===s(window))return!0}catch(n){}return!1}(n))return!1;try{if(n===window)return!0;if(i(n)&&c())return!0;if(f(window)===f(n))return!0}catch(n){}return!1}function l(n){if(!d(n))throw new Error("Expected window to be same domain");return n}function h(n,e){if(!n||!e)return!1;var t=a(e);return t?t===n:-1!==function(n){var e=[];try{for(;n.parent!==n;)e.push(n.parent),n=n.parent}catch(n){}return e}(e).indexOf(n)}function w(n){var e,t,r=[];try{e=n.frames}catch(t){e=n}try{t=e.length}catch(n){}if(0===t)return r;if(t){for(var o=0;o>>0)+"__",function(){if("undefined"==typeof WeakMap)return!1;if(void 0===Object.freeze)return!1;try{var n=new WeakMap,e={};return Object.freeze(e),n.set(e,"__testvalue__"),"__testvalue__"===n.get(e)}catch(n){return!1}}())try{this.weakmap=new WeakMap}catch(n){}this.keys=[],this.values=[]}var e=n.prototype;return e._cleanupClosedWindows=function(){for(var n=this.weakmap,e=this.keys,t=0;t=3)return"stringifyError stack overflow";try{if(!n)return"";if("string"==typeof n)return n;if(n instanceof Error){var t=n&&n.stack,r=n&&n.message;if(t&&r)return-1!==t.indexOf(r)?t:r+"\n"+t;if(t)return t;if(r)return r}return n&&n.toString&&"function"==typeof n.toString?n.toString():{}.toString.call(n)}catch(n){return"Error while stringifying error: "+H(n,e+1)}}function U(n){return"string"==typeof n?n:n&&n.toString&&"function"==typeof n.toString?n.toString():{}.toString.call(n)}function K(n){return"[object RegExp]"==={}.toString.call(n)}function Y(n,e,t){if(n.hasOwnProperty(e))return n[e];var r=t();return n[e]=r,r}function Z(){var n=document.body;if(!n)throw new Error("Body element not found");return n}function $(){return Boolean(document.body)&&"complete"===document.readyState}function G(){return Boolean(document.body)&&"interactive"===document.readyState}F.clear=function(){q=L},F((function(n){if(Object.values)return Object.values(n);var e=[];for(var t in n)n.hasOwnProperty(t)&&e.push(n[t]);return e})),Error,F((function(){return new A((function(n){if($()||G())return n();var e=setInterval((function(){if($()||G())return clearInterval(e),n()}),10)}))}));var Q="undefined"!=typeof document?document.currentScript:null,V=F((function(){if(Q)return Q;if(Q=function(){try{var n=function(){try{throw new Error("_")}catch(n){return n.stack||""}}(),e=/.*at [^(]*\((.*):(.+):(.+)\)$/gi.exec(n),t=e&&e[1];if(!t)return;for(var r=0,o=[].slice.call(document.getElementsByTagName("script")).reverse();r { ... }":"<"+typeof n+">"})).join(", ")+") failed\n\n")+n.stack),n}))})).then((function(n){return{result:n,id:o,name:i}}))}))}));var c=t.__id__||M();n=En.unwrap(n);var s=t.__name__||t.name||r;return"string"==typeof s&&"function"==typeof s.indexOf&&0===s.indexOf("anonymous::")&&(s=s.replace("anonymous::",r+"::")),En.isProxyWindow(n)?(xn(c,t,s,n,e),n.awaitWindow().then((function(n){xn(c,t,s,n,e)}))):xn(c,t,s,n,e),pn("cross_domain_function",{id:c,name:s})}function kn(n,e,t,r){var o,i=r.on,a=r.send;return function(n,e){void 0===e&&(e=yn);var t=JSON.stringify(n,(function(n){var t=this[n];if(hn(this))return t;var r=wn(t);if(!r)return t;var o=e[r]||vn[r];return o?o(t,n):t}));return void 0===t?"undefined":t}(t,((o={}).promise=function(t,r){return function(n,e,t,r,o){return pn("cross_domain_zalgo_promise",{then:jn(n,e,(function(n,e){return t.then(n,e)}),r,{on:o.on,send:o.send})})}(n,e,t,r,{on:i,send:a})},o.function=function(t,r){return jn(n,e,t,r,{on:i,send:a})},o.object=function(n){return _(n)||En.isProxyWindow(n)?pn("cross_domain_window",En.serialize(n,{send:a})):n},o))}function On(n,e,t,r){var o,i=r.send;return function(n,e){if(void 0===e&&(e=_n),"undefined"!==n)return JSON.parse(n,(function(n,t){if(hn(this))return t;var r,o;if(hn(t)?(r=t.__type__,o=t.__val__):(r=wn(t),o=t),!r)return o;var i=e[r]||gn[r];return i?i(o,n):o}))}(t,((o={}).cross_domain_zalgo_promise=function(n){return function(n,e,t){return new A(t.then)}(0,0,n)},o.cross_domain_function=function(t){return function(n,e,t,r){var o=t.id,i=t.name,a=r.send,u=function(t){function r(){var u=arguments;return En.toProxyWindow(n,{send:a}).awaitWindow().then((function(n){var c=Sn(n,o);if(c&&c.val!==r)return c.val.apply({source:window,origin:f()},u);var s=[].slice.call(u);return t.fireAndForget?a(n,"postrobot_method",{id:o,name:i,args:s},{domain:e,fireAndForget:!0}):a(n,"postrobot_method",{id:o,name:i,args:s},{domain:e,fireAndForget:!1}).then((function(n){return n.data.result}))})).catch((function(n){throw n}))}return void 0===t&&(t={}),r.__name__=i,r.__origin__=e,r.__source__=n,r.__id__=o,r.origin=e,r},c=u();return c.fireAndForget=u({fireAndForget:!0}),c}(n,e,t,{send:i})},o.cross_domain_window=function(n){return En.deserialize(n,{send:i})},o))}var Pn={};function An(n,e,t,r){var o=r.on,i=r.send;return A.try((function(){var r=un().getOrSet(n,(function(){return{}}));return r.buffer=r.buffer||[],r.buffer.push(t),r.flush=r.flush||A.flush().then((function(){if(v(n))throw new Error("Window is closed");var t,a=kn(n,e,((t={}).__post_robot_10_0_44__=r.buffer||[],t),{on:o,send:i});delete r.buffer;for(var u=Object.keys(Pn),c=[],s=0;s=A.oneToOneEngagement.reshowDuration)&&A.oneToOneEngagement&&A.oneToOneEngagement.enabled&&function(e){if(autoPlayService.isAutoPlaySetup()||!e)return;autoPlayService.setupAutoplay(e,f,{playerInitialize:function(){t.hide()},playerClicked:function(){"replay_engagement"==e.autoPlayType?replayCtrl.playReplay(e):"call"==e.autoPlayType&&(autoPlayService.storeAutoPlayReshowTimestamp(e),callCtrl.startCallJourney({routingKey:null,type:GIS_CONSTANTS.CALL_TYPES.STANDARD}))},playerDismissed:function(){window.dispatchEvent(new GisCustomEvent("gisUIClosed")),t.show()},playerPlay:function(){("call"==e.autoPlayType||"replay_engagement"==e.autoPlayType&&e.config.announcementChannel.enabled)&&autoPlayService.storeAutoPlayReshowTimestamp(e)}})}(function(e){var n=A.oneToOneEngagement,t=stateService.getOneToOneAutoPlay();{if(n.src.serviceIntro&&t&&t.config.ctaAutoPlay.enabled&&(!v(t)||L(t)))return t;if(n.src.replay&&e)return e.autoPlayType="replay_engagement",e}return null}(e))}function _(e){t.setMode('replay',e,A.persistentCta,!1),g(function(){e.config.announcementChannel.enabled&&autoPlayService.storeAutoPlayReshowTimestamp(e),replayCtrl.playReplay(e)}),e.config.ctaAutoPlay.enabled&&(autoPlayService.isAutoPlaySetup()||autoPlayService.setupAutoplay(e,f,{playerInitialize:function(){t.hide()},playerClicked:function(){replayCtrl.playReplay(e)},playerDismissed:function(){window.dispatchEvent(new GisCustomEvent("gisUIClosed")),t.show()},playerPlay:function(){e.config.announcementChannel.enabled&&autoPlayService.storeAutoPlayReshowTimestamp(e)}}))}function v(e){var n=clientStorageService.getItem(clientStorageService.storageKeys.VIDEO_VIEWED);return n&&n[e.id]}function L(e){var n=e.config,t=clientStorageService.getItem(clientStorageService.storageKeys.VIDEO_VIEWED);return t&&t[e.id]&&n.announcementChannel.reshow.enabled&&utilitiesService.dateDifferenceInDays(Date.parse(t[e.id]),new Date)>=n.announcementChannel.reshow.reshowDuration}return t="tab"===e?ctaTabDOMProc:ctaRoundelDOMProc,{init:function(){window.addEventListener("gisUIClosed",function(e){stateService.setUIActive(!1),!pollingService.isPollingTimeExpiredForEvent(pollingService.BASE_EVENTS.CLERK_AVAILABILITY_POLLING)&&A.persistentCta&&(pollingService.subscribe(pollingService.BASE_EVENTS.CLERK_AVAILABILITY_POLLING,GISAPP.Sym_Sys.clerkIsAvailable,GISAPP.Sym_Sys.clerkIsNotAvailable),pollingService.startPollingEvent(pollingService.BASE_EVENTS.CLERK_AVAILABILITY_POLLING)),e.detail&&e.detail.action===GIS_CONSTANTS.ACTIONS.BROADCAST_SCREEN_CLOSED?gisService.getBroadcasts(null,"broadcastCallback"):n()}),window.addEventListener("gisUIOpen",function(e){stateService.setUIActive(!0),T(),autoPlayService.destroyAutoPlay()})},updateCTA:n,showCTA:S,hideCTA:T,setOnClick:g}};GISAPP.broadcastCtrl=function(callCtrl,serverInjectionService,activityLoggerService,gaService,browserInfoService,deviceInfoService,stateService,eventLoggerService,retailerFunctionalityCtrl,hlsCtrl,chatInputDOMProc,broadcastDOMProc,callUserService,pageUnloadService,utilitiesService,gisService,emailSubmitComponent,preCallScreen,uiUtilitiesService,modalComponent,modalContentComponent,clientStorageService,buttonComponent,contactCaptureCtrl,GIS_CONSTANTS,pollingService,gisPlayerScreen,shopStreamService,urlUtilitiesService,callService,eventService){'use strict';var e,a,o,n,i,s,l,r,A,E,S,T,u={},c={},C={NAVIGATE:"navigate"},_=!1,I=!1,t="AVAILABLE",d="UNAVAILABLE",O="NONE",L=O,N=0,g=!1,D=!1,B=!1,R=!1;function f(e,t,n){pollingService.registerPollingEvent(pollingService.BASE_EVENTS.SCHEDULED_BROADCAST_POLLING,{poll:gisService.getBroadcastsEvent,pollArguments:[utilitiesService.utf8ToBase64(t),null,"broadcastCallback"],pollWithOnSuccessAndFailure:!1,interval:n||null}),pollingService.subscribe(pollingService.BASE_EVENTS.SCHEDULED_BROADCAST_POLLING,function(){},function(){}),pollingService.startPollingEvent(pollingService.BASE_EVENTS.SCHEDULED_BROADCAST_POLLING),g=!0}function V(){pollingService.stopPollingEvent(pollingService.BASE_EVENTS.SCHEDULED_BROADCAST_POLLING),pollingService.events.scheduledBroadcastPolling=null,g=!1}function p(){u.broadcastContactCaptureData={broadcastId:c.id,viewDuration:W()||0},gaService.sendAnalyticsEvent(gaService.ANALYTICS_EVENTS.BROADCAST_DURATION,{duration:W()})}function m(){serverInjectionService.getSystemConfig().oneToOneCta.broadcast&&i.config.oneToOneInBroadcast&&(L=O,pollingService.subscribe(pollingService.BASE_EVENTS.CLERK_AVAILABILITY_POLLING,v,P),pollingService.startPollingEvent(pollingService.BASE_EVENTS.CLERK_AVAILABILITY_POLLING))}function v(){if(L!==t){L=t;var e=serverInjectionService.getSystemConfig();stateService.setClerkAvailability(!0),U(e.persistentCta,!0)}}function P(){if(L!==d){L=d;var e=serverInjectionService.getSystemConfig();stateService.setClerkAvailability(!1),U(e.persistentCta,!1)}}function U(e,t){broadcastDOMProc.setOneToOneCtaOnBroadcast(e,t);var n=(performance.now()-window.gisProfilingStartTime).toFixed(3);t?(eventLoggerService.logEvent(eventLoggerService.GIS_EVENTS.CALL_CTA_SHOWN_ON_BROADCAST,{timeElapsed:n}),gaService.sendAnalyticsEvent(gaService.ANALYTICS_EVENTS.CALL_CTA_SHOWN_ON_BROADCAST)):!t&&e&&(eventLoggerService.logEvent(eventLoggerService.GIS_EVENTS.CALL_CTA_SHOWN_ON_BROADCAST_UNAVAILABLE,{timeElapsed:n}),gaService.sendAnalyticsEvent(gaService.ANALYTICS_EVENTS.CALL_CTA_SHOWN_ON_BROADCAST_UNAVAILABLE)),function(t){if(!t||'function'!=typeof t)return;broadcastDOMProc.setOnCtaClickEvent(function(e){t(e)})}(function(e){callCtrl.startCallJourney({routingKey:null,type:GIS_CONSTANTS.CALL_TYPES.STANDARD},e),t?(eventLoggerService.logEvent(eventLoggerService.GIS_EVENTS.CALL_CTA_CLICK_FROM_BROADCAST,{channelId:i.channelId}),gaService.sendAnalyticsEvent(gaService.ANALYTICS_EVENTS.CALL_CTA_CLICK_FROM_BROADCAST)):(eventLoggerService.logEvent(eventLoggerService.GIS_EVENTS.CALL_CTA_CLICK_UNAVAILABLE_ON_BROADCAST,{channelId:i.channelId}),gaService.sendAnalyticsEvent(gaService.ANALYTICS_EVENTS.CALL_CTA_CLICK_UNAVAILABLE_ON_BROADCAST)),I||callService.isRedirectJourney()?stateService.setCallUUID(null):broadcastDOMProc.hide()})}function b(){eventLoggerService.logEvent(eventLoggerService.GIS_EVENTS.SHOP_STREAM_USER_DURATION,{viewDuration:W(),callUUID:y(),broadcastId:i.id,shopStreamType:"broadcast",channelId:i.channelId})}function G(){e?broadcastDOMProc.stopVideo():(hlsCtrl.destroy(),c=null)}function y(){return c&&c.callUUID?c.callUUID:""}function h(){utilitiesService.supportsHLS()&&!utilitiesService.supportsMediaSource()?(broadcastDOMProc.getVideoElement().src=c.urls[0],H()):(hlsCtrl.registerOnManifestParsed(H),hlsCtrl.registerOnErrorFunction(Y),hlsCtrl.loadHls(Q))}function w(){var e=(new Date).getTime();N+=e-l}function W(){return((new Date).getTime()-s-N)/1e3}function K(e){var t=serverInjectionService.getSystemConfig();if(stateService.setCurrentPhase(stateService.phase.BROADCAST_END),_||w(),p(),pageUnloadService.unregisterFunction(K),a=0,G(),chatInputDOMProc.dispose(),stateService.setCallStartTime(0),o&&o(),stateService.setCurrentPhase(stateService.phase.READY),t&&t.captureInfo&&t.captureInfo.views&&!0===t.captureInfo.views.broadcast&&"object"==typeof e&&"click"===e.type&&1<=u.broadcastContactCaptureData.viewDuration){var n=clientStorageService.getItem(clientStorageService.storageKeys.BROADCAST_CONTACT_CAPTURE)||{};n&&!n[u.broadcastContactCaptureData.broadcastId]&&contactCaptureCtrl.init("broadcast",u.broadcastContactCaptureData)}stateService.setCallUUID(null),L=O,t.oneToOneCta.broadcast&&i.config.oneToOneInBroadcast&&pollingService.unSubscribe(pollingService.BASE_EVENTS.CLERK_AVAILABILITY_POLLING,v,P),pollingService.startPollingEvent(pollingService.BASE_EVENTS.BROADCAST_POLLING),pollingService.stopPollingEvent(pollingService.BASE_EVENTS.BROADCAST_VIEW_DURATION_POLLING),b(),eventLoggerService.logEvent(eventLoggerService.GIS_VIEWS.BROADCAST+eventLoggerService.GIS_ACTIONS.CLOSED,{url:urlUtilitiesService.getUrlWithoutParamsWithLimit(500),broadcastId:i.id,callUUID:stateService.getCallUUID()}),N=0,l=s=null,_=!1,deviceInfoService.isIos()&&broadcastDOMProc.clearIntervalOnVideoElement(),pollingService.stopPollingEvent(pollingService.BASE_EVENTS.PRODUCTS_FOR_CAROUSEL_POLLING)}function H(){deviceInfoService.isMobileDevice()?broadcastDOMProc.setOnClickPlay(k):k()}function k(){stateService.setCallStartTime((new Date).getTime()),broadcastDOMProc.playVideo(),stateService.setCurrentPhase(stateService.phase.BROADCAST_PLAYING)}function M(){l=(new Date).getTime(),eventLoggerService.logEvent(eventLoggerService.GIS_EVENTS.SHOP_STREAM_PAUSE_BUTTON_CLICKED,{callUUID:y(),shopStreamType:"broadcast",videoPauseTime:broadcastDOMProc.getVideoElement().currentTime}),pollingService.stopPollingEvent(pollingService.BASE_EVENTS.BROADCAST_VIEW_DURATION_POLLING),deviceInfoService.isIos()&&broadcastDOMProc.clearIntervalOnVideoElement(),_=!1}function Y(e){e.type===Hls.ErrorTypes.NETWORK_ERROR?F():e.fatal&&pollingService.stopPollingEvent(pollingService.BASE_EVENTS.BROADCAST_VIEW_DURATION_POLLING)}function F(){c?gisService.isBroadcastActiveByBroadcastId(c.id,"GISAPP.broadcastCtrl.broadcastHasEnded",function(){broadcastDOMProc.hide()}):broadcastDOMProc.hide()}function Q(e){e&&hlsCtrl.playUrl(broadcastDOMProc.getVideoElement(),c.urls[0])}function X(){a=(new Date).getTime(),s||(s=a),l&&w(),eventLoggerService.logEvent(eventLoggerService.GIS_EVENTS.SHOP_STREAM_PLAY_BUTTON_CLICKED,{callUUID:y(),shopStreamType:"broadcast",videoPlayTime:broadcastDOMProc.getVideoElement().currentTime,channelId:i.channelId}),_||(_=!0,pollingService.startPollingEvent(pollingService.BASE_EVENTS.BROADCAST_VIEW_DURATION_POLLING),deviceInfoService.isIos()&&broadcastDOMProc.setIntervalOnVideoElement(F))}function x(){pollingService.registerPollingEvent(pollingService.BASE_EVENTS.PRODUCTS_FOR_CAROUSEL_POLLING,{poll:J,pollWithOnSuccessAndFailure:!1,pollArguments:[]}),pollingService.subscribe(pollingService.BASE_EVENTS.PRODUCTS_FOR_CAROUSEL_POLLING,function(){},function(){}),pollingService.startPollingEvent(pollingService.BASE_EVENTS.PRODUCTS_FOR_CAROUSEL_POLLING)}function J(){var e=broadcastDOMProc.getCarouselVersion();gisService.isProductCarouselVersionUpdated(i.id,"gisCallbacks.checkCarouselUpdatedCallback",e)}return shopStreamService.isShopStreamEnabled()&&(broadcastDOMProc=new gisPlayerScreen({onPlay:X,onPause:M})),broadcastDOMProc.onVideoPlay(X),broadcastDOMProc.onVideoPause(M),{playBroadcast:function(e,t){return stateService.setCurrentPhase(stateService.phase.BROADCAST_START),pollingService.stopPollingEvent(pollingService.BASE_EVENTS.BROADCAST_POLLING),g&&V(),D&&(D=!1),c&&G(),e?(i=c=e,t&&(o=t),stateService.setCallUUID(y()),!shopStreamService.isChatTypeQuestion(c)&&shopStreamService.isShopStreamEnabled()||callUserService.add(c.type),function(){eventLoggerService.logEvent(eventLoggerService.GIS_VIEWS.BROADCAST+eventLoggerService.GIS_ACTIONS.SHOWN,{url:urlUtilitiesService.getUrlWithoutParamsWithLimit(500),broadcastId:i.id,callUUID:stateService.getCallUUID()});var e=serverInjectionService.getSystemConfig().oneToOneCta.broadcast&&i.config.oneToOneInBroadcast;shopStreamService.isShopStreamEnabled()?broadcastDOMProc.show(e,i):broadcastDOMProc.show(),broadcastDOMProc.setOnClickClose(K),function(){var e=serverInjectionService.getSystemConfig(),t=e.goToShopBtn;t&&t.url&&broadcastDOMProc.setOnClickShop(function(){eventLoggerService.logEvent(eventLoggerService.GIS_VIEWS.BROADCAST+eventLoggerService.GIS_VIEWS.LINK+eventLoggerService.GIS_ACTIONS.CLICKED,{url:t.url}),gaService.sendAnalyticsEvent(gaService.ANALYTICS_EVENTS.BROADCAST_LINK_CLICK,{url:t.url}),window.open(t.url,t.redirect===C.NAVIGATE?'_self':'_blank')});var n=e.specificPageBtn;n&&n.url&&broadcastDOMProc.setOnClickSpecificShop(function(){eventLoggerService.logEvent(eventLoggerService.GIS_VIEWS.BROADCAST+eventLoggerService.GIS_VIEWS.LINK2+eventLoggerService.GIS_ACTIONS.CLICKED,{url:n.url}),gaService.sendAnalyticsEvent(gaService.ANALYTICS_EVENTS.BROADCAST_LINK2_CLICK,{url:n.url}),window.open(n.url,n.redirect===C.NAVIGATE?'_self':'_blank')}),broadcastDOMProc.setOnClickRetailerCustomButton(function(){activityLoggerService.logBroadcastLink2Click("RetailerCustomButton"),eventLoggerService.logEvent(eventLoggerService.GIS_VIEWS.BROADCAST+eventLoggerService.GIS_VIEWS.LINK2+eventLoggerService.GIS_ACTIONS.CLICKED,{url:"RetailerCustomButton"}),gaService.sendAnalyticsEvent(gaService.ANALYTICS_EVENTS.BROADCAST_LINK2_CLICK,{url:"RetailerCustomButton"})});var a=c.config?c.config:null;a&&a.button1&&broadcastDOMProc.setupExtraButton(1,a.button1.label,function(){eventLoggerService.logEvent(eventLoggerService.GIS_VIEWS.BROADCAST+eventLoggerService.GIS_VIEWS.EXTRABTN1+eventLoggerService.GIS_ACTIONS.CLICKED,{url:a.button1.url}),gaService.sendAnalyticsEvent(gaService.ANALYTICS_EVENTS.BROADCAST_EXTRABTN1_CLICK,{url:a.button1.url}),window.open(a.button1.url,a.button1.redirect===C.NAVIGATE?'_self':'_blank')}),a&&a.button2&&broadcastDOMProc.setupExtraButton(2,a.button2.label,function(){eventLoggerService.logEvent(eventLoggerService.GIS_VIEWS.BROADCAST+eventLoggerService.GIS_VIEWS.EXTRABTN2+eventLoggerService.GIS_ACTIONS.CLICKED,{url:a.button2.url}),gaService.sendAnalyticsEvent(gaService.ANALYTICS_EVENTS.BROADCAST_EXTRABTN2_CLICK,{url:a.button2.url}),window.open(a.button2.url,a.button2.redirect===C.NAVIGATE?'_self':'_blank')})}(),m(),i&&1==i.status&&h()}(),pageUnloadService.registerFunction(K),pollingService.registerPollingEvent(pollingService.BASE_EVENTS.BROADCAST_VIEW_DURATION_POLLING,{poll:b,pollArguments:[]},!0),pollingService.subscribe(pollingService.BASE_EVENTS.BROADCAST_VIEW_DURATION_POLLING,function(){},function(){}),eventService.subscribe(GIS_CONSTANTS.EVENT_NAMES.CHECK_FOR_CAROUSEL_UPDATE,x),0):-1},startDirectLinkBroadcast:function(){var e=utilitiesService.getUrlParamsLowerCase()[GIS_CONSTANTS.QUERY_PARAM.GIS_CHANNEL_PARAM],t=utilitiesService.getUrlParamsLowerCase()[GIS_CONSTANTS.QUERY_PARAM.GIS_EVENT_PARAM],n=e||t;if(utilitiesService.isEncodedUri(n)&&(n=decodeURIComponent(n)),null!=n||""!=n)if(e)gisService.getBroadcasts(utilitiesService.utf8ToBase64(n),"broadcastCallback");else if(t){var a=utilitiesService.getUrlParamsLowerCase().giskey;utilitiesService.isEncodedUri(a)&&(a=decodeURIComponent(a)),gisService.getBroadcastsEvent(utilitiesService.utf8ToBase64(n),a?utilitiesService.utf8ToBase64(a):null,"broadcastCallback")}},broadcastHasEnded:function(e){e||(hlsCtrl.destroy(),pollingService.stopPollingEvent(pollingService.BASE_EVENTS.BROADCAST_VIEW_DURATION_POLLING),deviceInfoService.isIos()&&broadcastDOMProc.clearIntervalOnVideoElement(),broadcastDOMProc.broadcastEnded(),'function'==typeof n&&n())},setupEmbedBroadcast:function(e,t){if(pollingService.stopPollingEvent(pollingService.BASE_EVENTS.BROADCAST_POLLING),I=!0,c&&G(),!e)return-1;i=c=e,t&&(n=t),stateService.setCallUUID(y()),callUserService.add(e.type),m(),h(),pageUnloadService.registerFunction(p)},getBroadcastView:function(){var e=broadcastDOMProc.getView();return uiUtilitiesService.removeClass(e,'gis-modal-wrap'),e},pauseVideo:function(){broadcastDOMProc.pauseVideo()},playVideo:function(){broadcastDOMProc.playVideo()},toggleMute:function(){broadcastDOMProc.toggleMute()},showNoBroadcastView:function(e){var t,n,a=utilitiesService.getUrlParams()[GIS_CONSTANTS.QUERY_PARAM.GIS_EVENT_PARAM];if(shopStreamService.isShopStreamEnabled()&&a&&e&&e.broadcastEventHoldTimeStamp&&(n=a,(t=e).status===GIS_CONSTANTS.BROADCAST_STATUS.BROADCAST_CREATED?(r&&r.getTime()!==new Date(t.broadcastEventHoldTimeStamp).getTime()&&(broadcastDOMProc.updateTimeOnHoldingScreen(new Date(t.broadcastEventHoldTimeStamp)),clearTimeout(A),V()),r=new Date(t.broadcastEventHoldTimeStamp),function e(t,n){if(i=new Date,(E=new Date(r)).setMinutes(r.getMinutes()-10),i.getTime()=E.getTime()&&o.getTime()<=S.getTime()){if(g&&B)return;f(0,n),R=!(B=!0)}else if(a=new Date,(T=new Date(r)).setMinutes(r.getMinutes()+25),a.getTime()>=S.getTime()&&a.getTime()<=T.getTime()){if(g&&R)return;g&&B&&V(),f(0,n,3e4),R=!(B=!1)}else(new Date).getTime()>T.getTime()&&g&&(V(),clearTimeout(A),R=B=!1);var a,o,i}(t,n)):t.status===GIS_CONSTANTS.BROADCAST_STATUS.BROADCAST_ENDED&&g&&V()),!D){stateService.setCurrentPhase(stateService.phase.NO_BROADCAST_AVAILABLE),D=!0,i=e;var o=serverInjectionService.getSystemConfig().oneToOneCta.broadcast&&i&&i.config&&i.config.oneToOneInBroadcast;i&&void 0!==i.status&&0===i.status?broadcastDOMProc.show(o,i):broadcastDOMProc.show(!1,i),i&&0===i.status&&o&&m()}}}};GISAPP.callCtrl=function(logService,serverInjectionService,stateService,mediaService,browserInfoService,activityLoggerService,systemInfoService,uiUtilitiesService,gisService,otService,callUserService,gaService,pageUnloadService,utilitiesService,callDOMProc,preCallScreen,surveyScreen,modalComponent,eventLoggerService,overrideService,callService,GIS_CONSTANTS,bookingService,callScreen,streamService,chatLogoutService,addToCartService,addAPersonService,clientStorageService){'use strict';var o,e,i,n,t={},d="callCtrl",E=!1,A=serverInjectionService.getSystemConfig().skipMicShare,a=serverInjectionService.getSystemConfig().isNewCallScreen||serverInjectionService.getSystemConfig().oneToOne.isShopStreamCall.enabled,s=0,l=0,C=!0,c=function(e,t,i){};t.addProductToBasket=c;var r,T,I,S,_,g,L,otSession,otPublisher,u=null,N=!1,D=browserInfoService.isChrome()?'https://support.google.com/chrome/answer/2693767?hl=en':'https://support.mozilla.org/en-US/questions/1168156',h=GIS_CONSTANTS.CALL_STATUS.NOT_CONNECTED,y=[],v=!1,O=!1,M=!1,V=!1,f=!1,m=!1,p=!1,R=0,P=0,Y=!0,b={},U=!1,w={mic:{isMute:A,onClick:Le},speaker:{isMute:E,onClick:ue},cameraToggle:{isMute:Y,onClick:Me,isEnabled:serverInjectionService.getSystemConfig().oneToOne.twoWayVideo.enabled},cameraSwitch:{isMute:!1,onClick:Ve},onLeaveButtonClick:H};function k(e,t){if(window.dispatchEvent(new GisCustomEvent("gisCallInitiated")),stateService.getCurrentPhase()===stateService.phase.READY||stateService.getCurrentPhase()===stateService.phase.EMBED_CALL_INITIATED){stateService.getCanceledOnConnectingScreen()&&stateService.setCallInitiatedWhileCanceling(!0),stateService.setCurrentPhase(stateService.phase.CALL_INITIATING),ie();var i=e&&"string"==typeof e?e:stateService.getRoutingKey();stateService.setActiveCallRoutingKey(i),T=utilitiesService.isDirectCall()||utilitiesService.isDepartmentCall()?GIS_CONSTANTS.CALL_TYPES.DIRECT:GIS_CONSTANTS.CALL_TYPES.STANDARD,gaService.sendAnalyticsEvent(gaService.ANALYTICS_EVENTS.CALL_MADE,{CallType:T}),systemInfoService.requiresSSLCall()?gisService.getSecurityToken("gisCallbacks.onSecurityTokenReceived"):(utilitiesService.isMeeting()?gisService.initiateMeetingCall("gisCallbacks.onCallInitiation",T,n):addAPersonService.isAddAPersonCall()?W(t.data):gisService.initiateCall("gisCallbacks.onCallInitiation",T),r&&clearTimeout(r),r=setTimeout(Ne,4e4))}else logService.warn(d,"Tried to initiate call procedure when phase is "+stateService.getCurrentPhase())}function G(){r&&clearTimeout(r),uiUtilitiesService.redirectToHttp(),stateService.setCallUUID(""),stateService.setActiveCallRoutingKey(""),h=GIS_CONSTANTS.CALL_STATUS.NOT_CONNECTED,ve(),"function"==typeof _&&_()}function W(t){logService.debug(d,"Call initiation received",stateService.getCallUUID());try{if(stateService.getCallUUID()||stateService.getCurrentPhase()!==stateService.phase.CALL_INITIATING)return void logService.warn(d,"Received call initiation but call has already been initiated or has been canceled");stateService.setCurrentPhase(stateService.phase.CALL_INITIATED),t.callUUID&&stateService.setCallUUID(t.callUUID),t.sessionId&&stateService.setSessionId(t.sessionId),t.token&&stateService.setToken(t.token),t.sessionId&&t.sessionId,t.apiKey&&(e=t.apiKey),t.surveyId&&(i=t.surveyId),t.apiKey&&stateService.setTokBoxApiKey(e),clearTimeout(r),r=null,callUserService.add("call"),ne()}catch(e){logService.error(d,"Exception on server callback, onCallInitiation.",e,{callId:t.callUUID})}}function B(e,t,i,n,o,a,s,l,C,c){C&&'string'==typeof C&&(C=JSON.parse(C));try{if(ye(t))return;callDOMProc.setupClerkProfile(n,o),gisService.getSurveyQuestions(a),logService.log(d,"Session Connected"),h=GIS_CONSTANTS.CALL_STATUS.CONNECTED,stateService.setCurrentPhase(stateService.phase.IN_CALL),gaService.sendAnalyticsEvent(gaService.ANALYTICS_EVENTS.CALL_ACCEPTED),utilitiesService.isDirectCall()?gaService.sendAnalyticsEvent(gaService.ANALYTICS_EVENTS.DIRECT_CALL):gaService.sendAnalyticsEvent(gaService.ANALYTICS_EVENTS.STANDARD_CALL),u=new Date,c||(g.hide(!0),callDOMProc.show({isMicSetupRequired:serverInjectionService.getSystemConfig().skipMicShare,isBookingCall:utilitiesService.isMeeting(),isArchivingEnabled:U})),callDOMProc.changeMicIcon(A),callDOMProc.changeSpeakerIcon(E),(utilitiesService.isMeeting()&&bookingService.isTwoWayVideoCallEnabled()||!utilitiesService.isMeeting()&&callService.isTwoWayVideoCall()&&b.video.isAllowed)&&(callDOMProc.setOnCameraSwitch(Ve),callDOMProc.setOnCamClick(Me),callDOMProc.changeCamIcon(Y)),callDOMProc.hideMicShareOverlay(),activityLoggerService.logActivity(activityLoggerService.GIS_ACTIVITY_TYPES.CALL_UI_LOADED);var r={routingKey:stateService.getRoutingKey()};C&&(r.routing=C),eventLoggerService.logEvent(eventLoggerService.GIS_VIEWS.CALL+eventLoggerService.GIS_ACTIONS.SHOWN,r),callDOMProc.displayControls(),serverInjectionService.getSystemConfig().skipMicShare&&setTimeout(function(){otPublisher.getPublisher()||se()},3e3),callDOMProc.setOnMicClick(Le),callDOMProc.setOnSpeakerClick(ue),callDOMProc.setOnEndCallClick(H),callDOMProc.setOnHelpUnblockClick(function(){window.open(D,'_blank')}),Te()}catch(e){logService.error(d,"Exception on server callback, postConnect.",e)}}function H(){m=!0,utilitiesService.isMeeting()&&activityLoggerService.logActivity(activityLoggerService.GIS_ACTIVITY_TYPES.BOOKING_CUSTOMER_LEFT),stateService.setCurrentPhase(stateService.phase.CALL_END),h===GIS_CONSTANTS.CALL_STATUS.CONNECTED&&(activityLoggerService.logActivity(activityLoggerService.GIS_ACTIVITY_TYPES.CALL_DISCONNECTED_BY_CONSUMER),gaService.sendAnalyticsEvent(gaService.ANALYTICS_EVENTS.CALL_ENDED,{CallEndReason:GIS_CONSTANTS.CALL_END_REASONS.CONSUMER})),h===GIS_CONSTANTS.CALL_STATUS.CONNECTING&&(activityLoggerService.logActivity(activityLoggerService.GIS_ACTIVITY_TYPES.CALL_CONNECTING_CANCELLED),gaService.sendAnalyticsEvent(gaService.ANALYTICS_EVENTS.CALL_CONNECTING_CANCELLED)),Oe(),callDOMProc.destroyEventListeners()}callDOMProc=a?new callScreen(w):callDOMProc,pageUnloadService.registerFunction(function(){switch(h){case GIS_CONSTANTS.CALL_STATUS.CONNECTING:setTimeout(function(){activityLoggerService.logActivity(activityLoggerService.GIS_ACTIVITY_TYPES.CALL_ABORT_BY_CONSUMER),gaService.sendAnalyticsEvent(gaService.ANALYTICS_EVENTS.CALL_ABORTED)},0);break;case GIS_CONSTANTS.CALL_STATUS.CONNECTED:setTimeout(function(){activityLoggerService.logActivity(activityLoggerService.GIS_ACTIVITY_ENDPOINTS.CALL_FINISHED_PAGE_UNLOAD),stateService.getChatInitialized()&&chatLogoutService.logout()},0)}}),window.addEventListener("orientationchange",function(){otPublisher&&otPublisher.getPublisher()&&setTimeout(function(){callDOMProc.changeVideoDimension(callDOMProc.getMainVideoStreamId())},2e3)},!1),overrideService.override(d,t),t.addProductToBasket!==c&&addToCartService.overrideATC(t.addProductToBasket);var K=function(e){h!==GIS_CONSTANTS.CALL_STATUS.CONNECTING||f||(f=!0,utilitiesService.isMeeting()||addAPersonService.isAddAPersonCall()?B(0,stateService.getCallUUID(),0,null,null,i,0,0,null,!0):utilitiesService.isDepartmentCall()?gisService.connectAutoLaunchCall(stateService.getAutoLaunchId(),stateService.getCallUUID(),stateService.getPageMetadata()):gisService.connectCall(stateService.getCallUUID(),stateService.getRoutingKey(),o,stateService.getPageMetadata()),window.dispatchEvent(new GisCustomEvent("gisCallConnecting")),g.getChild().setConnecting(N))},F=function(e){"CONSUMER"===JSON.parse(e.stream.connection.data).userType&&stateService.addStreamToConsumerMap(e.stream.connection.id),'camera'===e.stream.videoType&&l++,s++,e&&e.stream&&(e.stream.connection&&(otService.log('streamCreated - connectionId: '+e.stream.connection.connectionId),otService.log('streamCreated - connectionData: '+e.stream.connection.data)),function(e){if(e.connection.connectionId===otSession.getConnection().connectionId)return;var t=callDOMProc.addStream(e),otSubscriber=otSession.subscribe(e,t.id,{showControls:!1,width:"100%",height:"100%"});otSubscriber.setVideoDisableWarningHandler(function(){callDOMProc.showPoorConnectionMessage()}),otSubscriber.setVideoDisableWarningLiftedHandler(function(){callDOMProc.hidePoorConnectionMessage()}),otSubscriber.setVideoDisabledHandler(function(e){'quality'===e.reason&&callDOMProc.showVideoDisabledMessage()}),otSubscriber.setVideoEnabledHandler(function(){callDOMProc.hideVideoDisabledMessage()}),E?otSubscriber.setAudioVolume(0):otSubscriber.setAudioVolume(100);callDOMProc.changeVideoDimension(e.streamId)}(e.stream)),O||(activityLoggerService.logActivity(activityLoggerService.GIS_ACTIVITY_TYPES.CALL_CLERK_STREAM_RECEIVED),eventLoggerService.logEvent(eventLoggerService.GIS_EVENTS.CALL_CLERK_STREAM_RECEIVED),O=!0,v&&(activityLoggerService.logActivity(activityLoggerService.GIS_ACTIVITY_ENDPOINTS.CALL_STARTED),De())),callDOMProc.hideCallStatusDialog(),(utilitiesService.isMeeting()&&bookingService.isTwoWayVideoCallEnabled()||!utilitiesService.isMeeting()&&callService.isTwoWayVideoCall())&&callDOMProc.setupTapToFocus(),callDOMProc.hideCallController(),callDOMProc.setCallControllerAnimation(),callDOMProc.updateConnectionCount(l),he(e.stream)},J=function(e){"CONSUMER"===JSON.parse(e.stream.connection.data).userType&&stateService.removeStreamFromConsumerMap(e.stream.connection.id),1<=s&&(callDOMProc.removeVideoWhenClerkLeave(e.stream.id),callDOMProc.changeVideoDimension(callDOMProc.getMainVideoStreamId())),'camera'===e.stream.videoType&&l--,s--,callDOMProc.updateConnectionCount(l)},x=function(e){"hasVideo"===e.changedProperty&&(1Waiting for the host to start call.";var l=document.createElement('div');l.innerHTML="
Please Wait...",l.id='loading-gis-v3-button',l.className='loading-gis-v3-button',l.style.display='flex';var i=document.getElementById('gis-v3-button');i.classList.add('gis-hideAll'),i.classList.add('gis-v3-dc-btn'),e.parentNode.insertBefore(l,e.nextSibling),e.parentNode.insertBefore(t,e.nextSibling)}}function C(){null!==document.getElementById("loading-gis-v3-button")&&document.getElementById('loading-gis-v3-button').remove();null!==document.getElementById("loading-gis-v3-wait-text")&&document.getElementById('loading-gis-v3-wait-text').remove();if(null==document.getElementById("gis-v3-button'")){var e=document.getElementById('gis-v3-button');e.classList.add('gis-v3-dc-btn'),e.classList.remove('gis-hideAll')}}return{init:function(e){var t;e===GIS_CONSTANTS.DIRECT_CALL_TYPE.CLERK_CALL?u():e===GIS_CONSTANTS.DIRECT_CALL_TYPE.DEPARTMENT_CALL&&(t=utilitiesService.getUrlParams().giscallcategory,stateService.setAutoLaunchId(t),pollingService.registerPollingEvent(pollingService.BASE_EVENTS.AUTO_LAUNCH_CALL_POLLING,{poll:gisService.checkAutoLaunchClerkIsAvailable,pollArguments:[t]}),pollingService.subscribe(pollingService.BASE_EVENTS.AUTO_LAUNCH_CALL_POLLING,c,s),pollingService.startPollingEvent(pollingService.BASE_EVENTS.AUTO_LAUNCH_CALL_POLLING))},clerkIsNotAvailable:function(e){try{var t="";if(e&&(t=e.code),t==a)return clearTimeout(l),void callCtrl.startCallJourney({routingKey:null,type:GIS_CONSTANTS.CALL_TYPES.DIRECT,isInvalidUrl:!0});if(t==r)return eventLoggerService.logEvent(eventLoggerService.GIS_EVENTS.CALL_USER_BLOCKED,{referrer:document.referrer||""}),void clearTimeout(l);'true'===serverInjectionService.isAutoStartDirectCallEnabled()?(o||d(GIS_CONSTANTS.DIRECT_CALL_TYPE.CLERK_CALL),L()):(o||d(GIS_CONSTANTS.DIRECT_CALL_TYPE.CLERK_CALL),L(),l=setTimeout(u,3e3))}catch(e){n.error(i,"Exception while processing directCall clerkIsNotAvailable Response.",e)}},clerkIsAvailable:function(){o||d(GIS_CONSTANTS.DIRECT_CALL_TYPE.CLERK_CALL);try{'true'!==serverInjectionService.isAutoStartDirectCallEnabled()||utilitiesService.isHttpsPageRedirected()?(C(),l=setTimeout(u,3e3)):callCtrl.initiateCallProcedure()}catch(e){n.error(i,"Exception on directCall server callback, clerkIsAvailable.",e)}},autoLaunchClerkIsAvailable:gisCallbacks.autoLaunchClerkIsAvailable=c,autoLaunchClerkIsNotAvailable:gisCallbacks.autoLaunchClerkIsNotAvailable=s}};GISAPP.embedCtrl=function(broadcastCtrl,chatInputDOMProc,stateService,overrideService,uiUtilitiesService,globalObjectService,pollingService){var a,s,n,e={},i=!1;e.LOGTAG='embedCtrl';var t="";function d(){globalObjectService.getWindow().dispatchEvent(new GisCustomEvent('GisBroadcastEnded',{detail:{broadcastView:s,chatView:n}}))}return e.init=function(){pollingService.subscribe(pollingService.BASE_EVENTS.BROADCAST_POLLING,function(){},function(){}),pollingService.startPollingEvent(pollingService.BASE_EVENTS.BROADCAST_POLLING),s=broadcastCtrl.getBroadcastView(),n=chatInputDOMProc.render(),uiUtilitiesService.addClass(s.querySelector('#gis-broadcast-video'),'gis-embed'),uiUtilitiesService.addClass(s.querySelector('.gis-modal-content.broadcast-video'),'gis-embed'),uiUtilitiesService.addClass(s,'gis-embed'),uiUtilitiesService.addClass(n,'gis-embed'),globalObjectService.getWindow().addEventListener("gisUIClosed",function(e){stateService.setUIActive(!1),stateService.getCurrentPhase()!==stateService.phase.IN_CALL&&stateService.getCurrentPhase()!==stateService.phase.CALL_END&&(stateService.setCallUUID(a.callUUID),stateService.setCurrentPhase(t)),broadcastCtrl.playVideo()}),globalObjectService.getWindow().addEventListener("gisUIOpen",function(e){stateService.setUIActive(!0),broadcastCtrl.pauseVideo(),stateService.getCurrentPhase()!==stateService.phase.IN_CALL&&stateService.getCurrentPhase()!==stateService.phase.CALL_END&&(stateService.setCallUUID(null),t=stateService.getCurrentPhase(),stateService.setCurrentPhase(stateService.phase.EMBED_CALL_INITIATED))})},e._isEmbed=function(){return!1},overrideService.override(e.LOGTAG,e),{init:e.init,isEmbed:e._isEmbed,startBroadcast:function(e){var t=e.broadcasts;0!==t.length&&(a=function(e){for(var t=0;t ',onclick:function(){deviceInfoService.isMobileDevice()&&!deviceInfoService.isIPad()?D('carousel','carousel'):T.showLeftBottomContainer(),l.updateControlType("normal"),eventLoggerService.logEvent(eventLoggerService.GIS_EVENTS.PRODUCT_CAROUSEL_OPENED)},stateTransition:"off",style:"background: rgba(255, 255, 255, 0.63); border-radius: 25px; width: 40px; height: 40px; padding: 10px;"},off:{image:' ',onclick:function(){deviceInfoService.isMobileDevice()&&!deviceInfoService.isIPad()||T.hideLeftBottomContainer(),l.updateControlType("compact"),eventLoggerService.logEvent(eventLoggerService.GIS_EVENTS.PRODUCT_CAROUSEL_HIDDEN)},stateTransition:"on"}},order:20,defaultState:"off"}}),(C=u.render()).setAttribute('id','gis-shop-stream-carousel-control'),l.addSideControls(C));var e;(utilitiesService.isMeeting()&&(bookingService.isMultiParticipantEnabled()||bookingService.isAddAPersonEnabled())||!utilitiesService.isMeeting()&&callService.isAddAPersonEnabled())&&((e=new controlButtonComponent({config:{states:{on:{image:'',onclick:function(){var e=new productPopupComponent({type:GIS_CONSTANTS.PRODUCT_POPUP_TYPES.CTA,payload:{type:GIS_CONSTANTS.PRODUCT_POPUP_TYPES.CTA_TYPES.ADD_A_PERSON},popUpContainer:c.querySelector('#gis-ss-player-popup'),isMultiParty:utilitiesService.isMeeting()&&bookingService.isMultiParticipantEnabled(),isOneToOneCall:!utilitiesService.isMeeting()});e.render(),eventLoggerService.logEvent(eventLoggerService.GIS_EVENTS.ADD_A_PERSON_BUTTON_CLICKED,{isMultiParty:bookingService.isMultiParticipantEnabled(),isAddAPerson:bookingService.isAddAPersonEnabled(),isOneToOneCall:!utilitiesService.isMeeting()})},stateTransition:"on",style:""}},order:20,defaultState:"on"}}).render()).setAttribute('id','gis-shop-stream-add-a-person-control'),l.addSideControls(e))}(),callService.isShopStreamCallProductCarouselEnabled()&&(uiUtilitiesService.removeClass(M.querySelector('#gis-ss-carousel-content'),'gis-ss-hide'),p=carouselService.getCarouselComponentView({scrollEvent:eventLoggerService.GIS_EVENTS.PRODUCT_CAROUSEL_SCROLLED}),carouselService.updateOrientation("horizontal","horizontal"),uiUtilitiesService.addClass(p.querySelector('#gis-slider-content-container'),"gis-slider-x-scroll"),carouselService.addTileToCarousel({customTile:!0,image:'',title:serverInjectionService.getLabels().product_tile_recommended_label}),T.setupLeftBottomContainer(p),carouselService.addTileToCarouselCallback(function(e,t){if(carouselService.getSliderInstance().slideToEnd(),c.querySelector("#gis-ss-left-bottom-pane").classList.contains('gis-ss-hide')){if(deviceInfoService.isMobileDevice()&&t.isRecommendedByClerk)return;C.click()}}),callService.isInCallChatEnabled()?function(){if(!deviceInfoService.isMobileDevice()||deviceInfoService.isIPad()||!callService.isShopStreamCallEnabled()||!callService.isShopStreamCallProductCarouselEnabled()||!callService.isInCallChatEnabled())return;m=!0;var e=M.querySelector('#gis-ss-right-pane');uiUtilitiesService.addClass(e,'gis-toggle-enabled');var t=uiUtilitiesService.processView(serverInjectionService.getViews().shopStreamChatCarouselToggle);b(t);var i=t.querySelector('#gis-ss-chat-tab');i.querySelector('#gis-ss-tab-text-chat').innerHTML=serverInjectionService.getLabels().oto_chat_toggle_label;var s=t.querySelector('#gis-ss-carousel-tab'),n=s.querySelector('#gis-ss-tab-text-carousel');n.innerHTML=serverInjectionService.getLabels().oto_carousel_toggle_label+' ',n.innerHTML=n.innerHTML+'('+(carouselService.getTiles().length-1)+')',carouselService.addTileToCarouselCallback(function(){n.querySelector('#gis-ss-carousel-count').innerHTML='('+(carouselService.getTiles().length-1)+')'}),e.insertBefore(t,e.firstChild),s.onclick=L,i.onclick=v}():function(){if(!deviceInfoService.isMobileDevice()||deviceInfoService.isIPad()||!callService.isShopStreamCallProductCarouselEnabled())return;var e=M.querySelector('#gis-ss-right-pane'),t=uiUtilitiesService.processView(serverInjectionService.getViews().shopStreamChatCarouselToggle);b(t),uiUtilitiesService.addClass(t.querySelector('#gis-ss-wrapper-tab'),'gis-ss-hide'),e.insertBefore(t,e.firstChild)}())),uiUtilitiesService.showModal(M),e.isArchivingEnabled?s.showRecordingTooltip():s.hideRecordingTooltip(),s.setUserProfileInfo({userDisplayName:o,userImageName:a}),E()}function E(){stateService.getInputAlignment()===GIS_CONSTANTS.INPUT_ALIGNMENT.RTL&&uiUtilitiesService.addClass(M.querySelector('#gis-cs-user-form-input'),'gis-rtl')}function b(e){e.querySelector('#gis-ss-chat-close-btn').onclick=function(){m?'off'===u.getCurrentState().stateTransition?D(!1,'carousel'):(u.updateState(null,"off"),D(!1,'chat')):D(!1,!1)}}function w(){uiUtilitiesService.removeClassOnList(M.querySelectorAll('.gis-ss-rightpane-tab'),'gis-ss-active-tab'),uiUtilitiesService.removeClass(M.querySelector('#gis-ss-right-pane'),'gis-ss-chat-active'),uiUtilitiesService.removeClass(M.querySelector('#gis-ss-right-pane'),'gis-ss-carousel-active'),''}function v(){w(),uiUtilitiesService.addClass(M.querySelector('.gis-ss-chat-tab'),'gis-ss-active-tab'),uiUtilitiesService.addClass(M.querySelector('#gis-ss-right-pane'),'gis-ss-chat-active'),'chat',d&&d()}function L(){w(),uiUtilitiesService.addClass(M.querySelector('.gis-ss-carousel-tab'),'gis-ss-active-tab'),uiUtilitiesService.addClass(M.querySelector('#gis-ss-right-pane'),'gis-ss-carousel-active'),'carousel'}function A(e){e.match(/landscape/)?uiUtilitiesService.addClass(c.querySelector("#gis-ss-left-bottom-pane"),'gis-ss-hide'):uiUtilitiesService.removeClass(c.querySelector("#gis-ss-left-bottom-pane"),'gis-ss-hide'),carouselService.refresh()}function O(){}function N(e){return'none'===globalObjectService.getWindow().getComputedStyle(e).display}var V=utilitiesService.callOncePerSession(function(){callService.isInCallChatEnabled()&&(callService.isShopStreamCallEnabled()?(uiUtilitiesService.removeClass(M.querySelector('#gis-ss-chat-content'),"gis-ss-hide"),P=new controlButtonComponent({config:{states:{on:{image:' ',onclick:function(){D('chat','chat')},stateTransition:"off",style:"background: rgba(255, 255, 255, 0.63); border-radius: 25px; width: 40px; height: 40px; padding: 10px;"},off:{image:' ',onclick:function(){D(!1,'chat')},stateTransition:"on"}},order:10,defaultState:"off"}}),(e=P.render()).setAttribute('id',"gis-shop-stream-chat-control"),l.addSideControls(e),H()):function(){var e=M.querySelector('#gis-cs-container');e.style.display='flex',e.style['flex-direction']='row';var t=uiUtilitiesService.createElementWithAttributes('img','','init-chat-icon');t.src=uiUtilitiesService.getImageUrl('init_chat_icon.png',!0);var i=uiUtilitiesService.createElementWithAttributes('div',_,_);i.append(t),callService.getElementReference(M,'#gis-cs-right-pane').style.display='none';var s=uiUtilitiesService.createElementWithAttributes('span',I,I,'display: none');i.append(s),M.querySelector('#gis-cs-left-pane').append(i),H()}(),E())},stateService.getCallUUID);var q=utilitiesService.once(function(){deviceInfoService.isMobileDevice()&&!deviceInfoService.isIPad()&&(T.showLeftBottomContainer(),function(e,t){var i=globalObjectService.getWindow().matchMedia(e);try{i.addEventListener('change',t)}catch(e){try{i.addListener(t)}catch(e){console.error(e)}}return i}("(orientation: portrait)",function(e){e.matches?A('portrait'):A('landscape')}).matches?A('portrait'):A('landscape'))});function D(e,t){e?(uiUtilitiesService.removeClass(c.querySelector(".gis-shop-stream-right-chat-compact"),"gis-rightpane-disabled"),T.showRightContainer(),callService.isShopStreamCallProductCarouselEnabled()&&deviceInfoService.isMobileDevice()&&!deviceInfoService.isIPad()&&(M.querySelector('.gis-ss-carousel-content').appendChild(p),carouselService.updateOrientation('mobile','horizontal mobile'),uiUtilitiesService.removeClass(p.querySelector('#gis-slider-content-container'),"gis-slider-x-scroll"),carouselService.refresh()),'string'==typeof e&&m&&('carousel'===e?M.querySelector('#gis-ss-carousel-tab').click():M.querySelector('#gis-ss-chat-tab').click()),t&&'carousel'===t?u.updateState(null,"on",!0):(d(),P.updateState(null,"on",!0))):('',uiUtilitiesService.addClass(c.querySelector(".gis-shop-stream-right-chat-compact"),"gis-rightpane-disabled"),T.hideRightContainer(),callService.isShopStreamCallProductCarouselEnabled()&&deviceInfoService.isMobileDevice()&&!deviceInfoService.isIPad()&&(T.setupLeftBottomContainer(p),carouselService.updateOrientation('horizontal','horizontal'),uiUtilitiesService.addClass(p.querySelector('#gis-slider-content-container'),"gis-slider-x-scroll"),carouselService.refresh()),t&&'carousel'===t?u.updateState(null,"off",!0):t&&'chat'===t?P.updateState(null,"off",!0):(u&&u.updateState(null,"off",!0),P&&P.updateState(null,"off",!0)))}function R(e){var t=document.querySelector(callService.getElementReference(null,'#gis-cs-right-pane',!0));stateService.getChatInitialized()||(callService.isShopStreamCallEnabled()&&(t=t.querySelector('#gis-ss-chat-content')),chatLoadService.loadChatInIframe(t,Z,e),stateService.setChatInitialized(!0)),uiUtilitiesService.show(callService.getElementReference(null,'#gis-cs-right-pane',!0).replace("#",""))}function U(e,t,i,s,n,a){var o=M.querySelector('.'+_);GIS_CONSTANTS.CHAT.CURRENT_NUM_OF_USERS<=GIS_CONSTANTS.CHAT.MAX_NUM_OF_USERS?(d=function(e,t,i,s,n,a){eventLoggerService.logEvent(eventLoggerService.GIS_EVENTS.ONE_TO_ONE_CHAT_BUTTON_CLICKED),GISAPP.chatUserNameService.isNameConfigured()?R(!1):GISAPP.chatUserNameService.openEnterUserForm(e,t,i,s,n,null,a,Z),eventLoggerService.logEvent(eventLoggerService.GIS_EVENTS.CHAT_SHOWN_ON_ONE_TO_ONE)}.bind(null,e,t,i,s,n,a),o&&(o.onclick=d)):o.addEventListener('click',x)}function H(e){var o=callService.getElementReference(M,'#gis-cs-right-pane');M.querySelector('#gis-user-title')||(o.querySelector('.gis-ss-chat-content')?o.querySelector('.gis-ss-chat-content'):o).appendChild((new chatUserFormComponent).render());var t,i,s,n,a,l=o.getAttribute('id'),r=M.querySelector('#gis-user-title'),c=M.querySelector('#gis-user-secondary-title'),d=M.querySelector('#gis-cs-user-error-msg'),C=M.querySelector('#gis-cs-user-form-input'),u=M.querySelector('#gis-cs-submit-user-form-btn'),g=M.querySelector('.'+_),h=M.querySelector('#gis-cs-user-form-container').getAttribute('id'),p=u.getAttribute('id'),S=C.getAttribute('id'),f=d.getAttribute('id'),m=g?g.getAttribute('id'):null,y=serverInjectionService.getLabels().chat_userName_title,E=serverInjectionService.getLabels().chat_userName_instructions,b=serverInjectionService.getLabels().chat_userName_firstInput,w=serverInjectionService.getLabels().chat_joinChat_button,v=serverInjectionService.getLabels().chat_userName_secondary_title;r.innerHTML=y,c.innerHTML=v,d.innerHTML=E,C.innerHTML=b,u.innerHTML=w,callService.isShopStreamCallEnabled()||globalObjectService.getWindow().addEventListener('messageReceived',function(e){var t,i,s,n,a;e.detail[0].sender.uid!==stateService.getCallUserUUID()&&(t=e,i=I,s=o,n=M.querySelector('#'+I),a=0,N(s)&&N(n)&&uiUtilitiesService.show(i,'flex'),t.detail.forEach(function(e){'text'===e.type&&a++}),n.innerHTML=a)}),e?(t=l,i=h,s=p,n=S,a=f,callService.isShopStreamCallEnabled()&&(T.showRightContainer(),P.updateState(P.states,"on",!0)),GISAPP.chatUserNameService.isNameConfigured()?R(!0):GISAPP.chatUserNameService.openEnterUserForm(t,i,s,n,null,"signal:CHAT_INITIATED",a,Z)):U(l,h,p,S,m,f)}function x(){logService.debug(f,'Amount of users reached its limitations')}function Z(){stateService.getChatInitialized()&&(callService.isShopStreamCallEnabled()?e?e.onclick():document.getElementById("gis-shop-stream-chat-control").onclick():uiUtilitiesService.hide(callService.getElementReference(null,'#gis-cs-right-pane',!0).replace("#",""))),callService.isShopStreamCallEnabled()||(uiUtilitiesService.show(_,'flex'),uiUtilitiesService.hide(I),stateService.setUpdateMessageId(!0))}function k(e,t){a=e,o=t}function B(){callService.isShopStreamCallEnabled()?T.showFullScreen():(M.querySelector('#gis-cs-left-pane').style.width='100%',M.querySelector('#gis-cs-left-pane').style.height='100%',M.querySelector('#gis-cs-container').classList.add('fullScreen-pane')),globalObjectService.getWindow().dispatchEvent(new GisCustomEvent(GIS_CONSTANTS.CALLSCREEN_MODE.GIS_CHAT_FULL_SCREEN))}function G(){callService.isShopStreamCallEnabled()?T.hideFullScreen():(M.querySelector('#gis-cs-left-pane').style.removeProperty('width'),M.querySelector('#gis-cs-left-pane').style.removeProperty('height'),M.querySelector('#gis-cs-container').classList.contains('fullScreen-pane')&&M.querySelector('#gis-cs-container').classList.remove('fullScreen-pane')),globalObjectService.getWindow().dispatchEvent(new GisCustomEvent(GIS_CONSTANTS.CALLSCREEN_MODE.GIS_CHAT_NORMAL_SCREEN))}function F(){g.updateState(null,"off",!0)}return{render:y,show:function(e){y(e)},hide:function(){s.destroy(),uiUtilitiesService.removeNode(M),uiUtilitiesService.hideModal()},enableChat:R,setOnMicClick:O,setOnSpeakerClick:O,setOnEndCallClick:O,setOnHelpUnblockClick:O,changeMicIcon:O,changeSpeakerIcon:O,setupClerkProfile:k,updateMessage:O,hideMicShareOverlay:O,displayControls:O,disableChat:Z,enableControlSlide:O,updateOverlayTo:O,overlayStages:O,showNoVideoImage:function(e){s.showNoVideoImage(e)},hideNoVideoImage:function(e){s.hideNoVideoImage(e)},showReconnectingMessage:function(){s.showReconnectingMessage()},showDisconnectedMessage:function(e){s.showDisconnectedMessage(e)},updateCallScreenOverlayStatus:function(){s.updateCallScreenOverlayStatus()},hideCallStatusDialog:function(){s.hideCallStatusDialog()},setPublishedVideo:function(e){return s.addVideo(e)},disableCamMuteMuteBtn:O,setOnCamClick:function(){s.setCameraToggle()},setOnCameraSwitch:function(){s.setOnCameraSwitch()},changeCamIcon:O,setupTapToFocus:O,hideCallController:O,setCallControllerAnimation:O,destroyEventListeners:O,showRecordingTooltip:function(){s&&s.showRecordingTooltip()},hideRecordingTooltip:function(){s&&s.hideRecordingTooltip()},updateConnectionCount:function(e){s.updateConnectionCount(e)},hideVideoOfClerk:O,showVideoOfClerk:O,addStream:function(e){V(),globalObjectService.getWindow().dispatchEvent(new GisCustomEvent(GIS_CONSTANTS.CALLSCREEN_MODE.NORMAL_SCREEN));var t=JSON.parse(e.connection.data);return t.isIVREnabled&&function(e){if(S=M.querySelector('#gis-dial-pad-main-container'),uiUtilitiesService.hasChildNodes(S))n.showDialPad();else if(n=new dialPadComponent({resetDialPadZIndex:function(){S.style.zIndex='1'},sessionId:stateService.getSessionId(),connectionId:e,onCloseCallback:callService.isShopStreamCallEnabled()?F:O}),S.style.display='block',S.style.zIndex='11',S.appendChild(n.render()),callService.isShopStreamCallEnabled())g=new controlButtonComponent({config:{states:{on:{image:' ',onclick:function(){n.showDialPad(),S.style.display='block',S.style.zIndex='11',uiUtilitiesService.addClass(i,'gis-ivrActive')},stateTransition:"off",style:"background: rgba(255, 255, 255, 0.63); border-radius: 25px; width: 40px; height: 40px; padding: 10px;"},off:{image:' ',onclick:function(){n.hideDialPad(),S.style.display='none',S.style.zIndex='1',uiUtilitiesService.removeClass(i,'gis-ivrActive')},stateTransition:"on"}},order:20,defaultState:"on"}}),(h=g.render()).setAttribute('id','gis-shop-stream-ivr-control'),l.addSideControls(h);else{var t=M.querySelector('#gis-dial-pad-icon');t.style.display='flex',t.onclick=function(){n.showDialPad(),S.style.zIndex='11',uiUtilitiesService.addClass(i,'gis-ivrActive')}}}(e.connection.connectionId),"CLERK"===t.userType&&t.publisher?(k(t.publisher.imgName,t.publisher.displayName),s.setUserProfileInfo({userDisplayName:o,userImageName:a})):"CONSUMER"===t.userType&&(k(null,s.getDisplayNameFromStream(e)),s.setUserProfileInfo({userDisplayName:s.getDisplayNameFromStream(e),userImageName:null})),s.addStream(e)},getMainVideoStreamId:function(){return s.getMainVideoStreamId()},removeVideoWhenClerkLeave:function(e){s.removeVideoWhenClerkLeave(e)},changeVideoDimension:function(e){s.changeVideoDimension(e)},setSubscriberVideoState:O,showSignalMessage:function(e,t,i){var s=JSON.parse(e.data),n=JSON.parse(e.from.data).publisher,a={data:s,onAccept:t,onReject:i,exit:function(){r.style.display='none',r.innerHTML=''},clerkImageURL:uiUtilitiesService.getClerkImageUrl(n.imgName||'clerk-default'),clerkName:n.displayName};if(callService.isShopStreamCallEnabled()&&callService.isShopStreamCallProductCarouselEnabled())a.type=GIS_CONSTANTS.PRODUCT_POPUP_TYPES.CTA_TYPES.SHARED,a.data.id=a.data.productCode,a.data.onAccept=a.onAccept,new productPopupComponent({type:GIS_CONSTANTS.PRODUCT_POPUP_TYPES.CTA,payload:a,popUpContainer:c.querySelector('#gis-ss-player-popup')}).render(),q();else{var o=new addToBasketRequestComponent(a);if(r.innerHTML='',r.appendChild(o.render()),callService.isShopStreamCallEnabled()&&!callService.isShopStreamCallProductCarouselEnabled()){var l=r.children[0];uiUtilitiesService.addClass(l,"gis-ss-carousel-prompt"),l.style.background="white",l.style.height="auto",l.style.padding="15px 0",l.style.top="0",l.style.display="flex",l.style.flexDirection="column",l.style.bottom="auto",uiUtilitiesService.removeClass(r,"gis-ss-hide")}else r.style.animation='1s gis-call-signal-container-show forwards';r.style.display='block'}},showAssistantIsJoining:function(){s.showAssistantIsJoining()},showConnectingToLobby:function(){s.showConnectingToLobby()},showWaitingForAssistant:function(){s.showWaitingForAssistant()},setCallStatus:function(e){s.setCallStatus(e)},showPoorConnectionMessage:function(){s.showPoorConnectionMessage()},showVideoDisabledMessage:function(){s.showVideoDisabledMessage()},hideVideoDisabledMessage:function(){s.hideVideoDisabledMessage()},hidePoorConnectionMessage:function(){s.hidePoorConnectionMessage()},checkChatInitiationType:H,addRecommendedProduct:function(e){if(callService.isShopStreamCallEnabled()&&callService.isShopStreamCallProductCarouselEnabled()&&(carouselService.addTileToCarousel(e),deviceInfoService.isMobileDevice())){var t=carouselService.getTileFromCarousel(e.productCode).render();t&&(new productPopupComponent({type:GIS_CONSTANTS.PRODUCT_POPUP_TYPES.INFO,payload:{type:GIS_CONSTANTS.PRODUCT_POPUP_TYPES.INFO_TYPES.CAROUSEL_PROMPT},popUpContainer:c.querySelector('#gis-ss-player-popup'),productTile:t}).render(),q())}}}}};GISAPP.connectingScreen=function(systemInfoService,logService,gisService,uiUtilitiesService,serverInjectionService,deviceInfoService,validationUtilitiesService,eventLoggerService,emailSubmitComponent,buttonComponent,stateService,overrideService,modalVideoComponent,modalContentComponent,bookingService){return function(t){'use strict';var o={};function e(n,e,t){o.components.contentContainer.subviews.connectingFooter.style.display='none',uiUtilitiesService.appendView(o.components.contentContainer.subviews.contentContainer,t),o.components.contentContainer.subviews.mainText.innerHTML=n,o.components.contentContainer.subviews.secondaryText.innerHTML=e}return o.components={},o.LOGTAG="connectingScreen",o.props=t,o.serverInjectionService=serverInjectionService,o.labels=o.serverInjectionService.getLabels(),o.awaitingPhase=!1,o.isNoClerkAvailableShown=!1,o.isSubmissionInProgress=!1,o.connectingVideo="/connecting.mp4",o.EVENT_LOGTAG=eventLoggerService.GIS_VIEWS.CONNECTING,o.render=function(){return o.isNoClerkAvailableShown=!1,o.view=uiUtilitiesService.processView(" ",{},!0),o.videoContainer=new modalVideoComponent({video:o.connectingVideo}),o.components.videoContainer=o.videoContainer.render(),uiUtilitiesService.appendView(o.view,o.components.videoContainer),o.components.contentContainer=new modalContentComponent({enterAnimation:"fullscreen",mainText:{text:o.labels.connecting_v2_mainText1},connectingScreenDisclaimerText:o.labels.connectingScreen_v2_disclaimer}),uiUtilitiesService.appendView(o.view,o.components.contentContainer.render()),uiUtilitiesService.addClass(o.components.contentContainer.subviews.connectingFooter,'gis-connectingv3-footer'),uiUtilitiesService.removeClass(o.components.contentContainer.subviews.connectingFooter,'gis-hide'),t.hideFooter&&t.hideFooter(),t.extendOnClose(o._hide),o.components.contentContainer.subviews.mainText.style.fontWeight="400",o.components.contentContainer.subviews.mainText.style.fontSize="16px",o.components.contentContainer.subviews.mainText.style.fontStyle="normal",o.components.contentContainer.subviews.mainText.style.lineHeight="19px",o.components.contentContainer.subviews.mainText.style.letterSpacing="0px",o.components.contentContainer.subviews.mainText.style.textAlign="center",deviceInfoService.isMobileDevice()&&(o.components.videoContainer.style.width="100vw",o.components.contentContainer.subviews.content.style.bottom="0"),setTimeout(function(){o.components.videoContainer.style.display="block"},2e3),setTimeout(function(){o.components.contentContainer.subviews.mainText.style.animation="1s gis-fade-out forwards",setTimeout(function(){t.extraProps&&t.extraProps.noClerkAvailable?o._setNoClerkAvailableUI():(o.awaitingPhase=!0,o._setConnectingUI(),o.components.contentContainer.setup({mainText:{text:o.labels.connecting_v2_mainText2},topImage:"connecting.svg",connectingScreenDisclaimerText:o.labels.connectingScreen_v2_disclaimer}),o.components.contentContainer.subviews.mainText.style.animation="1s gis-fade-in forwards",uiUtilitiesService.addClass(o.components.contentContainer.subviews.topImage,"gis-rotate"))},1500)},6e3),o.view},o.setNoClerkAvailable=function(){o.isNoClerkAvailableShown=!0,o.awaitingPhase?(clearTimeout(o.animationTimeout),o.components.contentContainer.subviews.mainText.style.animation="1s gis-fade-out forwards",o.animationTimeout=setTimeout(function(){o._setNoClerkAvailableUI()},1500)):(t.extraProps||(t.extraProps={}),t.extraProps.noClerkAvailable=!0);var n=o.serverInjectionService.getSystemConfig();n&&n.noOneAvailableBlock&&n.noOneAvailableBlock.enable&&(GISAPP.noClerkAvailableScreenShown=!0)},o._setConnectingUI=function(){o.animationTimeout=setTimeout(function(){o.components.contentContainer.subviews.mainText.style.animation="1s gis-fade-out forwards",o.animationTimeout=setTimeout(function(){o.components.contentContainer.subviews.mainText.innerHTML=o.labels.connecting_v2_mainText3,o.components.contentContainer.subviews.mainText.style.animation="1s gis-fade-in forwards",eventLoggerService.logEvent(eventLoggerService.GIS_EVENTS.RESPECT_MESSAGE_DISPLAYED_ON_CONNECTING_SCREEN),o.animationTimeout=setTimeout(function(){o.components.contentContainer.subviews.mainText.style.animation="1s gis-fade-out forwards",o.animationTimeout=setTimeout(function(){o.components.contentContainer.subviews.mainText.innerHTML=o.labels.connecting_v2_mainText4,o.components.contentContainer.subviews.mainText.style.animation="1s gis-fade-in forwards"},1500)},7e3)},1500)},7e3)},o._setNoClerkAvailableUI=function(){o.EVENT_LOGTAG=eventLoggerService.GIS_VIEWS.NO_CLERK_AVAILABLE;var n=o.serverInjectionService.getSystemConfig();bookingService.isBookingEnabled()?(o.button=new buttonComponent({buttonLabel:serverInjectionService.getLabels().schedule_booking_button_label,onClick:function(){t.extraProps.setBookingWidget()},eventName:o.EVENT_LOGTAG+eventLoggerService.GIS_VIEWS.BOOKING_SCHEDULE_BUTTON,buttonClass:"gis-secondary-button"}),e(o.labels.connecting_v2_noClerk_booking_mainText,o.labels.connecting_v2_noClerk_booking_secondaryText,o.button.render())):n&&n.captureInfo&&n.captureInfo.views&&!0===n.captureInfo.views.clerkUnavailable?(o.emailTextBox=new emailSubmitComponent({textBoxPlaceHolder:o.labels.noClerkAvailableScreen_emailFieldLabel,textBoxLabel:o.labels.noClerkAvailableScreen_emailErrorLabel,buttonClick:o._submitContact}),e(o.labels.connecting_v2_noClerkCaptureInfo_mainText,o.labels.connecting_v2_noClerkCaptureInfo_secondaryText,o.emailTextBox.render())):(o.button=new buttonComponent({buttonLabel:o.labels.connecting_v2_noClerk_buttonLabel,onClick:t.closeButton.onclick}),e(o.labels.connecting_v2_noClerk_mainText,o.labels.connecting_v2_noClerk_secondaryText,o.button.render())),o.components.contentContainer.subviews.secondaryText.style.visibility="hidden",o.components.contentContainer.subviews.secondaryText.style.display="block",o.components.contentContainer.subviews.topImage.style.display="none",o.components.contentContainer.subviews.mainText.style.animation="2s gis-fade-in forwards",o.components.contentContainer.subviews.secondaryText.style.animation="2s gis-fade-in forwards",o.components.contentContainer.subviews.secondaryText.style.visibility="visible",o.components.contentContainer.subviews.mainText.style.fontWeight="700",o.components.contentContainer.subviews.mainText.style.fontSize="20px",o.components.contentContainer.subviews.mainText.style.fontStyle="normal",o.components.contentContainer.subviews.mainText.style.lineHeight="23px",o.components.contentContainer.subviews.mainText.style.letterSpacing="0px",o.components.contentContainer.subviews.mainText.style.textAlign="center",eventLoggerService.logEvent(o.EVENT_LOGTAG+eventLoggerService.GIS_ACTIONS.SHOWN,{routingKey:stateService.getRoutingKey()})},o._submitContact=function(){if(!o.isSubmissionInProgress){o.isSubmissionInProgress=!0,o.emailTextBox.disableButton();var n={source:"connecting-v2",contact:{email:o.emailTextBox.getText().toLowerCase().trim()}},e=btoa(JSON.stringify(n));gisService.submitContactDetails(e,function(){o.isSubmissionInProgress=!1,o.emailTextBox.enableButton(),t.closeButton.onclick()},function(){o.isSubmissionInProgress=!1,logService.error(o.LOGTAG,"Error on submitting contact info from ConnectingV2."),o.emailTextBox.enableButton(),o.emailTextBox.showError("Failed to submit email address.")})}},o._hide=function(){eventLoggerService.logEvent(o.EVENT_LOGTAG+eventLoggerService.GIS_ACTIONS.CLOSED,{routingKey:stateService.getRoutingKey()}),o.isSubmissionInProgress=!1,o.emailTextBox&&o.emailTextBox.enableButton(),stateService.setCanceledOnConnectingScreen(!0),t.ctrlFunctions.endCall()},overrideService.override(o.LOGTAG,o),{render:o.render,setNoClerkAvailable:o.setNoClerkAvailable}}};GISAPP.gisPlayerScreen=function(serverInjectionService,globalObjectService,logService,GIS_CONSTANTS,stateService,uiUtilitiesService,videoPlayerComponent,deviceInfoService,shopStreamVideoHeaderComponent,eventService,ctaComponent,chatInputDOMProc,clientStorageService,iframeService,sliderComponent,productCarouselTileComponent,gisService,shopStreamService,utilitiesService,eventLoggerService,layoutService,productPopupComponent,carouselService,addToCartService,systemInfoService,chatGroupService,chatUserNameService,chatComponent){return function(i){var l,y,b,T,s,r,O,t,a,o,n,d,c,g,u,f,C,h,p,S,m,E,v,e,_,A,D,L,I,N,P,M,R,H,U,k,V,w=!1,q=!1,x='gisPlayerScreen',F=globalObjectService.getWindow().screen,B=[],z=[],W={BROADCAST_FOUND:0,BROADCAST_NOT_FOUND:1,INVALID_ALIAS:2},G=serverInjectionService.getLabels().mobile_product_toggle_label,Q=serverInjectionService.getUiConfig(),Y=serverInjectionService.getSystemConfig(),K=Y.shopStream,j=!1,J=!1,X={},Z=!1,$=!1,ee=!1,ie=!1,se=!1;function te(){if(J=!1,y=uiUtilitiesService.processView(serverInjectionService.getViews().gisPlayerView,{}),o=y.querySelector('#gis-player-close-button-container'),n=y.querySelector('#gis-player-close-button'),A=y.querySelector('#gis-mobile-portrait-player-header'),a=y.querySelector('#gis-player-video-header'),r=y.querySelector('#gis-player-video-container'),T=y.querySelector('#gis-player-right-pane'),t=y.querySelector('#gis-player-left-pane'),N=carouselService.getCarouselComponentView({hiddenArrowsLogic:function(){return deviceInfoService.isMobileDevice()||deviceInfoService.isIPad()&&layoutService.getOrientation().match(/portrait/)}}),(s=y.querySelector('#gis-product-carousel-container')).appendChild(N),O=y.querySelector('#gis-player-container'),g=y.querySelector('#gis-player-secondary-cta-container'),f=y.querySelector('#gis-player-chat-container'),p=y.querySelector('#gis-player-overlay-message'),stateService.getInputAlignment()===GIS_CONSTANTS.INPUT_ALIGNMENT.RTL&&uiUtilitiesService.addClass(p,'gis-rtl'),gisCallbacks.productsForBroadcastCallback=ce,gisCallbacks.checkCarouselUpdatedCallback=Be,gisCallbacks.updateCarousel=ze,E=new videoPlayerComponent({width:'100%',height:'100%',onFullScreen:Oe,initialScreen:_e,onChatClick:pe,onProductClick:Se,onPlay:i.onPlay,onPause:i.onPause}),l=E.render(),ee=deviceInfoService.isMobileDevice()?(E.hideControl(GIS_CONSTANTS.VIDEO_CONTROLS.CHAT),E.hideControl(GIS_CONSTANTS.VIDEO_CONTROLS.PRODUCT),$=!1):($=!!shopStreamService.isChatEnabledForShopStream(b)||(E.hideControl(GIS_CONSTANTS.VIDEO_CONTROLS.CHAT),!1),!!shopStreamService.isProductCarouselEnabledForShopStream()||(E.hideControl(GIS_CONSTANTS.VIDEO_CONTROLS.PRODUCT),!1)),He(),C=l.querySelector('#gis-vc-chat'),h=l.querySelector('#gis-vc-product'),u=y.querySelector('#gis-player-cta-container'),d=y.querySelector('#gis-player-cta'),(deviceInfoService.isMobileDevice()||J)&&(Pe(),uiUtilitiesService.addClass(a,'gis-mobile'),uiUtilitiesService.addClass(s,'gis-hide'),re()),deviceInfoService.isMobileDevice()&&layoutService.applyIf(he.bind(null,'landscape'),he.bind(null,'portrait'),[function(){return layoutService.getOrientation().match(/landscape/)}]),n.onclick=Fe,layoutService.resizeCallback(ve),layoutService.resizeCallback(ye),deviceInfoService.isIPad()?layoutService.orientationChangeCallback(ae.bind(null,!1),!0):deviceInfoService.isMobileDevice()||layoutService.resizeCallback(ae.bind(null,!1),!0),r.appendChild(l),m=y.querySelector('#gis-video'),uiUtilitiesService.showModal(y),b&&0===b.status?(uiUtilitiesService.addClass(s,'gis-hide'),uiUtilitiesService.addClass(f,'gis-hide'),l.querySelector('#gis-video-controls-container').style.display='none'):(function(){if(!shopStreamService.isChatEnabledForShopStream(b))return uiUtilitiesService.addClass(f,'gis-hide');var e=b.config&&b.config.chat&&b.config.chat.type||K.chat.type;if('replay'===b.type&&b.isChatProcessed&&'group'===e){var i=new chatComponent({type:e,videoPlayer:E,broadcast:b,onChatClick:E.internalToggleChat}),s=i.render();return t=s,uiUtilitiesService.removeClass(T,'gis-hide'),uiUtilitiesService.removeClass(f,'gis-hide'),uiUtilitiesService.removeClass(O,'gis-video'),uiUtilitiesService.addClass(O,'gis-video-chat'),f.appendChild(t),J||deviceInfoService.isMobileDevice()||E.showControl(GIS_CONSTANTS.VIDEO_CONTROLS.CHAT),E.internalToggleChat(!0),ae(!($=!0))}var t;var a=y.querySelector('#gis-user-title'),o=y.querySelector('#gis-user-secondary-title'),l=y.querySelector('#gis-user-error-msg'),r=y.querySelector('#gis-user-form-input'),n=y.querySelector('#gis-submit-user-form-btn'),d=y.querySelector('#gis-player-right-pane').getAttribute('id'),c=y.querySelector('#gis-user-form-container').getAttribute('id'),g=n.getAttribute('id'),u=r.getAttribute('id'),C=l.getAttribute('id'),h=serverInjectionService.getLabels().chat_userName_title,p=serverInjectionService.getLabels().chat_userName_secondary_title,S=chatUserNameService.isNameConfigured()?chatUserNameService.getUserName():serverInjectionService.getLabels().chat_userName_firstInput,m=serverInjectionService.getLabels().chat_joinChat_button;a.innerHTML=h,o.innerHTML=p,r.innerHTML=S,n.innerHTML=m,E.internalToggleChat(!1),E.hideControl(GIS_CONSTANTS.VIDEO_CONTROLS.CHAT),deviceInfoService.isMobileDevice()&&!deviceInfoService.isIos()&&(r.addEventListener('focus',function(){j=!0}),r.addEventListener('blur',function(){j=!1,be()}));if('question'===e)J||deviceInfoService.isMobileDevice()||E.showControl(GIS_CONSTANTS.VIDEO_CONTROLS.CHAT),f.appendChild(((v=chatInputDOMProc.render()).querySelector('#gis-convo').style.height='auto',v.querySelector('#gis-broadcast-close').style.display='none',v.style.width='100%',v)),E.internalToggleChat(!0);else{if('group'!==e)return uiUtilitiesService.addClass(f,'gis-hide');chatGroupService.getGroupCount(b.callUUID,function(e,i){if(e||i)return se=!($=!1),(deviceInfoService.isMobileDevice()||J)&&0!==B.length&&(uiUtilitiesService.removeClass(P,"gis-enabled"),uiUtilitiesService.removeClass(T,"gis-toggle-exists"),de()),J=!J,void ae(!1);J||deviceInfoService.isMobileDevice()||E.showControl(GIS_CONSTANTS.VIDEO_CONTROLS.CHAT),E.internalToggleChat(!0),chatUserNameService.openEnterUserForm(d,c,g,u,null,null,C,E.callChatButtonOnClick,!0),globalObjectService.getWindow().addEventListener('messageReceived',function(e){var i,s;e.detail[0].sender.uid!==stateService.getCallUserUUID()&&(i=e,s=0,f.className.match(/gis-hide/)&&E.showMessageIndicator(),i.detail.forEach(function(e){'text'===e.type&&s++}),E.updateMessageIndicatorCounter(s))})})}var v;deviceInfoService.isMobileDevice()||eventLoggerService.logEvent(eventLoggerService.GIS_EVENTS.CHAT_SHOWN_ON_SHOP_STREAM)}(),shopStreamService.isProductCarouselEnabledForShopStream()?b&&gisService.getProductsForBroadcast(b.id,'gisCallbacks.productsForBroadcastCallback'):uiUtilitiesService.addClass(s,'gis-hide')),me(),He(),u=y.querySelector('#gis-player-cta-container'),d=y.querySelector('#gis-player-cta'),De(),we(),uiUtilitiesService.enableBodyScroll(),gisAppLib.bodyScrollLock.disableBodyScroll(y),uiUtilitiesService.hasClass(s,"gis-hide")||eventLoggerService.logEvent(eventLoggerService.GIS_EVENTS.PRODUCT_CAROUSEL_SHOWN_ON_SHOP_STREAM),H=new productPopupComponent({type:null,payload:null,popUpContainer:y.querySelector('#gis-ss-player-popup'),labels:{product_details_popup_label:serverInjectionService.getLabels().product_popup_details_label,product_popup_view_details_label:serverInjectionService.getLabels().product_popup_more_info_label},repeatableATC:!0}),eventService.subscribe(GIS_CONSTANTS.EVENT_NAMES.SHOW_PRODUCT_DETAILS_POPUP,H.triggerDetailsPopup),deviceInfoService.isIPad()?(layoutService.applyIf(function(){layoutService.applyFullScreenHeight(y)},function(){layoutService.removeFullScreenHeight(y)},[le]),uiUtilitiesService.addClass(O,'gis-ipad-landscape')):layoutService.applyIf(function(){layoutService.applyFullScreenHeight(y)},function(){layoutService.removeFullScreenHeight(y)},[{selector:"<",breakpoint:{type:null,maxWidth:1025}},le]),b&&1===b.status&&(E.hideProgressBar(),deviceInfoService.isMobileDevice())){var e=l.querySelectorAll('.gis-desktop');uiUtilitiesService.removeClassOnList(e,'gis-desktop'),uiUtilitiesService.addClassOnList(e,'gis-mobile')}ae(!0)}function ae(e){var i=layoutService.getWindowSize();deviceInfoService.isIPad()?layoutService.getOrientation().match(/portrait/)&&i.WIDTH<1025&&!J?oe(!0,e):layoutService.getOrientation().match(/landscape/)&&1024i.WIDTH&&J&&i.WIDTH<1025&&layoutService.getOrientation().match(/landscape/)&&!Z&&(oe(!(Z=!0),e),setTimeout(function(){Z=!1},2e3)):deviceInfoService.isMobileDevice()||deviceInfoService.isIPad()||(i.WIDTH<1025&&!J?oe(!0,e):1025<=i.WIDTH&&J&&oe(!1,e))}function oe(e,i){(!i||i&&e||i&&!e&&deviceInfoService.isIPad())&&((J=e)?(uiUtilitiesService.removeClass(O,'gis-ipad-landscape'),uiUtilitiesService.addClass(O,'gis-ipad-portrait'),E.hideControl(GIS_CONSTANTS.VIDEO_CONTROLS.CHAT),E.hideControl(GIS_CONSTANTS.VIDEO_CONTROLS.PRODUCT),uiUtilitiesService.addClass(a,'gis-mobile'),uiUtilitiesService.addClass(s,'gis-hide'),Ue(),Pe(),E.setupUiForMobile(),b&&0!==b.status&&(re(),uiUtilitiesService.removeClass(T,'gis-hide'),ve(),me())):(uiUtilitiesService.removeClass(O,'gis-ipad-portrait'),deviceInfoService.isIPad()&&uiUtilitiesService.addClass(O,'gis-ipad-landscape'),re(),shopStreamService.isChatEnabledForShopStream(b)&&$&&b&&b.status!==GIS_CONSTANTS.BROADCAST_STATUS.BROADCAST_CREATED?(E.showControl(GIS_CONSTANTS.VIDEO_CONTROLS.CHAT),C.classList.contains('gis-disabled')?E.internalToggleChat(!1):uiUtilitiesService.removeClass(T,'gis-hide')):E.internalToggleChat(!1),shopStreamService.isProductCarouselEnabledForShopStream()&&ee&&b&&0!==b.status?(E.showControl(GIS_CONSTANTS.VIDEO_CONTROLS.PRODUCT),h.classList.contains('gis-disabled')?E.internalToggleProduct(!1):uiUtilitiesService.removeClass(s,'gis-hide'),ve()):E.internalToggleProduct(!1),uiUtilitiesService.removeClass(a,'gis-mobile'),Me(),ke(),X&&X.showAvailabilityIndicator&&X.isAvailable&&(De(),Le(X.showAvailabilityIndicator,X.isAvailable)),X&&X.onclick&&xe(X.onclick),Te(),E.setupUiForDesktop(),me(),carouselService.refresh()),w&&Oe())}function le(){return w}function re(){P=y.querySelector("#gis-chat-carousel-toggle-container"),M=y.querySelector("#gis-chat-toggle"),R=y.querySelector("#gis-product-toggle"),deviceInfoService.isMobileDevice()||J?(shopStreamService.isProductCarouselEnabledForShopStream()&&(uiUtilitiesService.removeNode(s),T.appendChild(s)),shopStreamService.isProductCarouselEnabledForShopStream()&&0!==B.length&&shopStreamService.isChatEnabledForShopStream(b)&&!se?(uiUtilitiesService.removeClass(P,'gis-hide'),uiUtilitiesService.addClass(T,"gis-toggle-exists"),G||(G=serverInjectionService.getLabels().mobile_product_toggle_label),M.innerHTML=serverInjectionService.getLabels().mobile_chat_toggle_label,R.innerHTML||(R.innerHTML=G),uiUtilitiesService.addClass(P,"gis-enabled"),M.addEventListener("click",function(){eventLoggerService.logEvent(eventLoggerService.GIS_EVENTS.SHOP_STREAM_CHAT_BUTTON_CLICKED),ne()}),R.addEventListener("click",function(){eventLoggerService.logEvent(eventLoggerService.GIS_EVENTS.SHOP_STREAM_PRODUCT_CAROUSEL_BUTTON_CLICKED),de()})):(uiUtilitiesService.removeClass(P,"gis-enabled"),uiUtilitiesService.removeClass(T,"gis-toggle-exists"),shopStreamService.isChatEnabledForShopStream(b)&&!se&&$?ne():shopStreamService.isProductCarouselEnabledForShopStream()&&ie&&de()),shopStreamService.isChatEnabledForShopStream(b)&&!se?ne():shopStreamService.isProductCarouselEnabledForShopStream()&&ie&&de()):(shopStreamService.isProductCarouselEnabledForShopStream()&&ve(),uiUtilitiesService.removeClass(P,"gis-enabled"),uiUtilitiesService.removeClass(T,"gis-toggle-exists"),E.internalToggleProduct(!0),E.internalToggleChat(!0))}function ne(){uiUtilitiesService.removeClass(R,"gis-active"),uiUtilitiesService.addClass(s,"gis-hide"),eventLoggerService.logEvent(eventLoggerService.GIS_EVENTS.PRODUCT_CAROUSEL_HIDDEN_ON_SHOP_STREAM),uiUtilitiesService.removeClass(f,"gis-hide"),uiUtilitiesService.addClass(M,"gis-active"),eventLoggerService.logEvent(eventLoggerService.GIS_EVENTS.CHAT_SHOWN_ON_SHOP_STREAM)}function de(){uiUtilitiesService.removeClass(M,"gis-active"),uiUtilitiesService.addClass(f,"gis-hide"),eventLoggerService.logEvent(eventLoggerService.GIS_EVENTS.CHAT_HIDDEN_ON_SHOP_STREAM),uiUtilitiesService.removeClass(s,"gis-hide"),uiUtilitiesService.addClass(R,"gis-active"),S&&(deviceInfoService.isMobileDevice()||J)&&gisAppLib.bodyScrollLock.disableBodyScroll(S),eventLoggerService.logEvent(eventLoggerService.GIS_EVENTS.PRODUCT_CAROUSEL_SHOWN_ON_SHOP_STREAM)}function ce(e){if(e.version&&(V=e.version,eventService.publish(GIS_CONSTANTS.EVENT_NAMES.CHECK_FOR_CAROUSEL_UPDATE)),0===e.productCarousel.length)return uiUtilitiesService.addClass(s,'gis-hide'),E.hideControl(GIS_CONSTANTS.VIDEO_CONTROLS.PRODUCT),ie=ee=!1,void me();ie=!0,"none"===h.style.display||deviceInfoService.isMobileDevice()||J||(E.showControl(GIS_CONSTANTS.VIDEO_CONTROLS.PRODUCT),ee=!0),uiUtilitiesService.removeClass(s,'gis-hide'),me(),ge(ue(e)),ve()}function ge(e){S=N.querySelector('#gis-slider-content'),e.forEach(function(e){if(e.id&&addToCartService.isAddToCartConfigured())carouselService.addTileToCarousel(e);else{var i=new productCarouselTileComponent({title:e.title,imageUrl:e.imageUrl,price:e.price,currency:e.currency,productUrl:e.productUrl,alignment:'horizontal',id:e.id,sku:e.sku});z.push(i),N.querySelector('#gis-slider-content').appendChild(i.render()),carouselService.refresh()}}),S&&(deviceInfoService.isMobileDevice()||J)&&gisAppLib.bodyScrollLock.disableBodyScroll(S)}function ue(e){var i=e.productCarousel;return i.forEach(function(e){e.id=e.productSku,e.onAccept=addToCartService.onAddToBasketTriggered.bind(null,e)}),B=i,(deviceInfoService.isMobileDevice()||J)&&re(),B&&0",t.style.lineHeight=t.height+"px",s.addEventListener('click',o.bind(null,Ae)),p.addEventListener('click',o.bind(null,e)),p.style.pointerEvents="none",t.appendChild(a),U.appendChild(t)}function we(){if(!b||'replay'!==b.type){var e=stateService.getBroadcastResponse().status,i=void 0===e||e==W.BROADCAST_FOUND;if((utilitiesService.getUrlParams()[GIS_CONSTANTS.QUERY_PARAM.GIS_CHANNEL_PARAM]||utilitiesService.getUrlParams()[GIS_CONSTANTS.QUERY_PARAM.GIS_EVENT_PARAM]||10==b.status)&&(!i||!(utilitiesService.getUrlParams()[GIS_CONSTANTS.QUERY_PARAM.GIS_CHANNEL_PARAM]&&10!=b.status||utilitiesService.getUrlParams()[GIS_CONSTANTS.QUERY_PARAM.GIS_EVENT_PARAM]&&1==b.status))){var s=y.querySelector('#gis-player-overlay-message'),t=y.querySelector('#gis-player-msg-title'),a=y.querySelector('#gis-player-msg-subtitle');L=y.querySelector('#gis-player-msg-text'),deviceInfoService.isMobileDevice()||J?(uiUtilitiesService.addClass(t,'gis-mobile'),uiUtilitiesService.addClass(a,'gis-mobile'),uiUtilitiesService.addClass(L,'gis-mobile'),shopStreamService.isChatTypeQuestion(b)&&chatInputDOMProc.disableChat(),a.style.fontSize='11px'):b&&10===b.status?(C&&(C.style.zIndex=2),h&&(h.style.zIndex=2)):(ee&&E.internalToggleProduct(!1),$&&E.internalToggleChat(!1)),m.src&&(m.src='',l.querySelector('#gis-vc-play').onclick()),m.style.background='#37373E',uiUtilitiesService.removeClass(s,'gis-hide'),r.querySelector('#gis-video-controls-container'),U&&uiUtilitiesService.addClass(U,'gis-hide');var o=function(e){var i={firstText:'',secondText:'',thirdText:''},s=serverInjectionService.getLabels();if(e==W.BROADCAST_NOT_FOUND)i.firstText=s.broadcastViewer_broadcastNotFoundText1,i.secondText=s.broadcastViewer_broadcastNotFoundText2;else if(e==W.INVALID_ALIAS)i.firstText=s.broadcastViewer_invalidBroadcastUrlText1,i.secondText=s.broadcastViewer_invalidBroadcastUrlText2;else if(e==W.BROADCAST_FOUND&&10==b.status)i.firstText=s.broadcastViewer_broadcastEventEnded1,i.secondText=s.broadcastViewer_broadcastEventEnded2;else if(e==W.BROADCAST_FOUND&&0==b.status){i.firstText=s.broadcastViewer_broadcastEventToBegin,i.secondText=b.name;var t=new Date(b.broadcastEventHoldTimeStamp);i.thirdText=qe(t)}return i}(e);e==W.BROADCAST_NOT_FOUND||e==W.INVALID_ALIAS?(uiUtilitiesService.addClass(a,'gis-content-align'),a.innerHTML=o.firstText+'
'+o.secondText):(t.innerHTML=o.firstText,a.innerHTML=o.secondText,L.innerHTML=o.thirdText)}}}function qe(e){var i='';return i+=e.toLocaleDateString('en-US',{weekday:'long'})+', ',i+=e.toLocaleDateString('en-US',{month:'short'})+' ',i+=e.toLocaleDateString('en-US',{day:'numeric'})+', ',i+=e.toLocaleTimeString('en-US',{hour:'2-digit',minute:'2-digit'})}function xe(i){c&&'function'==typeof i&&(X.onclick=i,u&&(u.onclick=function(e){i.call(this,e)}),g.onclick=function(e){i.call(this,e)})}function Fe(e){w&&_e(),q=!1,_&&_(e),F.orientation&&F.orientation.removeEventListener('change',Ce),E.dispose(),uiUtilitiesService.clearView(uiUtilitiesService.getInnerPanel()),uiUtilitiesService.hideModal(!1,GIS_CONSTANTS.ACTIONS.BROADCAST_SCREEN_CLOSED),uiUtilitiesService.enableBodyScroll(),B=[],delete gisCallbacks.productsForBroadcastCallback,delete gisCallbacks.checkCarouselUpdatedCallback,delete gisCallbacks.updateCarousel,eventService.unsubscribe(GIS_CONSTANTS.EVENT_NAMES.SHOW_PRODUCT_DETAILS_POPUP,H.triggerDetailsPopup)}function Be(e){e&&e.isVersionChanged&&gisService.getProductsForBroadcast(b.id,'gisCallbacks.updateCarousel')}function ze(e){if(V=e.version,0Looking for customer support?",button:n}),a.hideFooter(),c.subviews.contentContainer=c.components.contentContainer.render(),uiUtilitiesService.appendView(c.subviews.split1,c.subviews.imageContainer),uiUtilitiesService.appendView(c.subviews.split2,c.subviews.contentContainer),eventLoggerService.logEvent(r+eventLoggerService.GIS_ACTIONS.SHOWN)},c.invalidDirectCallScreen=function(){r=eventLoggerService.GIS_VIEWS.INVALID_DIRECT_CALL,c.subviews.split1.innerHTML="",c.subviews.split2.innerHTML="",uiUtilitiesService.addClass(c.subviews.split1,"gis-humanized"),c.components.imageContainer=new modalImageComponent({mainImage:{filename:"direct-call-broken-link.png",width:"100%",backgroundSize:"cover"}}),c.subviews.imageContainer=c.components.imageContainer.render(),c.components.imageContainer.setImageToFullCover(),c.components.contentContainer=new modalContentComponent({mainText:{text:"Sorry, your Live Video Link is invalid.",class:"gis-humanized"},secondaryText:"
Check if you have correctly entered the complete invite URL.
Contact your in-store associate to request a new link.
",linkText:"What is this?",footerText:"Looking for customer support?",button:{label:"OK",eventName:eventLoggerService.GIS_VIEWS.INVALID_DIRECT_CALL+eventLoggerService.GIS_VIEWS.INVALID_DIRECT_CALL_BTN,eventData:{source:"directCall"},onclick:a.closeButton.onclick,buttonClass:"gis-humanized"}}),a.hideFooter(),c.subviews.contentContainer=c.components.contentContainer.render(),uiUtilitiesService.appendView(c.subviews.split1,c.subviews.imageContainer),uiUtilitiesService.appendView(c.subviews.split2,c.subviews.contentContainer),eventLoggerService.logEvent(r+eventLoggerService.GIS_ACTIONS.SHOWN)},c.browserUnsupported=function(){r=eventLoggerService.GIS_VIEWS.BROWSER_UNSUPPORTED,c.subviews.split1.innerHTML="",c.subviews.split2.innerHTML="",a.showFooter(),uiUtilitiesService.removeClass(c.subviews.split1,"gis-humanized"),c.components.imageContainer.setup({mainImage:{filename:"unsupported-browser.png",backgroundSize:"80%"}}),uiUtilitiesService.appendView(c.subviews.split1,c.components.imageContainer.render()),c.components.contentContainer2=new modalContentComponent({mainText:{text:"Your browser doesn't support this experience"},secondaryText:"Open the page in an up to date supported browser and start again.",button:{label:"Got it",onclick:a.closeButton.onclick}}),a.hideInfoButton(),uiUtilitiesService.appendView(c.subviews.split2,c.components.contentContainer2.render()),eventLoggerService.logEvent(r+eventLoggerService.GIS_ACTIONS.SHOWN)},c.noMic=function(){r=eventLoggerService.GIS_VIEWS.NO_MIC,c.subviews.split1.innerHTML="",c.subviews.split2.innerHTML="",a.showFooter(),uiUtilitiesService.removeClass(c.subviews.split1,"gis-humanized"),c.components.imageContainer.setup({mainImage:{filename:"No-Mic-Detected.png"}}),uiUtilitiesService.appendView(c.subviews.split1,c.components.imageContainer.render()),c.components.contentContainer2=new modalContentComponent({mainText:{text:"Your mic isn't
connected"},secondaryText:"Check your mic is connected [USB / Bluetooth], turned on, and unmuted, then start again.",button:{label:"Got it",onclick:a.closeButton.onclick}}),a.hideInfoButton(),uiUtilitiesService.appendView(c.subviews.split2,c.components.contentContainer2.render()),eventLoggerService.logEvent(r+eventLoggerService.GIS_ACTIONS.SHOWN)},c.setConnecting=function(e){r=eventLoggerService.GIS_VIEWS.CONNECTING,2===serverInjectionService.getUiConfig().micSetupVersion?(n=e,c.components.contentContainer2&&(c.components.contentContainer2.setup({centerImage:{filename:"mic_ok.png",height:deviceInfoService.isMobileDevice()&&!deviceInfoService.isIPad()?"100px":"160px"},secondaryText:"Microphone enabled"}),c.components.contentContainer2.components.button2.hide()),c.timeouts.push(setTimeout(function(){a.steps&&a.steps.hide(),a.setTitle(""),a.updateChild(connectingScreen,{noClerkAvailable:n,setBookingWidget:c.setBookingWidget})},2e3))):a.updateChild(connectingScreen,{noClerkAvailable:n,setBookingWidget:c.setBookingWidget}),a.hideInfoButton(),eventLoggerService.logEvent(r+eventLoggerService.GIS_ACTIONS.SHOWN,{routingKey:stateService.getRoutingKey()})},c.setNoClerkAvailable=function(){n=!0},c.micBlocked=function(){r=eventLoggerService.GIS_VIEWS.MIC_BLOCKED,c.subviews.split1.style.width="",c.subviews.split1.style.height="",c.subviews.split1.innerHTML="",c.subviews.split2.innerHTML="",a.setTitle(""),c.components.imageContainer.setup({mainImage:{filename:"mic-denied.png"}}),uiUtilitiesService.appendView(c.subviews.split1,c.components.imageContainer.render()),c.components.contentContainer2=new modalContentComponent({mainText:{text:"Oops, you blocked your microphone"},secondaryText:"To talk to us you need to unblock your mic via address bar or settings.",button:{label:"OK",onclick:a.closeButton.onclick}}),uiUtilitiesService.appendView(c.subviews.split2,c.components.contentContainer2.render()),a.hideInfoButton(),eventLoggerService.logEvent(r+eventLoggerService.GIS_ACTIONS.SHOWN)},c.meetingConnectScreenWaiting=function(e){r=eventLoggerService.GIS_VIEWS.MEETING_CONNECT;var n=new Date(e.data.startTime),t=serverInjectionService.getLabels(),i=[{text:t.meetingScreen_Title,type:"title"},{text:t.meetingScreen_subMainText,type:"subTitle"},{text:t.meetingScreen_infoText,type:"subTitle"},{value:l(),type:"other"},{label:t.meetingScreen_connectBtnLabel,image:mediaService.isMicAllowed()?"":"mic.svg",isResponsive:!0,responseLabel:t.meetingScreen_waiting,onClick:c.connectClick,eventName:eventLoggerService.GIS_VIEWS.MEETING_CONNECT+eventLoggerService.GIS_VIEWS.MEETING_CONNECT_BTN,eventData:{source:"meetingCall"},buttonClass:"gis-humanized",type:"button"},{text:t.meetingScreen_startTimeText+" "+utilitiesService.getFormattedTime(n),type:"subTitle"},{text:t.meetingScreen_startDateText+" "+utilitiesService.getFormattedDate(n),type:"subTitle"}];m(r,"meeting-connect-image.png",i);var o=new Date((new Date).setMinutes((new Date).getMinutes()+3));if(oLooking for customer support?",button:{label:"Join Call",image:mediaService.isMicAllowed()?"":"mic.svg",isResponsive:!0,responseLabel:"Please Wait...",onclick:function(){c.connectClick(e)},eventName:eventLoggerService.GIS_VIEWS.ADD_A_PERSON_VIEW+eventLoggerService.GIS_VIEWS.ADD_A_PERSON_CALL_BUTTON,eventData:{source:"addAPersonCall"},buttonClass:"gis-humanized"}}),a.hideFooter(),c.subviews.contentContainer=c.components.contentContainer.render(),uiUtilitiesService.appendView(c.subviews.split1,c.subviews.imageContainer),uiUtilitiesService.appendView(c.subviews.split2,c.subviews.contentContainer),eventLoggerService.logEvent(r+eventLoggerService.GIS_ACTIONS.SHOWN)},c.setCallEndedScreenForAddAPerson=function(){addAPersonService.addAPersonEndCallScreenShown(),r=eventLoggerService.GIS_VIEWS.ADD_A_PERSON_CALL_ENDED_VIEW,c.subviews.split1.innerHTML="",c.subviews.split2.innerHTML="";var e={mainText:{text:serverInjectionService.getLabels().add_a_person_call_has_ended_main_text,class:"gis-humanized"},mainSubText:serverInjectionService.getLabels().add_a_person_call_has_ended_sub_main_text,button:{label:serverInjectionService.getLabels().add_a_person_start_new_call_button_text,image:mediaService.isMicAllowed()?"":"mic.svg",isResponsive:!0,responseLabel:serverInjectionService.getLabels().directCallScreen_v3_waiting,onclick:c.connectClick,eventName:eventLoggerService.GIS_VIEWS.ADD_A_PERSON_CALL_ENDED_VIEW+eventLoggerService.GIS_VIEWS.ADD_A_PERSON_CALL_ENDED_BUTTON,eventData:{source:"standard"},buttonClass:"gis-humanized"}};bookingService.isBookingEnabled()?(serverInjectionService.getUiConfig().supportInfoLink&&a.showInfoButton(),e.secondaryButton={label:serverInjectionService.getLabels().schedule_booking_button_label,onclick:c.setBookingWidget,eventName:eventLoggerService.GIS_VIEWS.CONNECT+eventLoggerService.GIS_VIEWS.BOOKING_SCHEDULE_BUTTON,eventData:{source:"standard"},class:"gis-secondary-button"}):e.linkText=serverInjectionService.getLabels().support_info_text;uiUtilitiesService.addClass(c.subviews.split1,"gis-humanized"),c.components.imageContainer=new modalImageComponent({mainImage:{filename:"call-has-ended-connect-screen.jpg",width:"100%",backgroundSize:"cover"}}),c.subviews.imageContainer=c.components.imageContainer.render(),c.components.imageContainer.setImageToFullCover(),c.components.contentContainer=new modalContentComponent(e),a.hideFooter(),c.subviews.contentContainer=c.components.contentContainer.render(),deviceInfoService.isMobileDevice()?(c.components.contentContainer.subviews.mainSubText.style.paddingTop="23px",c.components.contentContainer.subviews.mainSubText.style.paddingBottom="34px"):(c.components.contentContainer.subviews.mainSubText.style.paddingTop="37px",c.components.contentContainer.subviews.mainSubText.style.paddingBottom="147px"),uiUtilitiesService.appendView(c.subviews.split1,c.subviews.imageContainer),uiUtilitiesService.appendView(c.subviews.split2,c.subviews.contentContainer),eventLoggerService.logEvent(r+eventLoggerService.GIS_ACTIONS.SHOWN)},c.setMeetingMissed=function(){r=eventLoggerService.GIS_VIEWS.MEETING_MISSED;var e=serverInjectionService.getLabels(),n=[{text:e.meetingScreen_Title,type:"title"},{text:e.meetingScreen_missedText,type:"subTitle"},{value:l(),type:"other"},{label:e.schedule_booking_button_label,onClick:c.setBookingWidget,eventName:r+eventLoggerService.GIS_VIEWS.BOOKING_SCHEDULE_BUTTON,class:"gis-secondary-button",type:"button"}];m(r,"meeting-connect-image.png",n)},c.setMeetingEnded=function(){r=eventLoggerService.GIS_VIEWS.MEETING_ENDED;var e=serverInjectionService.getLabels(),n=[{text:e.meetingScreen_ended,type:"title"},{label:e.schedule_booking_button_label,onClick:c.setBookingWidget,eventName:r+eventLoggerService.GIS_VIEWS.BOOKING_SCHEDULE_BUTTON,class:"gis-secondary-button",type:"button"}];m(r,"meeting-connect-image.png",n)},c.setMeetingCancelled=function(){r=eventLoggerService.GIS_VIEWS.MEETING_CANCELED;var e=serverInjectionService.getLabels(),n=[{text:e.meetingScreen_Title,type:"title"},{text:e.meetingScreen_canceledText,type:"subTitle"},{value:l(),type:"other"},{label:e.schedule_booking_button_label,onClick:c.setBookingWidget,eventName:r+eventLoggerService.GIS_VIEWS.BOOKING_SCHEDULE_BUTTON,class:"gis-secondary-button",type:"button"}];m(r,"meeting-connect-image.png",n)},c.setBookingWidget=function(){var e=r;if(r=eventLoggerService.GIS_VIEWS.BOOKING,bookingService.isOpenBookingWidgetInNewTab())bookingService.openBookingPage();else{a.hideFooter(),a.hideInfoButton(),a.hideCloseButton();var n=a.modalContainer.querySelector("#gis-modal-content"),t=uiUtilitiesService.processView(serverInjectionService.getViews().bookingWidgetView,{},!1);uiUtilitiesService.clearView(n),n.appendChild(t);var i=t.querySelector("#gis-booking-widget-back-button-container");e?(t.querySelector('#gis-booking-widget-back-button-message').innerText=serverInjectionService.getLabels().bookingWidget_back_button_message,i.onclick=function(){switch(uiUtilitiesService.clearView(n),n.appendChild(c.render().querySelector('#gis-splitLayout')),a.showCloseButton(),e){case eventLoggerService.GIS_VIEWS.CONNECT:c.setHumanizedConnectScreen();break;case eventLoggerService.GIS_VIEWS.CLERK_UNAVAILABLE_CONNECT:c.setClerkUnavailableConnectScreen();break;case eventLoggerService.GIS_VIEWS.MEETING_CANCELED:c.setMeetingCancelled();break;case eventLoggerService.GIS_VIEWS.MEETING_ENDED:c.setMeetingEnded();break;case eventLoggerService.GIS_VIEWS.MEETING_MISSED:c.setMeetingMissed();break;case eventLoggerService.GIS_VIEWS.MEETING_ERROR:c.setMeetingSomethingWrong();break;case eventLoggerService.GIS_VIEWS.CONNECTING:c.setHumanizedConnectScreen()}}):i.style.visibility='hidden',t.querySelector("#gis-booking-widget-close-button-container").onclick=function(){a.hide()},iframeService.initializeSourceLessIframeWithScriptInjection('gis-booking-widget',t.querySelector('#gis-booking-widget-body'),bookingService.getScheduleCallButtonUrl(),{isSrc:!0,isCrossCommunication:!1}),eventLoggerService.logEvent(r+eventLoggerService.GIS_ACTIONS.SHOWN)}},c.setInformationScreen=function(e){r=eventLoggerService.GIS_VIEWS.ADD_A_PERSON_SESSION_IS_FULL_VIEW,a.hideFooter(),a.hideInfoButton(),a.hideCloseButton();var n=a.modalContainer.querySelector("#gis-modal-content"),t=uiUtilitiesService.processView(serverInjectionService.getViews().informationView,{},!1);uiUtilitiesService.clearView(n),n.appendChild(t),t.querySelector('#gis-connectv3-mainText').innerText=e,t.querySelector("#gis-information-close-button-container").onclick=function(){a.hide()},eventLoggerService.logEvent(r+eventLoggerService.GIS_ACTIONS.SHOWN)},c.setMeetingSomethingWrong=function(){r=eventLoggerService.GIS_VIEWS.MEETING_ERROR;var e=serverInjectionService.getLabels(),n=[{text:e.meetingScreen_Title,type:"title"},{text:e.meetingScreen_somethingWentWrongText,type:"subTitle"},{value:l(),type:"other"},{label:e.schedule_booking_button_label,onClick:c.setBookingWidget,eventName:r+eventLoggerService.GIS_VIEWS.BOOKING_SCHEDULE_BUTTON,class:"gis-secondary-button",type:"button"}];m(r,"meeting-connect-image.png",n)},c._hide=function(){c.timeouts=uiUtilitiesService.clearTimeouts(c.timeouts),eventLoggerService.logEvent(r+eventLoggerService.GIS_ACTIONS.CLOSED),stateService.getCurrentPhase!==stateService.phase.READY&&c.props.ctrlFunctions.handlePostCallEvents()},c.connectClick=function(e){var n,t;stateService.isAndroidSocialBrowser()?(n=a.modalContainer.parentElement.parentElement,t=new popup({type:GIS_CONSTANTS.POPUP_TYPE.ANDROID_SOCIAL_BROWSER,position:'center',backgroundClass:'gis-social-browser-background',popupContent:{mainText:serverInjectionService.getLabels().social_browser_popup_main_text,subMainText:serverInjectionService.getLabels().social_browser_popup_sub_main_text,svgColor:serverInjectionService.getUiConfig().theme.mainColor}}),n.append(t.render())):function(e){if(bookingService.isAddAPersonEnabled()&&utilitiesService.isMeeting()||addAPersonService.isAddAPersonCall()&&callService.isAddAPersonEnabled()){var n=otService.initSession(stateService.getTokBoxApiKey(),stateService.getSessionId(),function(e){e&&logService.error("PRE-CALL-SCREEN","Error on initiating OT session",e)}),i=0,o=0;n.setConnectionCreatedHandler(function(e){var n=JSON.parse(e.connection.data),t=n&&n.userType;o++,'CONSUMER'===t&&i++}),n.connect(stateService.getToken(),function(){}),setTimeout(function(){n.off(),n.disconnect(),3