"use strict";define("mobileActionsMenu/bi/events.json",[],function(){return{MOBILE_ACTION_BAR_TOGGLE:{eventId:370,adapter:"ugc-viewer",params:{site_id:"site_id",status:"status"}},MOBILE_ACTION_BAR_USAGE:{eventId:371,adapter:"ugc-viewer",params:{site_id:"site_id",button_name:"button_name"}}}}),define("mobileActionsMenu/components/mobileActionsMenuItem",["react","utils"],function(e,t){return e.createClass({displayName:"MobileActionsMenuItem",statics:{useSantaTypes:!0},propTypes:{styleId:e.PropTypes.string.isRequired,target:e.PropTypes.string.isRequired,href:e.PropTypes.string.isRequired,label:e.PropTypes.string.isRequired,isSelected:e.PropTypes.bool,level:e.PropTypes.number,hasChildren:e.PropTypes.bool,"data-anchor":e.PropTypes.string,closeMenu:e.PropTypes.func,openPopup:e.PropTypes.func},render:function(){var i={};i[this.props.styleId+"_selected"]=this.props.isSelected,i[this.props.styleId+"_subItem"]=this.props.level>1,i[this.props.styleId+"_hasChildren"]=this.props.hasChildren;var s="#";return"page"===this.props.target?s=this.props.href:null===this.props.target&&(s=""),e.DOM.li({onClick:this.onItemClick},e.DOM.a({href:s,"data-anchor":this.props["data-anchor"],className:t.classNames(i)},this.props.level>1?"> "+this.props.label:this.props.label))},onItemClick:function(){"window"===this.props.target?this.props.openPopup(this.props.href):"page"===this.props.target&&this.props.closeMenu()}})}),define("mobileActionsMenu/aspects/MobileActionsMenuAspect",["lodash","core"],function(e,t){function i(t){var i=t.getSiteData(),s=e.get(i.getSiteMetaData(),"quickActions.configuration.quickActionsMenuEnabled",!1),o=!e.some(i.getPageData("masterPage").structure.mobileComponents,{id:"QUICK_ACTION_BAR"});if(i.isMobileDevice()&&t.getRenderFlag("renderMobileActionMenu")&&s&&o)return{id:"MOBILE_ACTIONS_MENU",skin:"wysiwyg.viewer.skins.mobile.MobileActionsMenuSkin",componentType:"wysiwyg.viewer.components.MobileActionsMenu",styleId:"mobileActionsMenu",layout:{position:"static"}}}function s(e){var t=e.getSiteData(),s=i(e);return s?[{structure:s,props:{userColorScheme:t.rendererModel.siteMetaData.quickActions.colorScheme}}]:null}function o(){}return o.prototype={getComponentsToRender:s},t.siteAspectsRegistry.registerSiteAspect("mobileActionsMenu",o),o}),define("mobileActionsMenu",["lodash","react","core","santaProps","mobileActionsMenu/bi/events.json","mobileActionsMenu/components/mobileActionsMenuItem","mobileActionsMenu/aspects/MobileActionsMenuAspect"],function(e,t,i,s,o,n){function r(t,i,s,o){function n(e,t){return a(t,i,e,s,o)}return e(t).filter("isVisibleMobile").reduce(function(t,i){var s=e(i.items).filter("isVisibleMobile").map(n.bind(null,2)).value();return t.concat([n(1,i)]).concat(s)},[])}function a(i,s,o,r,a){var p=i.link?i.link.render.href:null;return t.createElement(n,{label:i.label,href:p,target:p?"page":null,"data-anchor":e.get(i,"link.render.data-anchor"),closeMenu:a,level:o,hasChildren:i.items&&i.items.length>0,isSelected:"#"+s===i.link&&i.link.pageId,styleId:r})}function p(t,i,s){return e.map(t,function(e){return l(e.id,e.url,i,s)})}function l(e,i,s,o){return t.createElement(n,{label:c(e),href:i,target:"window",styleId:s,openPopup:o})}function c(e){return{facebook:"Facebook",twitter:"Twitter",pinterest:"Pinterest",google_plus:"Google+",tumblr:"Tumblr",blogger:"Blogger",linkedin:"LinkedIn",youtube:"YouTube",vimeo:"Vimeo",flickr:"Flickr","":""}[e]||e}return{displayName:"MobileActionsMenu",mixins:[i.compMixins.skinBasedComp],statics:{useSantaTypes:!0},propTypes:{userColorScheme:s.Types.RendererModel.siteMetaData.quickActions.colorScheme.isRequired,socialLinks:s.Types.RendererModel.siteMetaData.quickActions.socialLinks.isRequired,contactInfo:s.Types.RendererModel.siteMetaData.contactInfo.isRequired,configuration:s.Types.RendererModel.siteMetaData.quickActions.configuration.isRequired,getInvertedZoomRatio:s.Types.mobile.getInvertedZoomRatio.isRequired,siteMenuWithRender:s.Types.Menu.siteMenuWithRender.isRequired,currentUrlPageId:s.Types.Component.currentUrlPageId.isRequired,reportBI:s.Types.reportBI.isRequired,styleId:s.Types.Component.styleId.isRequired,siteId:s.Types.RendererModel.siteId.isRequired,openPopup:s.Types.popup.open.isRequired},getInitialState:function(){return{$display:"closed",$theme:this.props.userColorScheme||"dark",$list:"nolist",zoom:1}},componentDidLayout:function(){e.delay(function(){var e=this.props.getInvertedZoomRatio();this.setState({zoom:e})}.bind(this),1e3)},getSkinProperties:function(){var e={},i=this.props.siteMenuWithRender,s="pages"===this.state.$list?r(i,this.props.currentUrlPageId,this.props.styleId,this.onListCloseClick):[],o="social"===this.state.$list?p(this.props.socialLinks,this.props.styleId,this.props.openPopup):[],n=[];return this.props.configuration.navigationMenuEnabled&&n.push(t.DOM.li({className:this.props.styleId+"_navigation",onClick:this.onMenuItemClick.bind(this,"pages")},t.DOM.a())),this.props.configuration.phoneEnabled&&n.push(t.DOM.li({className:this.props.styleId+"_phone",onClick:this.onMenuItemClick.bind(this,"phone")},t.DOM.a())),this.props.configuration.emailEnabled&&n.push(t.DOM.li({className:this.props.styleId+"_email",onClick:this.onMenuItemClick.bind(this,"email")},t.DOM.a())),this.props.configuration.addressEnabled&&n.push(t.DOM.li({className:this.props.styleId+"_address",onClick:this.onMenuItemClick.bind(this,"address")},t.DOM.a())),this.props.configuration.socialLinksEnabled&&n.push(t.DOM.li({className:this.props.styleId+"_socialLinks",onClick:this.onMenuItemClick.bind(this,"social")},t.DOM.a())),0===n.length&&(e.display="none"),e.zoom=this.state.zoom,{"":{style:e},wrapper:{onSwipeUp:this.onTouchSwipeUp,onSwipeDown:this.onTouchSwipeDown,style:{className:"mobile-actions-menu-wrapper"}},knobContainer:{},knob:{onClick:this.onKnobClick},menuContainer:{children:t.DOM.ul({children:n}),style:{}},lists:{},listTitle:{children:"pages"===this.state.$list?"Pages":"See me on..."},pagesList:{children:t.DOM.ul({children:s})},socialList:{children:t.DOM.ul({children:o})},closeBtn:{onClick:this.onListCloseClick,onTouchEnd:this.onListCloseClick}}},componentWillReceiveProps:function(e){this.props.currentUrlPageId!==e.currentUrlPageId&&this.setState({$list:"nolist"})},onKnobClick:function(e){e.preventDefault(),e.stopPropagation(),this.props.reportBI(o.MOBILE_ACTION_BAR_TOGGLE,{site_id:this.props.siteId,status:"opened"!==this.state.$display}),this.setState({$display:"opened"===this.state.$display?"closed":"opened"})},onTouchSwipeUp:function(e){e.preventDefault(),e.stopPropagation(),"opened"!==this.state.$display&&this.setState({$display:"opened"})},onTouchSwipeDown:function(e){e.preventDefault(),e.stopPropagation(),"closed"!==this.state.$display&&this.setState({$display:"closed"})},onMenuItemClick:function(e,t){switch(t.preventDefault(),t.stopPropagation(),this.props.reportBI(o.MOBILE_ACTION_BAR_USAGE,{site_id:this.props.siteId,button_name:e}),e){case"pages":this.setState({$list:"pages"});break;case"address":window.location.href="http://maps.apple.com/?q="+this.props.contactInfo.address;break;case"phone":window.location.href="tel:"+this.props.contactInfo.phone;break;case"email":window.location.href="mailto:"+this.props.contactInfo.email;break;case"social":this.setState({$list:"social"})}},onListCloseClick:function(){return this.setState({$list:"nolist"}),!1}}}); //# sourceMappingURL=mobileActionsMenu.min.js.map