"use strict";define("stripColumnsContainer",["react","lodash","core","santaProps","mediaCommon","backgroundCommon"],function(t,i,e,r,o,s){function n(e){var r=i.sum(t.Children.map(e.children,function(t){var i=t.props.structure.id;return e.childrenData[i].width})),o=t.Children.map(e.children,function(t){var i=t.props.structure.id;return e.childrenData[i].width/r*100/100}),s=i.sum(o);return o[0]+=1-s,o}var p=e.compMixins;return{displayName:"StripColumnsContainer",mixins:[o.mediaLogicMixins.fill,p.skinBasedComp,s.mixins.backgroundDetectionMixin],propTypes:{style:r.Types.Component.style.isRequired,compProp:r.Types.Component.compProp,isMobileView:r.Types.isMobileView.isRequired,siteWidth:r.Types.siteWidth.isRequired,getScreenWidth:r.Types.getScreenWidth.isRequired,getScrollBarWidth:r.Types.getScrollBarWidth.isRequired,browser:r.Types.Browser.browser.isRequired,childrenData:r.Types.ColumnsContainer.childrenData.isRequired},statics:{useSantaTypes:!0,behaviors:o.mediaBehaviors.fill},componentDidLayout:function(){var t=this.props.getScrollBarWidth(),i=this.props.getScreenWidth(),e=this.lastScrollBarWidth!==t,r=this.lastScreenWidth!==i;this.props.isMobileView||!e&&!r||(this.lastScrollBarWidth=t,this.lastScreenWidth=i,this.registerReLayout(),this.forceUpdate())},getDefaultSkinName:function(){return"wysiwyg.viewer.skins.stripContainer.DefaultStripContainer"},getMobileSkinProperties:function(){var i=this.props.compProp.rowMargin,e=t.Children.map(this.props.children,function(e){var r={position:"absolute",top:i,height:this.props.childrenData[e.props.structure.id].height,left:0,width:320};i+=r.height+this.props.compProp.columnsMargin;var o={position:"absolute",overflow:"hidden",width:320,left:0,top:0,bottom:0};return e=t.cloneElement(e,{rootStyle:r,bgStyle:o})},this);return{"":{tagName:"section",style:{height:i-this.props.compProp.columnsMargin+this.props.compProp.rowMargin}},background:this.createFillLayers(),inlineContent:{children:e}}},getDesktopSkinProperties:function(){var e=this.props.siteWidth,r=this.props.getScreenWidth();this.lastScreenWidth=r;var o,s,p,a=n(this.props),l=a.length,h=this.props.compProp,c=e-h.columnsMargin*(l-1)-2*h.frameMargin,u=i.map(a,function(t){return c*t}),d=i.reduce(a,function(t,i){return t.push(t[t.length-1]+i),t},[0]),g=this.props.getScrollBarWidth();this.lastScrollBarWidth=g;var m,f=r&&r<=e;h.fullWidth&&!f?(m=1,s="(100vw - "+g+"px - "+2*h.siteMargin+"px)",o="(100vw - "+g+"px - "+(h.columnsMargin*(l-1)+2*(h.siteMargin+h.frameMargin))+"px)",p="("+e+"px - "+s+") / 2 + "+h.frameMargin+"px + "):(m=0,s=e+"px",o="("+(e-(h.columnsMargin*(l-1)+2*h.frameMargin))+"px)",p=h.frameMargin+"px + ");var S=t.Children.map(this.props.children,function(i,e){var r=a[e],s=i.props.structure.id,n=this.props.childrenData[s].alignment/100,l={position:"absolute",left:"calc("+o+" * "+(d[e]+r*n)+" + "+p+(e*h.columnsMargin-u[e]*n)+"px)",width:u[e],top:h.rowMargin,height:this.props.childrenData[s].height},c={position:"absolute",width:"calc("+o+" * "+r+" + "+m+"px)",left:"calc(("+o+" * "+r+" - "+u[e]+"px) * "+-n+" - "+m+"px)",top:0,bottom:0},g={position:"absolute",width:u[e],top:0,bottom:0,left:"calc((100% - "+u[e]+"px) * "+n+")"};return i=t.cloneElement(i,{rootStyle:l,bgStyle:c,inlineStyle:g})},this),y=this.getDesktopBalataProps(s,e);return{"":{tagName:"section"},background:this.createFillLayers(y),inlineContent:{children:S}}},getDesktopBalataProps:function(t,e){return i.assign({bgStyle:{top:0,bottom:0,left:"calc("+parseInt(e/2,10)+"px - ("+t+" / 2))",right:"calc("+parseInt(e/2,10)+"px + ("+t+" / 2))",width:"calc("+t+")"}},this.props)},getSkinProperties:function(){return this.props.isMobileView?this.getMobileSkinProperties():this.getDesktopSkinProperties()}}}); //# sourceMappingURL=stripColumnsContainer.min.js.map