define("superman/components/content-info",["require","exports"],function(require,_exports){"use strict";Object.defineProperty(_exports,"__esModule",{value:true});_exports.ContentInfo=void 0;function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function")}}function _defineProperties(target,props){for(var i=0;i-1}_createClass(ContentInfo,[{key:"getScreenWidth",value:function getScreenWidth(){var screenWidth=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth ;return screenWidth}},{key:"divideList",value:function divideList(){var originWidthList=this.originWidthList;var screenWidth=this.getScreenWidth()-120;var totalWidth=0;for(var i=0;iscreenWidth){this.index=i;this.showTip=true;break}else{this.index=100;this.showTip=false}}}},{key:"renderOriginList",value:function renderOriginList(){var divideIndex=this.index ;var originList=this.originList;originList.each(function(index,element){if(index>=divideIndex){$(element).hide()}else{$(element).show()}})}},{key:"renderRestList",value:function renderRestList(){var divideIndex=this.index;var cloneInfoList=this.cloneInfoList;var infoTip=$(".tip-hover-panel");cloneInfoList.each(function(index,element){if(index');var openTriggle=$('');var tipContainer=$('
');var totalWidth=0;var i=widthList.length-1||0;var tmpTipList=[];while(i>=0){var widthItem=widthList[i].outerWidth;if(widthItem<=400){ totalWidth+=widthItem;if(totalWidth>470||i===0){(function(){totalWidth=0;var tipWrapper=$('
');tmpTipList.forEach(function(element){tipWrapper.prepend(element)});tipContainer.prepend(tipWrapper);tmpTipList=[];i===0&&i--})()}else{var tipItem=cloneInfoList[i];$(tipItem).addClass("tip-item");tmpTipList.push(tipItem);i--}}else{if(totalWidth!==0){(function(){totalWidth=0;var tipWrapper=$('
');tmpTipList.forEach(function(element){ tipWrapper.prepend(element)});tipContainer.prepend(tipWrapper);tmpTipList=[]})()}var tipWrapper=$('
');var _tipItem=cloneInfoList[i];$(_tipItem).addClass("tip-item");tipWrapper.prepend(_tipItem);tipContainer.prepend(tipWrapper);i--}}var hoverPanel=$('
');hoverPanel.append(tipContainer);openTriggle.append(hoverPanel);openTriggle.on("mouseover",function(){hoverPanel.show()});openTriggle.on("mouseleave",function(){hoverPanel.hide()}) ;var bottomLayerBar=this.bottomLayer.find(".s-bottom-layer-content");if(bottomLayerBar){bottomLayerBar.append(accessibilityIcon);bottomLayerBar.append(openTriggle)}this.renderRestList()}},{key:"render",value:function render(firstPaint){this.divideList();this.renderOriginList();var showTip=this.showTip;if(firstPaint){showTip&&this.createdTip();this.bottomLayer.css({visibility:"visible",width:"100%"})}else{var hasTip=this.hasTip;var contentInfoTip=$(".open-content-info");!hasTip&&this.createdTip() ;if(showTip){contentInfoTip.show();this.renderRestList()}else{contentInfoTip.hide()}}}},{key:"safariFix",value:function safariFix(){var _this=this;var width=window.screen.width;setTimeout(function(){var windowWidth=_this.getScreenWidth();var boxWidth=_this.bottomLayer.width();var res=width<=960&&boxWidth&&windowWidth-boxWidth>=10;if(res){_this.bottomLayer.css({width:windowWidth+"px"})}else{_this.bottomLayer.css({width:"100%"})}},800)}},{key:"reRender",value:function reRender(){if(this.isSafari){ this.safariFix()}this.debounceUse()}},{key:"destroy",value:function destroy(){var _this2=this;window.removeEventListener("resize",function(){return _this2.reRenderView()})}},{key:"init",value:function init(){var _this3=this;this.render(true);if(this.isSafari){this.safariFix()}this.reRenderView=this.reRender.bind(this);F.use("superman:lib/utils",function(util){_this3.debounceUse=util.debounce(_this3.render,600);window.addEventListener("resize",function(){return _this3.reRenderView()})})}}]) ;return ContentInfo}();_exports.ContentInfo=ContentInfo});