if (self.CavalryLogger) { CavalryLogger.start_js(["ltlnN"]); }

__d("AdsCanvasCollectionsFields",[],(function a(b,c,d,e,f,g){f.exports={COLLECTION_THUMBNAILS:"collection_thumbnails",HEIGHT:"height",ID:"id",PHOTO:"photo",SOURCE:"source",WIDTH:"width"};}),null);
__d('AdsCanvasCollectionsConstants',['AdsCanvasCollectionsThumbnail','immutable'],(function a(b,c,d,e,f,g){'use strict';var h=c('immutable').List,i={EMPTY_COLLECTION_THUMBNAILS:new h([new (c('AdsCanvasCollectionsThumbnail'))({element_id:'',element_crops:{}})]),MAX_COLLECTION_THUMBNAILS:4};f.exports=i;}),null);
__d('AdsCanvasImageCropIcon.react',['ix','AdsImageCropperIconContainer.react','Image.react','React','fbglyph'],(function a(b,c,d,e,f,g,h){'use strict';var i=function j(k){return c('React').createElement(c('AdsImageCropperIconContainer.react'),{cropIcon:c('React').createElement(c('Image.react'),{src:h("140329")}),image:k.image,imageCollection:k.imageCollection,imageSpecs:k.imageSpecs,selectedPlacement:k.selectedPlacement,onConfirmCropping:k.onConfirmCropping});};f.exports=i;}),null);
__d('AdsCanvasCollectionsThumbnail.react',['cx','AdImageSpecs','AdsCanvasCollectionsUtils','AdsCanvasImageCropIcon.react','AdsImageCollection','AdsPageTypes','BackgroundImage.react','FBOverlayBase.react','FBOverlayContainer.react','FBOverlayElement.react','React'],(function a(b,c,d,e,f,g,h){'use strict';var i=function j(k){var l=c('AdsCanvasCollectionsUtils').convertToLegacyImage(k.photo,k.elementCrops);return c('React').createElement(c('FBOverlayContainer.react'),null,c('React').createElement(c('FBOverlayBase.react'),null,c('React').createElement(c('BackgroundImage.react'),{backgroundSize:'cover',className:"_12lb",height:40,key:k.photo.src,loadingIndicatorStyle:'small',src:k.photo.src,width:40})),c('React').createElement(c('FBOverlayElement.react'),{className:"__08",horizontal:'right',vertical:'bottom'},c('React').createElement('div',{className:"__09"},c('React').createElement('div',{className:"_4upv"}),c('React').createElement('div',{className:"_5uvv"},c('React').createElement(c('AdsCanvasImageCropIcon.react'),{image:l,imageCollection:new (c('AdsImageCollection'))(),imageSpecs:[c('AdImageSpecs').CANVAS_COLLECTIONS],selectedPlacement:c('AdsPageTypes').MOBILE_FEED,onConfirmCropping:k.onConfirmCropping})))));};f.exports=i;}),null);
__d('AdsCanvasCollectionsActions',['AdsActionTypes','AdsDispatcher','immutable'],(function a(b,c,d,e,f,g){'use strict';var h=c('immutable').List,i={canvasImagesLoaded:function j(k,l){c('AdsDispatcher').handleUpdateFromServerResponse({canvasID:k,collectionThumbnails:l,type:c('AdsActionTypes').CANVAS.COLLECTIONS.THUMBNAILS_LOADED});},canvasImageLoadFailed:function j(k,l){c('AdsDispatcher').handleUpdateFromServerResponse({canvasID:k,error:l,type:c('AdsActionTypes').CANVAS.COLLECTIONS.THUMBNAIL_LOAD_FAILED});},setSelectedThumbnailsForCanvas:function j(k,l){c('AdsDispatcher').handleUpdateFromServerResponse({canvasID:k,selectedThumbnails:l,type:c('AdsActionTypes').CANVAS.COLLECTIONS.SET_THUMBNAILS_FOR_CANVAS});},setThumbnailEditorThumbnails:function j(k,l){c('AdsDispatcher').handleUpdateFromServerResponse({canvasID:k,thumbnails:l,type:c('AdsActionTypes').CANVAS.COLLECTIONS.SET_THUMBNAIL_EDITOR_THUMBNAILS});}};f.exports=i;}),null);
__d('AdsCanvasCollectionsDataLoader',['AdsCanvasCollectionsFields','AdsGraphAPI','GraphAPIFieldUtils'],(function a(b,c,d,e,f,g){'use strict';h.prototype.getCanvasCollectionsThumbnails=function(i){return c('AdsGraphAPI').get(f.id).object('canvas',i).batched().get({fields:c('GraphAPIFieldUtils').getFieldWithSubfields(c('AdsCanvasCollectionsFields').COLLECTION_THUMBNAILS,[c('AdsCanvasCollectionsFields').ID,c('GraphAPIFieldUtils').getFieldWithSubfields(c('AdsCanvasCollectionsFields').PHOTO,[c('AdsCanvasCollectionsFields').HEIGHT,c('AdsCanvasCollectionsFields').ID,c('AdsCanvasCollectionsFields').WIDTH])])});};function h(){}f.exports=new h();}),null);
__d('AdsCanvasCollectionsDataDispatcher',['AdsCanvasCollectionsActions','AdsCanvasCollectionsDataLoader','AdsCanvasCollectionsUtils'],(function a(b,c,d,e,f,g){'use strict';h.prototype.getCanvasCollectionsThumbnails=function(i){c('AdsCanvasCollectionsDataLoader').getCanvasCollectionsThumbnails(i).done(function(j){var k=c('AdsCanvasCollectionsUtils').convertThumbnailsFromAPI(j);c('AdsCanvasCollectionsActions').canvasImagesLoaded(i,k);},function(j){return c('AdsCanvasCollectionsActions').canvasImageLoadFailed(i,j);});};function h(){}f.exports=new h();}),null);
__d('AdsCanvasCollectionsRecord',['immutable'],(function a(b,c,d,e,f,g){'use strict';var h,i,j=c('immutable').Record({collectionThumbnails:undefined,editorDialogThumbnails:undefined,selectedThumbnails:undefined});h=babelHelpers.inherits(k,j);i=h&&h.prototype;function k(){h.apply(this,arguments);}f.exports=k;}),null);
__d('AdsCanvasCollectionsStore',['AdsActionTypes','AdsCanvasCollectionsDataDispatcher','AdsCanvasCollectionsRecord','AdsDispatcher','FluxLoadObjectStore','immutable'],(function a(b,c,d,e,f,g){'use strict';var h,i;h=babelHelpers.inherits(j,c('FluxLoadObjectStore'));i=h&&h.prototype;j.prototype.reduce=function(k,l){var m=l.action,n=void 0,o=void 0,p=void 0,q=void 0,r=void 0,s=void 0;switch(m.type){case c('AdsActionTypes').CANVAS.COLLECTIONS.THUMBNAILS_LOADED:o=m.canvasID;p=m.collectionThumbnails;var t=new (c('AdsCanvasCollectionsRecord'))({collectionThumbnails:p,editorDialogThumbnails:c('immutable').List([]),selectedThumbnails:p.slice(0,4)});return this.__handleOne(k,o,t);case c('AdsActionTypes').CANVAS.COLLECTIONS.THUMBNAIL_LOAD_FAILED:o=m.canvasID;q=m.error;return this.__handleOne(k,o,q);case c('AdsActionTypes').CANVAS.COLLECTIONS.SET_THUMBNAILS_FOR_CANVAS:o=m.canvasID;r=m.selectedThumbnails;n=this.get(o).getValueEnforcing();p=n.get('collectionThumbnails');r.map(function(u){var v=p.findIndex(function(w){return w.element_id===u.element_id;});p=p.set(v,u);});return this.__handleOne(k,o,n.set('collectionThumbnails',p).set('selectedThumbnails',r).set('editorDialogThumbnails',c('immutable').List([])));case c('AdsActionTypes').CANVAS.COLLECTIONS.SET_THUMBNAIL_EDITOR_THUMBNAILS:o=m.canvasID;s=m.thumbnails;n=this.get(o).getValueEnforcing();return this.__handleOne(k,o,n.set('editorDialogThumbnails',s));default:return k;}};j.prototype.__load=function(k){c('AdsCanvasCollectionsDataDispatcher').getCanvasCollectionsThumbnails(k);};function j(){h.apply(this,arguments);}f.exports=new j(c('AdsDispatcher'));}),null);
__d('AdsUEditorAdgroupCanvasCollectionsFieldSelector',['AdsAPIAdgroupRecordUtils','AdsBulkValueTypesConfig','AdsBulkValueUtils','AdsCanvasAdUtils','AdsCanvasCollectionsConstants','AdsCanvasCollectionsStore','adsCreateSelector','adsCreateStoreSelector','adsCreateStructuredSelector','adsUEditorAdgroupSelector','adsUEditorAdgroupSpecPathPluginSelector','adsUEditorAdObjectsLoadObjectForSelectedAdgroupsSelector','adsUEditorSelectedAdgroupIDsSelector'],(function a(b,c,d,e,f,g){'use strict';var h=c('adsCreateSelector')([c('adsUEditorAdgroupSelector')],function(n){return n?c('AdsCanvasAdUtils').getCanvasID(c('AdsCanvasAdUtils').getDestinationLinkFromAdgroup(n)):false;}),i=c('adsCreateSelector')([c('adsUEditorAdgroupSelector'),c('adsUEditorAdgroupSpecPathPluginSelector')],function(n,o){var p=c('AdsAPIAdgroupRecordUtils').getCollectionThumbnails(n,o);return p?p:c('AdsCanvasCollectionsConstants').EMPTY_COLLECTION_THUMBNAILS;}),j=c('adsCreateSelector')([c('adsUEditorAdgroupSelector')],function(n){return n?c('AdsCanvasAdUtils').isCanvasDestinationEnabled(n):false;}),k=c('adsCreateSelector')([c('adsUEditorAdgroupSelector'),c('adsUEditorAdgroupSpecPathPluginSelector')],function(n,o){return c('AdsAPIAdgroupRecordUtils').isCollectionsAd(n,o);}),l=c('adsCreateStructuredSelector')({canvasID:h,collectionThumbnails:i,isCanvasDestination:j,isCollectionFormat:k}),m=c('adsCreateStoreSelector')(function(n){return [].concat(l.getStores(n),c('adsUEditorAdObjectsLoadObjectForSelectedAdgroupsSelector').getStores(n),c('adsUEditorSelectedAdgroupIDsSelector').getStores(n),[c('AdsCanvasCollectionsStore')]);},function(n){var o=c('adsUEditorAdObjectsLoadObjectForSelectedAdgroupsSelector')(n),p={canvasID:c('AdsBulkValueTypesConfig').UNIFORM_OR_MIXED,collectionThumbnails:c('AdsBulkValueTypesConfig').UNIFORM_OR_MIXED,isCollectionFormat:c('AdsBulkValueTypesConfig').UNIFORM_OR_MIXED,isCanvasDestination:c('AdsBulkValueTypesConfig').UNIFORM_OR_MIXED},q=o.map(function(r){var s=r.map(function(fa){var ga=fa.adgroupID;return ga;}),t=r.map(function(fa){var ga=fa.adgroupID,ha=fa.campaignID,ia=fa.campaignGroupID;return l(babelHelpers['extends']({},n,{adgroupID:ga,campaignID:ha,campaignGroupID:ia}));}),u=c('AdsBulkValueUtils').aggregateDeep(p,t),v=c('AdsBulkValueUtils').getUniformValue(u.canvasID,null),w=c('AdsBulkValueUtils').getUniformValue(u.collectionThumbnails,c('AdsCanvasCollectionsConstants').EMPTY_COLLECTION_THUMBNAILS),x=c('AdsBulkValueUtils').getUniformValue(u.isCollectionFormat,false),y=c('AdsBulkValueUtils').getUniformValue(u.isCanvasDestination,false),z=false,aa=true,ba=false;if(v){var ca=c('AdsCanvasCollectionsStore').get(v);ba=c('AdsCanvasCollectionsStore').get(v).hasError();var da=c('AdsCanvasCollectionsStore').get(v).hasValue();aa=ba||da;if(da){var ea=ca.getValueEnforcing();z=ea.get('collectionThumbnails').count()>=c('AdsCanvasCollectionsConstants').MAX_COLLECTION_THUMBNAILS;}}return {adgroupIDs:s,canvasID:v,collectionThumbnails:w,hasLoadErrors:ba,isCanvasCollectionAd:x&&y,isCanvasDestination:y,isCollectionFormat:x,isCanvasCollectionsEligible:z,isReady:aa};});if(q.isLoading())return {adgroupIDs:[],canvasID:null,collectionThumbnails:c('AdsCanvasCollectionsConstants').EMPTY_COLLECTION_THUMBNAILS,hasLoadErrors:false,isCanvasCollectionAd:false,isCanvasDestination:false,isCollectionFormat:false,isCanvasCollectionsEligible:false,isReady:false};return babelHelpers['extends']({},q.getValueEnforcing());});f.exports=m;}),null);
__d('AdsCanvasCollectionsThumbnailContainer.react',['AdsCanvasCollectionsStore','AdsCanvasCollectionsThumbnail.react','AdsCanvasElementStore','AdsUEditorAdgroupActions','AdsUEditorAdgroupCanvasCollectionsFieldSelector','AdsUEditorFieldContainerContextType','BUIAdoptionXUISpinner.react','FluxContainer','immutable','React','nullthrows'],(function a(b,c,d,e,f,g){'use strict';var h,i,j=c('immutable').List;h=babelHelpers.inherits(k,c('React').Component);i=h&&h.prototype;function k(){var l,m;for(var n=arguments.length,o=Array(n),p=0;p<n;p++)o[p]=arguments[p];return m=(l=i.constructor).call.apply(l,[this].concat(o)),this.$AdsCanvasCollectionsThumbnailContainer1=function(q){if(!this.state.isReady)return;var r=this.state,s=r.adgroupIDs,t=r.collectionThumbnails,u=q.getCrops(),v=t.get(this.props.index);v=v.set('element_crops',u);t=t.set(this.props.index,v);c('AdsUEditorAdgroupActions').setCollectionThumbnails(this.context.adgroupEditorContext.hostID,s,t);}.bind(this),m;}k.getStores=function(l,m){var n=m.adgroupEditorContext;return [].concat(c('AdsUEditorAdgroupCanvasCollectionsFieldSelector').getStores(n),[c('AdsCanvasCollectionsStore'),c('AdsCanvasElementStore')]);};k.calculateState=function(l,m,n){var o=n.adgroupEditorContext,p=c('AdsUEditorAdgroupCanvasCollectionsFieldSelector')(o),q=p.canvasID;if(!q)return {isReady:false};var r=c('AdsCanvasElementStore').get(m.elementID);if(!r.hasValue())return {isReady:false};var s=c('AdsUEditorAdgroupCanvasCollectionsFieldSelector')(o),t=s.adgroupIDs,u=s.collectionThumbnails,v=r.getValueEnforcing();return {adgroupIDs:t,collectionThumbnails:u,isReady:true,photo:c('nullthrows')(v.get('photo'))};};k.prototype.render=function(){if(!this.state.isReady)return c('React').createElement(c('BUIAdoptionXUISpinner.react'),null);return c('React').createElement(c('AdsCanvasCollectionsThumbnail.react'),{elementCrops:this.props.elementCrops,photo:this.state.photo,onConfirmCropping:this.$AdsCanvasCollectionsThumbnailContainer1});};k.contextTypes=c('AdsUEditorFieldContainerContextType');f.exports=c('FluxContainer').create(k,{withContext:true,withProps:true});}),null);
__d('AdsCanvasCollectionsThumbnailSelectorDialog.react',['cx','fbt','AdsArrowedCarouselEnhanced.react','AdsCanvasCollectionsConstants','AdsCanvasCollectionsUtils','AdsMediaLibrary.react','AdsMediaPanelImageBoxContainer.react','AdsWebdriverIDs','React','curry'],(function a(b,c,d,e,f,g,h,i){'use strict';var j,k,l=c('AdsCanvasCollectionsConstants').MAX_COLLECTION_THUMBNAILS;j=babelHelpers.inherits(m,c('React').PureComponent);k=j&&j.prototype;m.prototype.render=function(){return c('React').createElement('div',null,this.$AdsCanvasCollectionsThumbnailSelectorDialog1(),this.$AdsCanvasCollectionsThumbnailSelectorDialog2());};m.prototype.$AdsCanvasCollectionsThumbnailSelectorDialog1=function(){return c('React').createElement(c('AdsMediaLibrary.react'),{height:248,imageList:this.props.collectionPhotos.map(function(n){return c('AdsCanvasCollectionsUtils').convertToLegacyImage(n);}).toArray(),isClickEnabled:this.props.editorDialogPhotos.count()<l,photoArrangeEnabled:true,selectedImageList:this.props.editorDialogPhotos.map(function(n){return c('AdsCanvasCollectionsUtils').convertToLegacyImage(n);}).toArray(),onImageClick:this.props.onImageClick});};m.prototype.$AdsCanvasCollectionsThumbnailSelectorDialog2=function(){var n=this.props.editorDialogPhotos.map(function(o,p){return c('React').createElement(c('AdsMediaPanelImageBoxContainer.react'),{alt:i._("Selected Image {number} of {total}",[i.param('number',p+1),i.param('total',this.props.editorDialogPhotos.count())]),className:"_16es",decoration:'removable',image:c('AdsCanvasCollectionsUtils').convertToLegacyImage(o),key:o.id,useMediaPanelRedesign:true,onDecorationIconClick:c('curry')(this.props.onRemoveImage,p)});}.bind(this));return c('React').createElement('div',{className:"_16et _5xi2 _2xcc clearfix",'data-testid':c('AdsWebdriverIDs').SELECTED_IMAGE_PANEL},c('React').createElement('div',{className:"_16eu"},c('React').createElement('h2',{className:"_5xht"},i._("Selected Images")),c('React').createElement('span',{className:"_5xi4"},i._({"*":{"*":"({images} of {max-images})"}},[i.param('images',this.props.editorDialogPhotos.count(),[0]),i.param('max-images',l,[0])]))),c('React').createElement('div',{className:"_3k2_",ref:'selectedImagesCarouselContainer'},c('React').createElement(c('AdsArrowedCarouselEnhanced.react'),{maxChangeAmount:6},n)));};function m(){j.apply(this,arguments);}f.exports=m;}),null);
__d('AdsCanvasCollectionsThumbnailSelectorDialogContainer.react',['AdsCanvasCollectionsActions','AdsCanvasCollectionsStore','AdsCanvasCollectionsThumbnailSelectorDialog.react','AdsCanvasElementStore','AdsUEditorAdgroupCanvasCollectionsFieldSelector','AdsUEditorFieldContainerContextType','BUIAdoptionXUISpinner.react','FluxContainer','immutable','React'],(function a(b,c,d,e,f,g){'use strict';var h,i,j=c('immutable').List;h=babelHelpers.inherits(k,c('React').PureComponent);i=h&&h.prototype;function k(){var l,m;for(var n=arguments.length,o=Array(n),p=0;p<n;p++)o[p]=arguments[p];return m=(l=i.constructor).call.apply(l,[this].concat(o)),this.$AdsCanvasCollectionsThumbnailSelectorDialogContainer1=function(q){if(!this.state.isReady)return;var r=this.state,s=r.canvasID,t=r.collectionPhotos,u=r.collectionThumbnails,v=r.editorDialogPhotos,w=r.editorDialogThumbnails,x=v.findIndex(function(z){return z.id===q.getID();});if(x!==-1){w=w.remove(x);}else{var y=t.findIndex(function(z){return z.id===q.getID();});w=w.push(u.get(y));}c('AdsCanvasCollectionsActions').setThumbnailEditorThumbnails(s,w);}.bind(this),this.$AdsCanvasCollectionsThumbnailSelectorDialogContainer2=function(q){if(!this.state.isReady)return;var r=this.state,s=r.canvasID,t=r.editorDialogThumbnails;t=t.remove(q);c('AdsCanvasCollectionsActions').setThumbnailEditorThumbnails(s,t);}.bind(this),m;}k.getStores=function(l,m){var n=m.adgroupEditorContext;return [].concat(c('AdsUEditorAdgroupCanvasCollectionsFieldSelector').getStores(n),[c('AdsCanvasCollectionsStore')]);};k.calculateState=function(l,m,n){var o=n.adgroupEditorContext,p=c('AdsUEditorAdgroupCanvasCollectionsFieldSelector')(o),q=p.canvasID;if(!q)return {isReady:false};var r=c('AdsCanvasCollectionsStore').get(q);if(!r.hasValue())return {isReady:false};var s=r.getValueEnforcing(),t=s.get('collectionThumbnails'),u=s.get('editorDialogThumbnails'),v=c('AdsCanvasElementStore').getAll(t.map(function(y){return y.element_id;}));if(v.some(function(y){return !y.hasValue();}))return {isReady:false};var w=t.map(function(y){return c('AdsCanvasElementStore').get(y.element_id).getValueEnforcing().get('photo');}),x=u.map(function(y){return c('AdsCanvasElementStore').get(y.element_id).getValueEnforcing().get('photo');});return {canvasID:q,collectionPhotos:w,collectionThumbnails:t,editorDialogPhotos:x,editorDialogThumbnails:u,isReady:true};};k.prototype.render=function(){if(!this.state.isReady)return c('React').createElement(c('BUIAdoptionXUISpinner.react'),null);return c('React').createElement(c('AdsCanvasCollectionsThumbnailSelectorDialog.react'),{collectionPhotos:this.state.collectionPhotos,editorDialogPhotos:this.state.editorDialogPhotos,onImageClick:this.$AdsCanvasCollectionsThumbnailSelectorDialogContainer1,onRemoveImage:this.$AdsCanvasCollectionsThumbnailSelectorDialogContainer2});};k.contextTypes=c('AdsUEditorFieldContainerContextType');f.exports=c('FluxContainer').create(k,{withContext:true});}),null);
__d('AdsCanvasCollectionsThumbnailsRow.react',['cx','fbt','AdsCanvasCollectionsThumbnailContainer.react','AdsCanvasCollectionsThumbnailSelectorDialogContainer.react','BUIAdoptionButton.react','Grid.react','immutable','React','XUIDialog.react','XUIDialogBody.react','XUIDialogCancelButton.react','XUIDialogConfirmButton.react','XUIDialogFooter.react','XUIDialogTitle.react','emptyFunction'],(function a(b,c,d,e,f,g,h,i){'use strict';var j,k,l=c('immutable').List;j=babelHelpers.inherits(m,c('React').Component);k=j&&j.prototype;function m(){var n,o;for(var p=arguments.length,q=Array(p),r=0;r<p;r++)q[r]=arguments[r];return o=(n=k.constructor).call.apply(n,[this].concat(q)),this.state={showDialog:false},this.$AdsCanvasCollectionsThumbnailsRow1=function(){this.setState({showDialog:true});}.bind(this),this.$AdsCanvasCollectionsThumbnailsRow3=function(){this.setState({showDialog:false});this.props.onThumbnailChange();}.bind(this),o;}m.prototype.render=function(){return c('React').createElement('div',null,c('React').createElement(c('Grid.react'),{cols:10,fixed:false,spacing:"_2pih"},this.props.selectedThumbnails.map(function(n,o){return c('React').createElement(c('AdsCanvasCollectionsThumbnailContainer.react'),{elementCrops:n.get('element_crops'),elementID:n.get('element_id'),index:o,key:o});}),c('React').createElement('div',{className:"_3-99"},c('React').createElement(c('BUIAdoptionButton.react'),{label:i._("Customize"),onClick:this.$AdsCanvasCollectionsThumbnailsRow1}))),this.$AdsCanvasCollectionsThumbnailsRow2());};m.prototype.$AdsCanvasCollectionsThumbnailsRow2=function(){return c('React').createElement(c('XUIDialog.react'),{className:"_uro",height:800,shown:this.state.showDialog,titleID:'product-selector',width:600,onToggle:c('emptyFunction')},c('React').createElement(c('XUIDialogTitle.react'),null,i._("Choose up to 4 Images to Feature in News Feed")),c('React').createElement(c('XUIDialogBody.react'),{className:"_urp"},c('React').createElement(c('AdsCanvasCollectionsThumbnailSelectorDialogContainer.react'),null)),c('React').createElement(c('XUIDialogFooter.react'),null,c('React').createElement(c('XUIDialogCancelButton.react'),{use:'default',onClick:c('emptyFunction')}),c('React').createElement(c('XUIDialogConfirmButton.react'),{label:i._("Save"),use:'confirm',onClick:this.$AdsCanvasCollectionsThumbnailsRow3})));};f.exports=m;}),null);
__d('AdsCanvasCollectionsThumbnailsRowContainer.react',['AdsCanvasCollectionsActions','AdsCanvasCollectionsConstants','AdsCanvasCollectionsStore','AdsCanvasCollectionsThumbnailsRow.react','AdsCanvasCollectionsUtils','AdsUEditorAdgroupActions','AdsUEditorAdgroupCanvasCollectionsFieldSelector','AdsUEditorFieldContainerContextType','BUIAdoptionXUISpinner.react','FluxContainer','immutable','React'],(function a(b,c,d,e,f,g){'use strict';var h,i,j=c('immutable').List,k=c('AdsCanvasCollectionsConstants').MAX_COLLECTION_THUMBNAILS;h=babelHelpers.inherits(l,c('React').PureComponent);i=h&&h.prototype;function l(){var m,n;for(var o=arguments.length,p=Array(o),q=0;q<o;q++)p[q]=arguments[q];return n=(m=i.constructor).call.apply(m,[this].concat(p)),this.$AdsCanvasCollectionsThumbnailsRowContainer1=function(){if(!this.state.isReady)return;var r=this.state,s=r.adgroupIDs,t=r.editorDialogThumbnails,u=r.selectedThumbnails,v=0;while(t.count()<k){if(t.every(function(w){return w.element_id!==u.get(v).element_id;}))t=t.push(u.get(v));v++;}c('AdsUEditorAdgroupActions').setCollectionThumbnails(this.context.adgroupEditorContext.hostID,s,t);}.bind(this),n;}l.getStores=function(m,n){var o=n.adgroupEditorContext;return [].concat(c('AdsUEditorAdgroupCanvasCollectionsFieldSelector').getStores(o),[c('AdsCanvasCollectionsStore')]);};l.calculateState=function(m,n,o){var p=o.adgroupEditorContext,q=c('AdsUEditorAdgroupCanvasCollectionsFieldSelector')(p),r=q.canvasID;if(!r)return {isReady:false};var s=c('AdsCanvasCollectionsStore').get(r);if(!s.hasValue())return {isReady:false};var t=s.getValueEnforcing(),u=c('AdsUEditorAdgroupCanvasCollectionsFieldSelector')(p),v=u.adgroupIDs,w=u.collectionThumbnails;if(!w||w.some(function(x){return !x.get('element_id');})){c('AdsUEditorAdgroupActions').setCollectionThumbnails(p.hostID,v,t.get('selectedThumbnails'));return {isReady:false};}if(!c('AdsCanvasCollectionsUtils').areCollectionThumbnailsEqual(w,t.get('selectedThumbnails'))){c('AdsCanvasCollectionsActions').setSelectedThumbnailsForCanvas(r,w);return {isReady:false};}return {canvasID:r,adgroupIDs:v,isReady:true,selectedThumbnails:w,editorDialogThumbnails:t.get('editorDialogThumbnails')};};l.prototype.render=function(){if(!this.state.isReady)return c('React').createElement(c('BUIAdoptionXUISpinner.react'),{size:'small'});return c('React').createElement(c('AdsCanvasCollectionsThumbnailsRow.react'),{canvasID:this.state.canvasID,selectedThumbnails:this.state.selectedThumbnails,onThumbnailChange:this.$AdsCanvasCollectionsThumbnailsRowContainer1});};l.contextTypes=c('AdsUEditorFieldContainerContextType');f.exports=c('FluxContainer').create(l,{withContext:true});}),null);
__d('AYMTAdsCanvasDestinationSectionWebsiteParsingUpsellNuxRenderer',['cx','fbt','AdsBlueTip.react','AdsCanvasLandingPageReplacementCheckboxActions','AdsGuidanceBaseNuxRenderer','AdsGuidanceChannelObject','ContextualLayerUpdateOnScroll','immutable','Text.react','React','ge'],(function a(b,c,d,e,f,g,h,i){'use strict';var j,k,l=c('AdsGuidanceChannelObject').NuxData,m=c('AdsGuidanceChannelObject').ChannelData,n='ads_canvas_website_parsing_upsell_tip';j=babelHelpers.inherits(o,c('AdsGuidanceBaseNuxRenderer'));k=j&&j.prototype;function o(p){k.constructor.call(this,p);this.$AYMTAdsCanvasDestinationSectionWebsiteParsingUpsellNuxRenderer1=function(){this.$AYMTAdsCanvasDestinationSectionWebsiteParsingUpsellNuxRenderer2();this.$AYMTAdsCanvasDestinationSectionWebsiteParsingUpsellNuxRenderer3();}.bind(this);this.adgroupIDs=p.adgroupIDs;this.onTriggerScrollToCanvasCheckboxSection=p.onTriggerScrollToCanvasCheckboxSection;}o.prototype.getIDs=function(){return c('immutable').Set([n]);};o.prototype.canRender=function(p,q,r){return true;};o.prototype.getElement=function(p,q,r,s,t){var u=c('ge')('canvas_website_parsing_upsell');if(!u)return c('React').createElement('div',null);return c('React').createElement(c('AdsBlueTip.react'),{behaviors:{ContextualLayerUpdateOnScroll:c('ContextualLayerUpdateOnScroll')},context:u,insertParent:u,position:'right',onClose:s},c('React').createElement('strong',null,i._("Create a Mobile Landing Page with Canvas")),c('React').createElement('div',null),i._("Use the images from your website to quickly create a fullscreen Canvas that opens instantly from your ad."),c('React').createElement('button',{className:"_3nru",onClick:this.$AYMTAdsCanvasDestinationSectionWebsiteParsingUpsellNuxRenderer1},c('React').createElement(c('Text.react'),{className:"_3nrv"},i._("Get Started"))));};o.prototype.$AYMTAdsCanvasDestinationSectionWebsiteParsingUpsellNuxRenderer3=function(){c('AdsCanvasLandingPageReplacementCheckboxActions').setCheckbox(this.adgroupIDs,true);};o.prototype.$AYMTAdsCanvasDestinationSectionWebsiteParsingUpsellNuxRenderer2=function(){this.onTriggerScrollToCanvasCheckboxSection();};f.exports=o;}),null);
__d('AdsCanvasDestinationSectionWebsiteParsingUpsellNux.react',['AdsGuidanceStandaloneNuxContainer.react','AYMTAdsCanvasDestinationSectionWebsiteParsingUpsellNuxRenderer','React'],(function a(b,c,d,e,f,g){'use strict';var h,i,j=c('React').PropTypes,k='AYMTAdsInterfacesManagementHomeChannel',l='ads_canvas_website_parsing_upsell_tip';h=babelHelpers.inherits(m,c('React').PureComponent);i=h&&h.prototype;m.prototype.render=function(){return c('React').createElement(c('AdsGuidanceStandaloneNuxContainer.react'),{accountID:this.props.accountID,channelName:k,nuxName:l,renderer:new (c('AYMTAdsCanvasDestinationSectionWebsiteParsingUpsellNuxRenderer'))({adgroupIDs:this.props.adgroupIDs,onTriggerScrollToCanvasCheckboxSection:this.props.onTriggerScrollToCanvasCheckboxSection})});};function m(){h.apply(this,arguments);}m.propTypes={accountID:j.string.isRequired,adgroupIDs:j.array.isRequired,onTriggerScrollToCanvasCheckboxSection:j.func};f.exports=m;}),null);
__d('AdsUEditorAdgroupCanvasCollectionsFieldContainer.react',['fbt','AdsUEditorAdgroupCanvasCollectionsFieldSelector','AdsUEditorFieldContainerContextType','BootloadedComponent.react','BUIAdoptionXUINoticeSmall.react','BUIAdoptionXUISpinner.react','FluxContainer','JSResource','React'],(function a(b,c,d,e,f,g,h){'use strict';var i,j;i=babelHelpers.inherits(k,c('React').PureComponent);j=i&&i.prototype;k.getStores=function(l,m){var n=m.adgroupEditorContext;return c('AdsUEditorAdgroupCanvasCollectionsFieldSelector').getStores(n);};k.calculateState=function(l,m,n){var o=n.adgroupEditorContext;return c('AdsUEditorAdgroupCanvasCollectionsFieldSelector')(o);};k.prototype.render=function(){if(!this.state.isCanvasCollectionAd||!this.state.canvasID)return null;if(!this.state.isReady)return c('React').createElement(c('BUIAdoptionXUISpinner.react'),null);if(this.state.hasLoadErrors)return c('React').createElement(c('BUIAdoptionXUINoticeSmall.react'),{style:{marginBottom:'12px'},type:'error'},h._("Sorry, something went wrong."));if(!this.state.isCanvasCollectionsEligible)return c('React').createElement(c('BUIAdoptionXUINoticeSmall.react'),{style:{marginBottom:'12px'},type:'error'},h._("The selected canvas does not contain enough images to be used for collections. A canvas needs at least 4 images from photo and carousel components to be eligible."));return c('React').createElement(c('BootloadedComponent.react'),{bootloadLoader:c('JSResource')('AdsUEditorAdgroupCanvasCollectionsField.react').__setRef('AdsUEditorAdgroupCanvasCollectionsFieldContainer.react'),bootloadPlaceholder:c('React').createElement(c('BUIAdoptionXUISpinner.react'),null),canvasID:this.state.canvasID});};function k(){i.apply(this,arguments);}k.contextTypes=c('AdsUEditorFieldContainerContextType');f.exports=c('FluxContainer').create(k,{withContext:true});}),null);
__d('AdsCanvasCollectionsSelectorCreativeFieldPlugin',['AdsUEditorAdgroupCanvasCollectionsFieldContainer.react','React','adsCreateSelector'],(function a(b,c,d,e,f,g){'use strict';var h=c('adsCreateSelector')([],function(){return {};}),i={type:'creativeField',key:'canvasCollectionSelector',carouselTabProps:{},adgroupProps:{collectionCreative:h},render:function j(){return c('React').createElement(c('AdsUEditorAdgroupCanvasCollectionsFieldContainer.react'),null);}};f.exports=i;}),null);
__d('AdsUEditorAdgroupCanvasCollectionsField.react',['cx','fbt','AdsCanvasCollectionsThumbnailsRowContainer.react','AdsHelpLink.react','AdsInfoTable.react','AdsInfoTableRow.react','Image.react','React','SUIButton.react','fbglyph'],(function a(b,c,d,e,f,g,h,i){'use strict';var j,k;j=babelHelpers.inherits(l,c('React').Component);k=j&&j.prototype;l.prototype.render=function(){return c('React').createElement(c('AdsInfoTable.react'),{sectionborders:false},this.$AdsUEditorAdgroupCanvasCollectionsField1(),this.$AdsUEditorAdgroupCanvasCollectionsField2());};l.prototype.$AdsUEditorAdgroupCanvasCollectionsField1=function(){return c('React').createElement(c('AdsInfoTableRow.react'),{className:"_2pid _2_7p _3yhp",label:i._("Images Featured in News Feed"),vertical:true},c('React').createElement(c('AdsCanvasCollectionsThumbnailsRowContainer.react'),null));};l.prototype.$AdsUEditorAdgroupCanvasCollectionsField2=function(){return null;};function l(){j.apply(this,arguments);}f.exports=l;}),null);
__d('AdsUEditorAdgroupCanvasRadioButtons.react',['cx','fbt','AdsCanvasConstants','AdsInfoTable.react','AdsInfoTableRow.react','Link.react','React','SUIRadioList.react','joinClasses'],(function a(b,c,d,e,f,g,h,i){'use strict';var j,k,l=c('SUIRadioList.react').Item;j=babelHelpers.inherits(m,c('React').Component);k=j&&j.prototype;m.prototype.render=function(){var n=c('React').createElement('div',{className:c('joinClasses')(this.props.className,"_32lv")},this.props.objectiveUpsell,c('React').createElement(c('SUIRadioList.react'),{value:this.props.value,onChange:this.props.onChange},c('React').createElement(l,{value:c('AdsCanvasConstants').USE_PRODUCT_SET},i._("Use the Product Set")),c('React').createElement(l,{value:c('AdsCanvasConstants').USE_CANVAS},i._("Select a Canvas"))),c('React').createElement('div',{className:"_5_0n"+(!this.props.renderHeader?' '+"_3k48":'')},this.props.value===c('AdsCanvasConstants').USE_CANVAS?this.props.children:null));if(this.props.renderHeader)return c('React').createElement('div',{className:"_5_0o"},c('React').createElement(c('AdsInfoTable.react'),{sectionborders:false},c('React').createElement(c('AdsInfoTableRow.react'),{className:"_5_0p",label:i._("Canvas"),vertical:true},i._("Make your ad fullscreen with a Canvas, a mobile experience that opens instantly from your ad. {=Learn more}.",[i.param('=Learn more',c('React').createElement(c('Link.react'),{href:c('AdsCanvasConstants').CANVAS_LEARN_MORE_LINK,target:'_blank'},i._("Learn more")))])),n));return n;};function m(){j.apply(this,arguments);}f.exports=m;}),null);