define("video",["zepto","lodash","core","react","utils","reactDOM","santaProps"],function(a,b,c,d,e,f,g){"use strict";var h=c.compMixins;function i(a,b,c){if(c==="100%"){return"100%"}var d=k();var e=a?d[a].hMinSize:0;if(a==="YOUTUBE"&&b==="always_show"){e+=20}return Math.max(c,e)}function j(a,b){if(b==="100%"){return"100%"}var c=k();var d=a?c[a].wMinSize:0;return Math.max(b,d)}function k(){return{YOUTUBE:{url:"//www.youtube.com/embed/",getParams:l,hMinSize:200,wMinSize:200},VIMEO:{url:"//player.vimeo.com/video/",getParams:m,hMinSize:100,wMinSize:100},DAILYMOTION:{url:"//www.dailymotion.com/embed/video/",getParams:n,hMinSize:100,wMinSize:100}}}function l(a,b,c){var d=a.showControls;var e=false;var f=a.autoplay&&!e;var g=a.enablejsapi||0;var h=a.lightTheme;var i=a.loop;var j=a.showinfo;var k=b.videoId||"";return{wmode:"transparent",autoplay:f&&c?"1":"0",theme:h?"light":"dark",controls:d!=="always_hide"?"1":"0",autohide:d==="temp_show"?"1":"0",loop:i?"1":"0",showinfo:j?"1":"0",rel:"0",playlist:i?k:false,enablejsapi:g}}function m(a,b,c){return{autoplay:a.autoplay&&c,loop:a.loop,byline:a.showinfo,portrait:a.showinfo,title:a.showinfo}}function n(a,b,c){return{autoplay:a.autoplay&&c,"ui-start-screen-info":a.showinfo?"1":"0",controls:a.showControls==="temp_show"?"1":"0","sharing-enable":"0","ui-logo":"0"}}function o(a,c,d){var e=a.videoId;var f=a.videoType;if(!f||!e){return""}var g=k();var h=g[f];var i=h.getParams(c,a,d);return h.url+e+"?"+b.map(i,function(a,b){return b+"="+a}).join("&")}return{displayName:"Video",mixins:[h.skinBasedComp],statics:{useSantaTypes:true},propTypes:{isPlayingAllowed:g.Types.RenderFlags.isPlayingAllowed.isRequired,compData:g.Types.Component.compData.isRequired,compProp:g.Types.Component.compProp.isRequired,style:g.Types.Component.style.isRequired},componentWillMount:function(){this.canPlayVideo=this.props.isPlayingAllowed},componentDidUpdate:function(){if(this.canPlayVideo!==this.props.isPlayingAllowed){this.canPlayVideo=this.props.isPlayingAllowed;var b=a(f.findDOMNode(this.refs.videoFrame));var c=b.find("iframe")[0];c.src="";c.src=o(this.props.compData,this.props.compProp,this.props.isPlayingAllowed)}},getSkinProperties:function(){var a=i(this.props.compData.videoType,this.props.compProp.showControls,this.props.style.height);var b=j(this.props.compData.videoType,this.props.style.width);var c=o(this.props.compData,this.props.compProp,this.props.isPlayingAllowed);var f={height:"100%",width:"100%",allowFullScreen:true,frameBorder:"0"};if(e.validationUtils.isValidUrl(c)){f.src=c}if(this.props.addItemProp){f.itemProp="image"}var g={"":{style:{height:a,width:b}},videoFrame:{children:d.DOM.iframe(f)},preview:{style:{display:"none"}}};return g}}});