{"version":3,"sources":["../../../Content/Logo/LogoService/src/Program.js","../../../Content/Logo/LogoService/src/PositionController.js","../../../Content/Logo/LogoService/src/Hover.js","../../../Content/Logo/LogoService/src/Lightbox.js","../../../Content/Logo/LogoService/src/Service.js","../../../Content/Logo/LogoService/src/main.js"],"names":["loadingSelector","Program","logo","settings","$icon","refs","$popup","popupId","logEvent","hasIframe","on","_this","open","$","document","trigger","entryId","this","hoverOpenTime","Date","getTime","isPopupOpened","dispatchEvent","Action","clientParams","Qty","Math","ceil","ccs_cc_log","event","Event","isDefaultPrevented","showLoadingIndicator","showLoading","toggleIframeSrc","openPopup","triggerShowEvent","hideLoading","closePopup","triggerHideEvent","$iframe","find","$iframeContainer","parent","src","attr","detach","appendTo","$loading","showIndicatorTimeout","setTimeout","_this2","isIndicatorShown","show","hide","clearTimeout","directionClass","PositionController","hoverDirection","collectScreenValues","clearHoverStyles","css","top","left","guessHoverDirection","hoverPosition","getHoverPositionOnHorizontalAxis","getHoverPositionOnVerticalAxis","Top","Left","visibility","backgroundPosition","arrowBgPositionX","arrowBgPositionY","values","width","outerWidth","height","outerHeight","iconSizeBox","getBoundingClientRect","icon","ViewportTop","ViewportLeft","Width","Height","HalfWidth","HalfHeight","$w","window","viewport","innerWidth","innerHeight","ScrollTop","scrollTop","ScrollLeft","scrollLeft","distanceFromIconBound","Right","Bottom","distanceFromIconCenter","screenValues","removeAttr","removeClass","hoverWidth","$hover","addClass","suitsToLeft","suitsToRight","hoverHeight","isScrollVisible","body","offsetHeight","suitsToTop","suitsToBottom","suitsToHorizontalDirection","hoverDocumentTop","hoverHalfHeight","hoverVerticalMiddle","iconVerticalMiddle","concat","hoverDocumentLeft","hoverHalfWidth","hoverHorizontalMiddle","iconHorizontalMiddle","closeButtonSelector","Hover","arguments","positionController","initIconEvents","initHoverEvents","initLoadingIndicator","openHoverOnClick","initIconClick","onIconMouseEnter","e","keyCode","closeOnMouseLeave","onIconMouseLeave","closingTimeoutId","openingTimeoutId","_this3","hoverOpenDelay","_this4","close","hoverCloseDelay","self","onHoverMouseLeave","_this5","mouseenter","onHoverMouseEnter","mouseleave","_this6","resize","init","originalWidth","data","viewPortWidth","position","addEventListener","_this7","messageHandler","isMessageReceived","parseJSON","hoverLoad","Lightbox","require","config","touch","smallBtn","baseClass","beforeShow","afterClose","param","initImageConfig","initMobileConfig","type","content","resizeMobile","maxWidth","fancybox","Service","$ep","icons","create","initEventsListener","each","index","logoIcon","$logoIcon","logoId","Instance","getInstance","toLowerCase","openedLogo","preventDefault","instance","currentTarget","entryPointId","length","ccs_util","isMobile"],"mappings":"0FAEA,IACCA,EAAkB,+BAGEC,wBACRC,EAAMC,iCACZC,MAAQF,EAAKG,KAAKD,WAClBE,OAASJ,EAAKG,KAAKC,YAEnBC,QAAUL,EAAKK,aAEfJ,SAAWA,OACXK,SAAWN,EAAKM,cAEhBC,UAAYP,EAAKO,wFAIjBL,MAAMM,GAAG,QAAS,kBAAMC,EAAKC,oDAIlCC,EAAEC,UAAUC,QAAQ,iBAAkB,CACrCC,QAASC,KAAKV,eAGVW,eAAgB,IAAIC,MAAOC,eAC3BC,eAAgB,OAMhBC,cAJgB,CACpBC,OAAQ,qDAOTV,EAAEC,UAAUC,QAAQ,kBAAmB,CACtCC,QAASC,KAAKV,cAITiB,EAAe,CACpBD,OAAQ,aACRE,IAHiBC,KAAKC,OAAM,IAAIR,MAAOC,UAAYH,KAAKC,eAAiB,WAMrEG,eAAgB,OAChBC,cAAcE,yCAGNA,GACbI,WAAWN,cAAcL,KAAKT,SAAUgB,sCAIlCK,EAAQhB,EAAEiB,MAAM,oBAEjB1B,MAAMW,QAAQc,GAEfA,EAAME,uBAINd,KAAKR,YACJQ,KAAKe,2BACHC,mBAGDC,wBAGDC,iBACAC,yDAIAhC,MAAMW,QAAQ,gBAEfE,KAAKR,iBACH4B,mBACAH,wBAGDI,kBACAC,iEAICC,EAAUvB,KAAKX,OAAOmC,KAAK,UAC3BC,EAAmBF,EAAQG,SAE7BC,EAAOJ,E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fE,UAAiD,WAAtCoL,EAAUhJ,KA7BL,4BA8BhBa,eAAgB/C,EAAKR,SAASuD,eAC9B1B,qBAAmE,SAA7C6J,EAAUhJ,KA9BT,oCA+BvBrC,SAAUqL,EAAUhJ,KAnCJ,wBAsCXkJ,EAAWpL,EAAKqL,YAAYH,GAElCA,EAAUjC,KAAK,UAAW,IAAImC,EAAS7L,EAAMS,EAAKR,iDAIzCC,SAGY,UAFHA,EAAMyC,KAxCT,0BAwC+BoJ,cAG7CnE,EACAuC,+DAIEkB,MACH7K,GAAG,cACH,SAACmB,MACIsB,EAAK+I,kBACRrK,EAAMsK,kBACC,MAGFC,EAAWvL,EAAEgB,EAAMwK,eAAezC,KAAK,WAE7CzG,EAAK+I,WAAaE,IAEnB1L,GAAG,eAAgB,kBAAMyC,EAAK+I,WAAa,OAE7CrL,EAAE4E,QAAQ/E,GAAG,2BACZ,WACKyC,EAAK+I,YACR/I,EAAK+I,WAAWzC,2BCvEN,SAAU6C,EAAcnM,GACtC,IAAMmL,EAAMzK,EAAC,IAAA2G,OAAK8E,IAElB,GAAmB,IAAfhB,EAAIiB,OAAR,CAIIC,SAASC,aACZtM,EAASiI,kBAAmB,EAC5BjI,EAASsI,mBAAoB,GAG9B,IAAM2D,EAAW,IAAIf,EAAQlL,EAAUmL,GAEvCA,EAAI1B,KAAK,cAAewC","file":"LogoService.min.js","sourcesContent":["import $ from \"jquery\";\r\n\r\nconst hoverUrlAttr = \"data-logo-hover-url\",\r\n\tloadingSelector = \"div[data-logo-hover-loading]\",\r\n\tdisplayModeAttr = \"data-display-mode\";\r\n\r\nexport default class Program {\r\n\tconstructor(logo, settings) {\r\n\t\tthis.$icon = logo.refs.$icon;\r\n\t\tthis.$popup = logo.refs.$popup;\r\n\r\n\t\tthis.popupId = logo.popupId;\r\n\r\n\t\tthis.settings = settings;\r\n\t\tthis.logEvent = logo.logEvent;\r\n\r\n\t\tthis.hasIframe = logo.hasIframe;\r\n\t}\r\n\r\n\tinitIconClick() {\r\n\t\tthis.$icon.on(\"click\", () => this.open());\r\n\t}\r\n\r\n\ttriggerShowEvent() {\r\n\t\t$(document).trigger(\"ccs.logo-shown\", {\r\n\t\t\tentryId: this.popupId\r\n\t\t});\r\n\r\n\t\tthis.hoverOpenTime = new Date().getTime();\r\n\t\tthis.isPopupOpened = true;\r\n\r\n\t\tconst clientParams = {\r\n\t\t\tAction: \"hover\"\r\n\t\t};\r\n\r\n\t\tthis.dispatchEvent(clientParams);\r\n\t}\r\n\r\n\ttriggerHideEvent() {\r\n\t\t$(document).trigger(\"ccs.logo-hidden\", {\r\n\t\t\tentryId: this.popupId\r\n\t\t});\r\n\r\n\t\tconst hoverTime = Math.ceil((new Date().getTime() - this.hoverOpenTime) / 1000);\r\n\t\tconst clientParams = {\r\n\t\t\tAction: \"hover-time\",\r\n\t\t\tQty: hoverTime\r\n\t\t};\r\n\r\n\t\tthis.isPopupOpened = false;\r\n\t\tthis.dispatchEvent(clientParams);\r\n\t}\r\n\r\n\tdispatchEvent(clientParams) {\r\n\t\tccs_cc_log.dispatchEvent(this.logEvent, clientParams);\r\n\t}\r\n\r\n\topen() {\r\n\t\tconst event = $.Event(\"ccsLogoOpen\");\r\n\r\n\t\tthis.$icon.trigger(event);\r\n\r\n\t\tif (event.isDefaultPrevented()) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tif (this.hasIframe) {\r\n\t\t\tif (this.showLoadingIndicator) {\r\n\t\t\t\tthis.showLoading();\r\n\t\t\t}\r\n\r\n\t\t\tthis.toggleIframeSrc();\r\n\t\t}\r\n\r\n\t\tthis.openPopup();\r\n\t\tthis.triggerShowEvent();\r\n\t}\r\n\r\n\tclose() {\r\n\t\tthis.$icon.trigger(\"ccsLogoClose\");\r\n\r\n\t\tif (this.hasIframe) {\r\n\t\t\tthis.hideLoading();\r\n\t\t\tthis.toggleIframeSrc();\r\n\t\t}\r\n\r\n\t\tthis.closePopup();\r\n\t\tthis.triggerHideEvent();\r\n\t}\r\n\r\n\ttoggleIframeSrc() {\r\n\t\tconst $iframe = this.$popup.find(\"iframe\");\r\n\t\tconst $iframeContainer = $iframe.parent();\r\n\r\n\t\tvar src = !$iframe.src\r\n\t\t\t? $iframe.attr(hoverUrlAttr)\r\n\t\t\t: \"about:blank\";\r\n\r\n\t\tvar displayMode = $iframe.attr(displayModeAttr);\r\n\t\tif (displayMode === \"Mobile\") {\r\n\t\t\tsrc += \"&mobile=1\";\r\n\t\t}\r\n\r\n\t\t$iframe.detach();\r\n\t\t$iframe.attr(\"src\", src);\r\n\t\t$iframe.appendTo($iframeContainer);\r\n\t}\r\n\r\n\tshowLoading() {\r\n\t\tconst $loading = this.$popup.find(loadingSelector);\r\n\r\n\t\tthis.showIndicatorTimeout = setTimeout(() => {\r\n\t\t\tthis.isIndicatorShown = true;\r\n\t\t\t$loading.show();\r\n\t\t}, 1000);\r\n\t}\r\n\r\n\thideLoading() {\r\n\t\tif (!this.isIndicatorShown) {\r\n\t\t\tclearTimeout(this.showIndicatorTimeout);\r\n\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tthis.isIndicatorShown = false;\r\n\r\n\t\tthis.$popup\r\n\t\t\t.find(loadingSelector)\r\n\t\t\t.hide();\r\n\t}\r\n\r\n\topenPopup() { }\r\n\r\n\tclosePopup() { }\r\n\r\n\tresize() { }\r\n}\r\n","import $ from \"jquery\";\r\n\r\nconst pageScrollWidth = 16,\r\n\tarrowHalfWidth = 12;\r\n\r\nconst directionClass = {\r\n\ttop: \"ccs-logo-ls-popup-top\",\r\n\tbottom: \"ccs-logo-ls-popup-bottom\",\r\n\tleft: \"ccs-logo-ls-popup-left\",\r\n\tright: \"ccs-logo-ls-popup-right\"\r\n};\r\n\r\nexport default class PositionController {\r\n\tconstructor($icon, $popup, hoverDirection) {\r\n\t\tthis.$popup = $popup;\r\n\t\tthis.$icon = $icon;\r\n\r\n\t\tthis.hoverDirection = hoverDirection;\r\n\t}\r\n\r\n\tinit() {\r\n\t\tthis.collectScreenValues();\r\n\t\tthis.clearHoverStyles();\r\n\r\n\t\tthis.$popup\r\n\t\t\t.css({\r\n\t\t\t\ttop: \"-99999px\",\r\n\t\t\t\tleft: \"-99999px\"\r\n\t\t\t})\r\n\t\t\t.show();\r\n\r\n\t\tthis.guessHoverDirection();\r\n\r\n\t\tconst hoverPosition = this.hoverDirection === \"left\" || this.hoverDirection === \"right\"\r\n\t\t\t? this.getHoverPositionOnHorizontalAxis()\r\n\t\t\t: this.getHoverPositionOnVerticalAxis();\r\n\r\n\t\tthis.$popup.css({\r\n\t\t\ttop: hoverPosition.Top,\r\n\t\t\tleft: hoverPosition.Left,\r\n\t\t\tvisibility: \"visible\",\r\n\t\t\tbackgroundPosition: hoverPosition.arrowBgPositionX + \" \" + hoverPosition.arrowBgPositionY\r\n\t\t});\r\n\t}\r\n\r\n\tcollectScreenValues() {\r\n\t\tconst values = {};\r\n\r\n\t\tconst width = this.$icon.outerWidth();\r\n\t\tconst height = this.$icon.outerHeight();\r\n\t\tconst iconSizeBox = this.$icon[0].getBoundingClientRect();\r\n\r\n\t\tvalues.icon = {\r\n\t\t\tViewportTop: iconSizeBox.top,\r\n\t\t\tViewportLeft: iconSizeBox.left,\r\n\t\t\tWidth: width,\r\n\t\t\tHeight: height,\r\n\t\t\tHalfWidth: Math.ceil(width / 2),\r\n\t\t\tHalfHeight: Math.ceil(height / 2)\r\n\t\t};\r\n\r\n\t\tconst $w = $(window);\r\n\t\tvalues.viewport = {\r\n\t\t\tWidth: window.innerWidth || $w.width(),\r\n\t\t\tHeight: window.innerHeight || $w.height(),\r\n\t\t\tScrollTop: $w.scrollTop(),\r\n\t\t\tScrollLeft: $w.scrollLeft()\r\n\t\t};\r\n\t\tvalues.distanceFromIconBound = {\r\n\t\t\tLeft: values.icon.ViewportLeft,\r\n\t\t\tRight: values.viewport.Width - values.icon.ViewportLeft - values.icon.Width,\r\n\t\t\tTop: values.icon.ViewportTop,\r\n\t\t\tBottom: values.viewport.Height - values.icon.ViewportTop - values.icon.Height\r\n\t\t};\r\n\r\n\t\tvalues.distanceFromIconCenter = {\r\n\t\t\tLeft: values.distanceFromIconBound.Left + values.icon.HalfWidth,\r\n\t\t\tRight: values.distanceFromIconBound.Right + values.icon.HalfWidth,\r\n\t\t\tTop: values.distanceFromIconBound.Top + values.icon.HalfHeight,\r\n\t\t\tBottom: values.distanceFromIconBound.Bottom + values.icon.HalfHeight\r\n\t\t};\r\n\r\n\t\tthis.screenValues = values;\r\n\t}\r\n\r\n\tclearHoverStyles() {\r\n\t\tthis.$popup\r\n\t\t\t.removeAttr(\"style\")\r\n\t\t\t.removeClass(directionClass.top)\r\n\t\t\t.removeClass(directionClass.bottom)\r\n\t\t\t.removeClass(directionClass.left)\r\n\t\t\t.removeClass(directionClass.right);\r\n\t}\r\n\r\n\tguessHoverDirection() {\r\n\t\tconst $hover = this.$popup,\r\n\t\t\tscreenValues = this.screenValues;\r\n\r\n\t\tconst distanceFromIconBound = screenValues.distanceFromIconBound;\r\n\t\tconst viewport = screenValues.viewport;\r\n\t\tconst icon = screenValues.icon;\r\n\r\n\t\tlet hoverWidth;\r\n\t\tlet hoverDirection = this.hoverDirection || \"right\";\r\n\r\n\t\tif (hoverDirection === \"left\" || hoverDirection === \"right\") {\r\n\t\t\t// Apply direction class in order to get proper hover width.\r\n\t\t\t$hover.addClass(directionClass.left);\r\n\t\t\thoverWidth = $hover.outerWidth();\r\n\r\n\t\t\t// Check distance to Left and Right\r\n\t\t\tconst suitsToLeft = distanceFromIconBound.Left + viewport.ScrollLeft >= hoverWidth;\r\n\t\t\tconst suitsToRight = distanceFromIconBound.Right >= hoverWidth + pageScrollWidth;\r\n\r\n\t\t\t// If the hover can't be placed on horizontal direction we will try place it on the top direction.\r\n\t\t\tif (!suitsToLeft && !suitsToRight) {\r\n\t\t\t\thoverDirection = \"top\";\r\n\t\t\t\t$hover.removeClass(directionClass.left);\r\n\t\t\t\t$hover.addClass(directionClass.top);\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\t// apply direction class in order to get proper hover height.\r\n\t\t\t$hover.addClass(directionClass.top);\r\n\r\n\t\t\tconst hoverHeight = $hover.outerHeight();\r\n\t\t\thoverWidth = $hover.outerWidth();\r\n\r\n\t\t\tconst isScrollVisible = document.body.offsetHeight >= viewport.Height;\r\n\r\n\t\t\t//Check the availability of space at the top and bottom to display the Hover\r\n\t\t\tconst suitsToTop = hoverHeight <= distanceFromIconBound.Top + viewport.ScrollTop;\r\n\t\t\tconst suitsToBottom = isScrollVisible\r\n\t\t\t\t? hoverHeight >= viewport.ScrollTop - icon.ViewportTop - icon.Height\r\n\t\t\t\t: hoverHeight <= viewport.Height - distanceFromIconBound.Top - icon.HalfHeight;\r\n\r\n\t\t\t//Check whether you can display the hover right or left\r\n\t\t\tconst suitsToHorizontalDirection = (distanceFromIconBound.Left - arrowHalfWidth) > hoverWidth\r\n\t\t\t\t|| (distanceFromIconBound.Right - arrowHalfWidth) > hoverWidth;\r\n\r\n\t\t\t//If the hover can't be placed on vertical direction and can be placed on horizontal direction\r\n\t\t\t//or the center of the icon is outside the right edge of the screen\r\n\t\t\t//or the center of the icon is outside the left edge of the screen\r\n\t\t\tif (!suitsToTop && !suitsToBottom && suitsToHorizontalDirection\r\n\t\t\t\t|| (screenValues.distanceFromIconCenter.Right - pageScrollWidth) <= 0\r\n\t\t\t\t|| screenValues.distanceFromIconCenter.Left <= 0) {\r\n\t\t\t\thoverDirection = \"right\";\r\n\t\t\t\t$hover.removeClass(directionClass.top);\r\n\t\t\t\t$hover.addClass(directionClass.left);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.hoverDirection = hoverDirection;\r\n\t}\r\n\r\n\tgetHoverPositionOnHorizontalAxis() {\r\n\t\tconst distanceFromIconBound = this.screenValues.distanceFromIconBound;\r\n\t\tconst distanceFromIconCenter = this.screenValues.distanceFromIconCenter;\r\n\t\tconst viewport = this.screenValues.viewport;\r\n\t\tconst icon = this.screenValues.icon;\r\n\r\n\t\tconst hoverWidth = this.$popup.outerWidth();\r\n\t\tconst hoverHeight = this.$popup.outerHeight();\r\n\t\tconst hoverHalfHeight = Math.ceil(hoverHeight / 2);\r\n\r\n\t\tlet hoverDocumentTop;\r\n\t\tlet hoverDocumentLeft;\r\n\t\tlet arrowBgPositionX = \"100%\";\r\n\r\n\t\t// Distance to Top and Bottom border is enough\r\n\t\tif (distanceFromIconCenter.Top >= hoverHalfHeight && distanceFromIconCenter.Bottom >= hoverHalfHeight) {\r\n\t\t\thoverDocumentTop = viewport.ScrollTop + icon.ViewportTop + icon.HalfHeight - hoverHalfHeight;\r\n\t\t\t// Limiter adjustment top ( If the center of the icon is outside the top of the screen )\r\n\t\t} else if (distanceFromIconCenter.Top >= viewport.Height - icon.HalfHeight && distanceFromIconCenter.Top >= hoverHeight) {\r\n\t\t\thoverDocumentTop = viewport.ScrollTop + icon.ViewportTop - hoverHeight + icon.HalfHeight;\r\n\t\t\t// Limiter adjustment bottom ( If the center of the icon is outside the bottom of the screen)\r\n\t\t} else if (distanceFromIconCenter.Top <= 0) {\r\n\t\t\thoverDocumentTop = viewport.ScrollTop + distanceFromIconCenter.Top;\r\n\t\t\t// Distance to Top border is enough\r\n\t\t} else if (distanceFromIconCenter.Top >= hoverHeight) {\r\n\t\t\thoverDocumentTop = viewport.ScrollTop + viewport.Height - hoverHeight;\r\n\t\t} else {\r\n\t\t\thoverDocumentTop = viewport.ScrollTop;\r\n\t\t}\r\n\r\n\t\tconst hoverVerticalMiddle = hoverDocumentTop + hoverHalfHeight;\r\n\t\tconst iconVerticalMiddle = viewport.ScrollTop + icon.ViewportTop + icon.HalfHeight;\r\n\t\tconst verticalMiddleDiff = hoverVerticalMiddle - iconVerticalMiddle;\r\n\r\n\t\tconst arrowBgPositionY = `${hoverHalfHeight - verticalMiddleDiff - arrowHalfWidth}px`;\r\n\r\n\t\tconst suitsToLeft = hoverWidth <= distanceFromIconBound.Left + viewport.ScrollLeft;\r\n\t\tconst suitsToRight = hoverWidth <= distanceFromIconBound.Right;\r\n\r\n\t\t// If there is no place from left and on the right there = true\r\n\t\t// If you have the right place, and hoverDirection === \"right = true\r\n\t\t// If there is no place from left and hoverDirection === \"right = true\r\n\t\tif (!suitsToLeft && suitsToRight\r\n\t\t\t|| suitsToRight && this.hoverDirection === \"right\"\r\n\t\t\t|| !suitsToLeft && this.hoverDirection === \"right\") {\r\n\t\t\tarrowBgPositionX = \"0%\";\r\n\r\n\t\t\tthis.$popup.removeClass(directionClass.left);\r\n\t\t\tthis.$popup.addClass(directionClass.right);\r\n\r\n\t\t\thoverDocumentLeft = viewport.ScrollLeft + icon.ViewportLeft + icon.Width;\r\n\t\t} else {\r\n\t\t\thoverDocumentLeft = viewport.ScrollLeft + icon.ViewportLeft - hoverWidth;\r\n\t\t}\r\n\r\n\t\treturn {\r\n\t\t\tTop: hoverDocumentTop,\r\n\t\t\tLeft: hoverDocumentLeft,\r\n\t\t\tarrowBgPositionX: arrowBgPositionX,\r\n\t\t\tarrowBgPositionY: arrowBgPositionY\r\n\t\t};\r\n\t}\r\n\r\n\tgetHoverPositionOnVerticalAxis() {\r\n\t\tconst distanceFromIconBound = this.screenValues.distanceFromIconBound;\r\n\t\tconst distanceFromIconCenter = this.screenValues.distanceFromIconCenter;\r\n\t\tconst viewport = this.screenValues.viewport;\r\n\t\tconst icon = this.screenValues.icon;\r\n\r\n\t\tconst hoverWidth = this.$popup.outerWidth();\r\n\t\tconst hoverHeight = this.$popup.outerHeight();\r\n\t\tconst hoverHalfWidth = Math.ceil(hoverWidth / 2);\r\n\r\n\t\tlet hoverDocumentTop;\r\n\t\tlet hoverDocumentLeft;\r\n\t\tlet arrowBgPositionY = \"100%\";\r\n\r\n\t\t// Distance to Left and Right border is enough\r\n\t\tif (distanceFromIconCenter.Left >= hoverHalfWidth && distanceFromIconCenter.Right >= hoverHalfWidth) {\r\n\t\t\thoverDocumentLeft = viewport.ScrollLeft + icon.ViewportLeft + icon.HalfWidth - hoverHalfWidth;\r\n\t\t\t// If there is space on the left\r\n\t\t} else if (distanceFromIconCenter.Left >= hoverHalfWidth) {\r\n\t\t\thoverDocumentLeft = viewport.ScrollLeft + viewport.Width - (hoverWidth + pageScrollWidth);\r\n\t\t} else {\r\n\t\t\thoverDocumentLeft = viewport.ScrollLeft;\r\n\t\t}\r\n\r\n\t\tconst hoverHorizontalMiddle = hoverDocumentLeft + hoverHalfWidth;\r\n\t\tconst iconHorizontalMiddle = viewport.ScrollLeft + icon.ViewportLeft + icon.HalfWidth;\r\n\t\tconst horizontalMiddleDiff = hoverHorizontalMiddle - iconHorizontalMiddle;\r\n\r\n\t\tconst arrowBgPositionX = `${hoverHalfWidth - horizontalMiddleDiff - arrowHalfWidth}px`;\r\n\t\t// Check distance to Top\r\n\t\tconst suitsToTop = hoverHeight <= distanceFromIconBound.Top + viewport.ScrollTop;\r\n\r\n\t\t// If there is no space at the top or hoverDirection = \"bottom\"\r\n\t\tif (!suitsToTop || this.hoverDirection === \"bottom\") {\r\n\t\t\tarrowBgPositionY = \"0%\";\r\n\r\n\t\t\tthis.$popup.removeClass(directionClass.top);\r\n\t\t\tthis.$popup.addClass(directionClass.bottom);\r\n\r\n\t\t\thoverDocumentTop = viewport.ScrollTop + icon.ViewportTop + icon.Height;\r\n\t\t} else {\r\n\t\t\thoverDocumentTop = viewport.ScrollTop + icon.ViewportTop - hoverHeight;\r\n\t\t}\r\n\r\n\t\treturn {\r\n\t\t\tTop: hoverDocumentTop,\r\n\t\t\tLeft: hoverDocumentLeft,\r\n\t\t\tarrowBgPositionX: arrowBgPositionX,\r\n\t\t\tarrowBgPositionY: arrowBgPositionY\r\n\t\t};\r\n\t}\r\n}","import $ from \"jquery\";\r\nimport Program from \"./Program\";\r\nimport PositionController from \"./PositionController\";\r\n\r\nconst closeButtonSelector = \"div[data-logo-hover-close-button]\";\r\n\r\nexport default class Hover extends Program {\r\n\tconstructor() {\r\n\t\tsuper(...arguments);\r\n\r\n\t\tthis.$popup.appendTo(\"body\");\r\n\r\n\t\tthis.positionController =\r\n\t\t\tnew PositionController(this.$icon, this.$popup, this.settings.hoverDirection);\r\n\r\n\t\tthis.initIconEvents();\r\n\t\tthis.initHoverEvents();\r\n\t\tthis.initLoadingIndicator();\r\n\t}\r\n\r\n\tinitIconEvents() {\r\n\t\tif (this.settings.openHoverOnClick) {\r\n\t\t\tthis.initIconClick();\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tthis.$icon.on(\"mouseenter\", () => this.onIconMouseEnter());\r\n\r\n\t\tthis.$icon.on(\"keypress\", (e) => {\r\n\t\t\tif (e.keyCode === 13)\r\n\t\t\t\tthis.onIconMouseEnter();\r\n\t\t});\r\n\r\n\t\tif (this.settings.closeOnMouseLeave) {\r\n\t\t\tthis.$icon.on(\"mouseleave\", () => this.onIconMouseLeave());\r\n\t\t}\r\n\t}\r\n\r\n\tonIconMouseEnter() {\r\n\t\tif (this.isPopupOpened && this.settings.closeOnMouseLeave) {\r\n\t\t\tclearTimeout(this.closingTimeoutId);\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tif (!this.settings.openHoverOnClick) {\r\n\t\t\tthis.openingTimeoutId = setTimeout(() => this.open(),\r\n\t\t\t\tthis.settings.hoverOpenDelay);\r\n\t\t}\r\n\t}\r\n\r\n\tonIconMouseLeave() {\r\n\t\tif (!this.isPopupOpened) {\r\n\t\t\tclearTimeout(this.openingTimeoutId);\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tthis.closingTimeoutId = setTimeout(() => this.close(),\r\n\t\t\tthis.settings.hoverCloseDelay);\r\n\t}\r\n\r\n\tinitHoverEvents() {\r\n\t\tvar self = this;\r\n\t\t$(this.$popup.parent()).on(\"keydown\", function (e) {\r\n\t\t\tif (e.keyCode === 27) {\r\n\t\t\t\tself.onHoverMouseLeave();\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tif (!this.settings.closeOnMouseLeave) {\r\n\t\t\tthis.$popup.on(\"click\",\r\n\t\t\t\tcloseButtonSelector,\r\n\t\t\t\t() => this.close());\r\n\r\n\t\t\tthis.$popup.on(\"keypress\",\r\n\t\t\t\tcloseButtonSelector, (e) => {\r\n\t\t\t\t\tif (e.keyCode === 13) {\r\n\t\t\t\t\t\tthis.close();\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tthis.$popup.on({\r\n\t\t\tmouseenter: () => this.onHoverMouseEnter(),\r\n\t\t\tmouseleave: () => this.onHoverMouseLeave()\r\n\t\t});\r\n\t}\r\n\r\n\tonHoverMouseEnter() {\r\n\t\tif (!this.isPopupOpened) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tclearTimeout(this.closingTimeoutId);\r\n\t}\r\n\r\n\tonHoverMouseLeave() {\r\n\t\tthis.closingTimeoutId = setTimeout(\r\n\t\t\t() => this.close(),\r\n\t\t\tthis.settings.hoverCloseDelay);\r\n\t}\r\n\r\n\topenPopup() {\r\n\t\tsuper.openPopup();\r\n\t\tthis.resize();\r\n\t\tthis.$popup.show();\r\n\t}\r\n\r\n\tclosePopup() {\r\n\t\tthis.$popup.hide();\r\n\t}\r\n\r\n\tresize() {\r\n\t\tthis.positionController.init();\r\n\t\tif (this.hasIframe) {\r\n\t\t\tconst $popup = this.$popup;\r\n\t\t\tconst $iframe = $popup.find(\"iframe\");\r\n\r\n\t\t\t// get initial width. If not set then set to data-width attribute\r\n\t\t\tconst originalWidth = $iframe.data(\"width\") || $iframe.data(\"width\", $iframe.width()).data(\"width\");\r\n\r\n\t\t\tconst viewPortWidth = $(window).width() - $iframe.position().left - 5;\r\n\r\n\t\t\tif (originalWidth > viewPortWidth) {\r\n\t\t\t\t$iframe.css(\"width\", viewPortWidth + \"px\");\r\n\t\t\t} else {\r\n\t\t\t\t$iframe.css(\"width\", \"\");\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tinitLoadingIndicator() {\r\n\t\twindow.addEventListener(\"message\", (event) => {\r\n\t\t\tthis.messageHandler(event);\r\n\t\t}, false);\r\n\t}\r\n\r\n\tmessageHandler(event) {\r\n\t\tlet isMessageReceived = true;\r\n\t\tlet data = {};\r\n\r\n\t\ttry {\r\n\t\t\tdata = $.parseJSON(event.data);\r\n\t\t\tif (!data.hoverLoad) {\r\n\t\t\t\tisMessageReceived = false;\r\n\t\t\t}\r\n\t\t} catch (e) {\r\n\t\t\tisMessageReceived = false;\r\n\t\t}\r\n\r\n\t\tif (!isMessageReceived)\r\n\t\t\treturn;\r\n\r\n\t\tthis.hideLoading(data.hoverLoad);\r\n\t}\r\n}","import $ from \"jquery\";\r\nimport require from \"require\";\r\nimport Program from \"./Program\";\r\n\r\nexport default class Lightbox extends Program {\r\n\tconstructor() {\r\n\t\trequire(\"Fancybox\");\r\n\r\n\t\tsuper(...arguments);\r\n\r\n\t\tthis.config = {\r\n\t\t\ttouch: false,\r\n\t\t\tsmallBtn: false,\r\n\t\t\tbaseClass: \"ccs-logo-lightbox\",\r\n\t\t\tbeforeShow: () => this.resize(),\r\n\t\t\tafterClose: () => this.close()\r\n\t};\r\n\r\n\t\tthis.param = this.$icon.attr(\"data-logo-param\");\r\n\r\n\t\tif (!this.param) {\r\n\t\t\tthis.initMobileConfig();\r\n\t\t} else {\r\n\t\t\tthis.initImageConfig();\r\n\t\t}\r\n\r\n\t\tthis.initIconClick();\r\n\t}\r\n\r\n\tinitImageConfig() {\r\n\t\tthis.config.type = \"image\";\r\n\t\tthis.config.src = this.param;\r\n\t}\r\n\r\n\tinitMobileConfig() {\r\n\t\tthis.config.type = \"html\";\r\n\t\tthis.config.content = this.$popup;\r\n\r\n\t\tthis.resize = this.resizeMobile;\r\n\r\n\t\tthis.maxWidth = this.$popup.outerWidth(true);\r\n\t}\r\n\r\n\tresizeMobile() {\r\n\t\tif (this.maxWidth !== 0 && window.outerWidth > this.maxWidth) {\r\n\t\t\tthis.$popup.outerWidth(this.maxWidth);\r\n\t\t} else {\r\n\t\t\tthis.$popup.outerWidth(\"auto\");\r\n\t\t}\r\n\t}\r\n\r\n\topenPopup() {\r\n\t\t$.fancybox.open(this.config);\r\n\t}\r\n}","import $ from \"jquery\";\r\nimport Hover from \"./Hover\";\r\nimport Lightbox from \"./Lightbox\";\r\n\r\nconst logEventAttr = \"data-logo-log-event\",\r\n\ticonSelector = \"img[data-logo-icon=true]\",\r\n\thoverIdAttr = \"data-logo-hover-id\",\r\n\tembeddingTypeAttr = \"data-logo-embedding-type\",\r\n\tshowLoadingIndicatorAttr = \"data-logo-show-loading-indicator\",\r\n\tdisplayModeAttr = \"data-logo-display-mode\";\r\n\r\nexport default class Service {\r\n\tconstructor(settings, $ep) {\r\n\t\tthis.icons = $ep.find(iconSelector);\r\n\r\n\t\tthis.settings = settings;\r\n\r\n\t\tthis.create();\r\n\t\tthis.initEventsListener();\r\n\t}\r\n\r\n\tcreate() {\r\n\t\tthis.icons\r\n\t\t\t.each((index, logoIcon) => {\r\n\t\t\t\tconst $logoIcon = $(logoIcon);\r\n\r\n\t\t\t\tconst logoId = $logoIcon.attr(\"id\");\r\n\t\t\t\tconst popupId = $logoIcon.attr(hoverIdAttr);\r\n\r\n\t\t\t\tconst logo = {\r\n\t\t\t\t\tlogoId: logoId,\r\n\t\t\t\t\tpopupId: popupId,\r\n\t\t\t\t\trefs: {\r\n\t\t\t\t\t\t$icon: $logoIcon,\r\n\t\t\t\t\t\t$popup: $(`#${popupId}`)\r\n\t\t\t\t\t},\r\n\t\t\t\t\thasIframe: $logoIcon.attr(embeddingTypeAttr) === \"iframe\",\r\n\t\t\t\t\thoverDirection: this.settings.hoverDirection,\r\n\t\t\t\t\tshowLoadingIndicator: $logoIcon.attr(showLoadingIndicatorAttr) === \"true\",\r\n\t\t\t\t\tlogEvent: $logoIcon.attr(logEventAttr)\r\n\t\t\t\t};\r\n\r\n\t\t\t\tconst Instance = this.getInstance($logoIcon);\r\n\r\n\t\t\t\t$logoIcon.data(\"ccsLogo\", new Instance(logo, this.settings));\r\n\t\t\t});\r\n\t}\r\n\r\n\tgetInstance($icon) {\r\n\t\tconst displayMode = $icon.attr(displayModeAttr).toLowerCase();\r\n\r\n\t\treturn displayMode === \"hover\"\r\n\t\t\t? Hover\r\n\t\t\t: Lightbox;\r\n\t}\r\n\r\n\tinitEventsListener() {\r\n\t\tthis.icons\r\n\t\t\t.on(\"ccsLogoOpen\",\r\n\t\t\t\t(event) => {\r\n\t\t\t\t\tif (this.openedLogo) {\r\n\t\t\t\t\t\tevent.preventDefault();\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tconst instance = $(event.currentTarget).data(\"ccsLogo\");\r\n\r\n\t\t\t\t\tthis.openedLogo = instance;\r\n\t\t\t\t})\r\n\t\t\t.on(\"ccsLogoClose\", () => this.openedLogo = null);\r\n\r\n\t\t$(window).on(\"resize orientationchange\",\r\n\t\t\t() => {\r\n\t\t\t\tif (this.openedLogo) {\r\n\t\t\t\t\tthis.openedLogo.resize();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t);\r\n\t}\r\n}","import $ from \"jquery\";\r\nimport Service from \"./Service\";\r\n\r\nexport default function (entryPointId, settings) {\r\n\tconst $ep = $(`#${entryPointId}`);\r\n\r\n\tif ($ep.length === 0) {\r\n\t\treturn;\r\n\t}\r\n\r\n\tif (ccs_util.isMobile()) {\r\n\t\tsettings.openHoverOnClick = true;\r\n\t\tsettings.closeOnMouseLeave = false;\r\n\t}\r\n\r\n\tconst instance = new Service(settings, $ep);\r\n\r\n\t$ep.data(\"logoService\", instance);\r\n}\r\n"],"sourceRoot":"../../.."}