text: define("modules/clean/loggers/folder_invite_impression_logger",["require","exports","modules/clean/analytics","modules/clean/react/user_notifications/constants","modules/clean/react/user_notifications/models"],function(e,t,n,o,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r={};r[i.SharedFolderInviteOverQuotaStatuses.ALREADY_OVER]="view_shared_folder_notification_already_oq",r[i.SharedFolderInviteOverQuotaStatuses.WILL_BE_OVER]="view_shared_folder_notification_near_oq";var a=(function(){function e(){this._handleRenderedNotifications=this._handleRenderedNotifications.bind(this)}return e.prototype.listenTo=function(e){e.addListener(o.EventTypes.RENDERED_NOTIFICATIONS,this._handleRenderedNotifications)},e.prototype.unlistenTo=function(e){e.removeListener(o.EventTypes.RENDERED_NOTIFICATIONS,this._handleRenderedNotifications)},e.prototype._handleRenderedNotifications=function(e){var t=e.notifications;if(!this._hasLoggedOverQuotaImpressions)return this._hasLoggedOverQuotaImpressions=!0,this._logOverQuotaImpressions(t)},e.prototype._logOverQuotaImpressions=function(e){return(function(){for(var t=[],o=0,a=Array.from(e.slice(0,3));o<a.length;o++){var s=a[o];if(s.type===i.NotificationTypes.SharedFolderInvite){var c=s.typeData.overQuotaStatus,u=r[c];if(u){n.ProEventsLogger.log(u);break}t.push(void 0)}else t.push(void 0)}return t})()},e})();t.FolderInviteImpressionLogger=a}),define("modules/clean/loggers/notification_logger",["require","exports","modules/clean/ajax","modules/clean/react/user_notifications/models"],function(e,t,n,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NotificationLocations={TRAY:"home",HOME_PAGE:"home_page"};var i=(function(){function e(){}return e.logReceive=function(t){for(var n=[],o=0,i=t;o<i.length;o++){var r=i[o];n.push(e.getCommonEventData("receive",r))}e.log(n)},e.logRender=function(t,n,o){var i=[];t.forEach(function(t,r){var a=e.getCommonEventData("render",t);a.location=o,a.location_index=n+r,i.push(a)}),e.log(i)},e.logAction=function(t,n,o){var i=e.getCommonEventData("action",t);i.action_taken=n,o&&(i.location=o),e.log([i])},e.logMarkAsRead=function(t,n){for(var o=[],i=0,r=t;i<r.length;i++){var a=r[i],s=e.getCommonEventData("mark_read",a);s.location=n,o.push(s)}e.log(o)},e.log=function(e){0!==e.length&&n.SilentBackgroundRequest({url:"/log/notif_events",data:{event_list:JSON.stringify(e)}})},e.getCommonEventData=function(e,t){return{event_name:e,type_id:t.typeId,campaign_id:t.campaignId,campaign_version:t.campaignVersion,instance_id:parseInt(t.id,10),status:o.NotificationStatusStrings[t.status],seen_state:t.seenState,target_object_key:t.targetObjectKey}},e})();t.NotificationLogger=i}),define("modules/clean/loggers/notification_tray_logger",["require","exports","modules/clean/ajax"],function(e,t,n){"use strict";function o(e){r({event_name:"tray_popup_shown",badge_count:e})}function i(){r({event_name:"mark_all_as_read"})}function r(e){n.SilentBackgroundRequest({url:"/log/notif_tray_events",data:{event_dict:JSON.stringify(e)}})}Object.defineProperty(t,"__esModule",{value:!0}),t.logTrayOpen=o,t.logMarkAllAsRead=i}),define("modules/clean/photos/batch_thumb_loader",["require","exports","modules/clean/ajax","modules/clean/react/no-jquery","modules/constants/env","modules/core/uri"],function(e,t,n,o,i,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=(function(){function e(e){var t=e.batch_size,n=e.max_parallel_requests,o=e.on_batch,i=e.batch_logger,r=e.on_batch_success;this.on_batch=o,this.batch_logger=i,this.on_batch_success=r,this.batch_size=t||16,this.max_parallel_requests=n||6,this.thumb_url_queue=[],this.batch_queue=[],this.callback_by_id={},this.request_ids_by_url={},this.num_requests_in_flight=0,this.flushing=!1,this.last_thumb_request_id=0,this.next_batch_id=0,this.cancelled_urls={},this.outstanding_batches={},this._request_callback_by_request_id={}}return e.prototype.vend_request_id=function(){return this.last_thumb_request_id++,this.last_thumb_request_id.toString()},e.prototype.queue_thumb=function(e,t,n){void 0===n&&(n={});var r=n.request_id,a=n.onrequest;if(o.corsSupport()&&i.BATCH_THUMB_ENDPOINTS.length){if(r||(r=this.vend_request_id()),this.request_ids_by_url[e]&&this.request_ids_by_url[e].length){var s=!1;for(var c in this.outstanding_batches)if(this.outstanding_batches[c]&&this.outstanding_batches[c].urls)for(var u=0,l=this.outstanding_batches[c].urls;u<l.length;u++){var d=l[u];d===e&&(s=!0)}s&&"function"==typeof a&&a()}else this.thumb_url_queue.push(e),this.request_ids_by_url[e]=[];return this.request_ids_by_url[e].push(r),t&&(this.callback_by_id[r]={url:e,callback:t}),this._request_callback_by_request_id[r]=a,this.thumb_url_queue.length>=this.batch_size&&(this.batch_queue.push(this.thumb_url_queue.splice(0,this.batch_size)),this._send_batch_requests()),r}"function"==typeof a&&a();return t&&"function"==typeof t&&t(e,!0),null},e.prototype.cancel_thumb=function(e){if(this.callback_by_id[e]){var t=this.callback_by_id[e].url;delete this.callback_by_id[e],delete this._request_callback_by_request_id[e];for(var n=0;n<this.request_ids_by_url[t].length;n++){if(this.request_ids_by_url[t][n]===e){this.request_ids_by_url[t].splice(n,1);break}}if(0===this.request_ids_by_url[t].length){var o=void 0;delete this.request_ids_by_url[t];for(var n=0;n<this.thumb_url_queue.length;n++)if(o=this.thumb_url_queue[n],o===t)return void this.thumb_url_queue.splice(n,1);for(var n=0;n<this.batch_queue.length;n++)for(var i=this.batch_queue[n],r=0;r<i.length;r++)if(o=i[r],o===t)return i.splice(r,1),void(0===i.length&&this.batch_queue.splice(n,1));this.cancelled_urls[t]=1;for(var a in this.outstanding_batches)if(this.outstanding_batches[a]&&this.outstanding_batches[a].urls){for(var s=this.outstanding_batches[a],c=s.urls,u=s.request,l=!0,d=0,p=c;d<p.length;d++){var h=p[d];l=null!=this.cancelled_urls[h]&&l}if(l){u.abort();break}}}}},e.prototype.flush=function(){for(;this.thumb_url_queue.length;)this.batch_queue.push(this.thumb_url_queue.splice(0,this.batch_size));this._send_batch_requests()},e.prototype.reset=function(e){var t=e.batch_size,n=e.batch_logger;this.batch_logger=n,this.batch_size=t||16},e.prototype.clear=function(){this.thumb_url_queue=[]},e.prototype.pause=function(){this.flushing=!1},e.prototype._send_batch_requests=function(){if(!(0===this.batch_queue.length||this.num_requests_in_flight>=this.max_parallel_requests)&&this.batch_queue.length>0){this.flushing=!0;var e=this.batch_queue.shift(),t=this._generate_request_params(e),o=t.endpoint,i=t.method,r=t.data;this.on_batch&&"function"==typeof this.on_batch&&this.on_batch(e);for(var a=0,s=e;a<s.length;a++)for(var c=s[a],u=0,l=this.request_ids_by_url[c];u<l.length;u++){var d=l[u],p=this._request_callback_by_request_id[d];p&&"function"==typeof p&&p(),delete this._request_callback_by_request_id[d]}var h=this.next_batch_id;this.next_batch_id++,this.num_requests_in_flight++;var f=n.SilentBackgroundRequest({xhrFields:{withCredentials:!0},url:o,type:i,data:r,success:this._success.bind(this,e),error:this._error.bind(this,e),complete:this._complete.bind(this,h)});this.outstanding_batches[h]={urls:e,request:f},this._send_batch_requests()}},e.prototype._success=function(e,t){for(var n=t.split("\n"),o={},i=0,r=e;i<r.length;i++){var a=r[i];o[a]=!1}for(var s=0;s<n.length;s++){var c=n[s],u=c.indexOf(":");if(u!==-1){var l=c.substring(0,u).split("-"),d=parseInt(l[0],10),p=c.substring(u+1),a=e[d];o[a]=!0,this._call_callback(a,p),this.batch_logger&&"function"==typeof this.batch_logger&&this.batch_logger(s,e.length)}}this.on_batch_success&&"function"==typeof this.on_batch_success&&this.on_batch_success(e);for(var h=0,f=e.filter(function(e){return!o[e]});h<f.length;h++){var a=f[h];this.cancelled_urls[a]||this._call_callback(a,a)}},e.prototype._error=function(e){for(var t=0,n=e;t<n.length;t++){var o=n[t];this._call_callback(o,o)}},e.prototype._complete=function(e){this.num_requests_in_flight--;for(var t=this.outstanding_batches[e].urls,n=0,o=t;n<o.length;n++){var i=o[n];delete this.cancelled_urls[i]}delete this.outstanding_batches[e],this.flushing&&this._send_batch_requests()},e.prototype._call_callback=function(e,t){var n;if(n=0===t.indexOf("data:image")?t:e,this.request_ids_by_url[e])for(var o=0,i=this.request_ids_by_url[e].slice();o<i.length;o++){var r=i[o];this.callback_by_id[r]&&(this.callback_by_id[r].callback(n,!1),delete this.callback_by_id[r])}delete this.request_ids_by_url[e]},e.prototype._generate_request_params=function(e){var t=e.map(function(e){return r.URI.parse(e).setScheme().setAuthority().toString()}),n=JSON.stringify(t),o=Math.abs(this._hash_string_to_int(n)),a=o%i.BATCH_THUMB_ENDPOINTS.length,s=i.BATCH_THUMB_ENDPOINTS[a],c={image_urls:n};return{endpoint:s,method:r.URI.parse(s).setQuery(c).toString().length>6e3?"POST":"GET",data:c}},e.prototype._hash_string_to_int=function(e){var t=0;if(0===e.length)return t;for(var n=0;n<e.length;n++){t=(t<<5)-t+e.charCodeAt(n)}return t},e})();t.BatchThumbLoader=a}),define("modules/clean/react/account_menu/account_menu",["require","exports","tslib","external/react","external/reselect","modules/clean/ajax_as_promised","modules/clean/event_handler","modules/clean/react/account_menu/account_menu_view","modules/clean/react/css","modules/core/uri","modules/clean/api_v2/client","modules/clean/react/account_menu/types","modules/clean/react/account_menu/urls","modules/clean/web_timing_logger"],function(e,t,n,o,i,r,a,s,c,u,l,d,p,h){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var f=function(){return i.createSelector(function(e,t){return t.user},function(e,t){return t.viewer},function(e){return e.experiments},function(e,t,n){var o,i=[];return e.is_team||e.paid?e.is_team||!e.paid||t.role_exists("work")?e.is_team&&t.team_is_limited&&(i=[p.upsellLinks.TRY_BUSINESS]):o="V1"===n.subgrowthProHeaderDropdownPropensity?p.upsellLinks.UPGRADE_PROFESSIONAL:p.upsellLinks.TRY_BUSINESS:o=p.upsellLinks.UPGRADE_PLANS,{quotaBarCTA:o,menuItemUpsells:i}})},m=(function(t){function i(n){var o=t.call(this,n)||this;return o.getUpsellLinks=f(),o.state={accountPhotoUrl:o.props.accountPhotoUrl||o.props.user.photo_circle_url,isDisabled:!0,accountSpaceUsage:{currentStatus:d.AccountSpaceUsageStatus.NOT_APPLICABLE},experimentExposuresLogged:!1,experiments:{}},o.logExperimentExposures=function(){var e=o.state,t=e.experiments,n=e.experimentExposuresLogged;o.mounted&&!n&&(t.subgrowthProAccountDropdownRecalc&&["CONTROL","V1","V2"].includes(t.subgrowthProAccountDropdownRecalc)&&r.SilentBackgroundRequest({url:"/log/stormcrow_exposures",data:{stormcrow_name:"subgrowth_pro_account_dropdown_recalc",variant:t.subgrowthProAccountDropdownRecalc}}),t.subgrowthProHeaderDropdownPropensity&&["CONTROL","V1"].includes(t.subgrowthProHeaderDropdownPropensity)&&r.SilentBackgroundRequest({url:"/log/stormcrow_exposures",data:{stormcrow_name:"subgrowth_pro_header_dropdown_propensity",variant:t.subgrowthProHeaderDropdownPropensity}}),o.setState({experimentExposuresLogged:!0}))},o.onClickTrigger=function(){var e=o.props.onClick;e&&e(),o.logExperimentExposures()},o.handleChangeAvatar=function(){e(["modules/clean/account_photo_modal/controller"],function(e){return(0,e.AccountPhotoModalController.show)()})},o.mounted=!1,o}return n.__extends(i,t),i.prototype.componentDidMount=function(){var t=this;this.mounted=!0,this.getQuotaData(),this.getExperimentVariants(),this.events.on(document,"db:account_photo:photo_set",function(e,n){var o=u.URI.parse(n.saved_photo_url).updateQuery({size:"64x64"}).toString();t.setState({accountPhotoUrl:o})}),this.events.on(document,"db:account_photo:photo_deleted",function(){t.setState({accountPhotoUrl:null})}),this.setState({isDisabled:!1}),h.waitForTTI().then(function(){new Promise(function(t,n){e(["modules/clean/account/timezone_detection"],t,n)}).then(function(e){e.checkTimezone()})})},i.prototype.componentWillUnmount=function(){this.mounted=!1},i.prototype.getQuotaData=function(){return n.__awaiter(this,void 0,void 0,function(){var e,t,o,i;return n.__generator(this,function(n){switch(n.label){case 0:if(e=this.props.user,e.is_team)return[3,4];this.setState({accountSpaceUsage:{currentStatus:d.AccountSpaceUsageStatus.LOADING}}),n.label=1;case 1:return n.trys.push([1,3,,4]),[4,this.props.apiV2Client.ns("users").rpc("get_space_usage",void 0,{subjectUserId:e.id})];case 2:return t=n.sent(),this.mounted&&(o=t.allocation,this.setState({accountSpaceUsage:{currentStatus:d.AccountSpaceUsageStatus.READY,used:t.used,allocated:o.allocated}})),[3,4];case 3:return i=n.sent(),this.mounted&&this.setState({accountSpaceUsage:{currentStatus:d.AccountSpaceUsageStatus.NOT_APPLICABLE}}),[3,4];case 4:return[2]}})})},i.prototype.getExperimentVariants=function(){return n.__awaiter(this,void 0,void 0,function(){var e,t,o,o;return n.__generator(this,function(n){switch(n.label){case 0:return e=this.props.user,t={},!e||e.paid||e.is_team?[3,2]:[4,r.SilentBackgroundRequest({url:"/get_subgrowth_pro_account_dropdown_recalc_variant",dataType:"json",subject_user:e.id})];case 1:return o=n.sent(),o&&(t.subgrowthProAccountDropdownRecalc=o.variant),[3,4];case 2:return e&&e.paid?[4,r.SilentBackgroundRequest({url:"/get_subgrowth_pro_header_dropdown_propensity_variant",dataType:"json",subject_user:e.id})]:[3,4];case 3:o=n.sent(),o&&(t.subgrowthProHeaderDropdownPropensity=o.variant),n.label=4;case 4:return this.mounted&&this.setState({experiments:t}),[2]}})})},i.prototype.render=function(){var e=this.state,t=e.isDisabled,n=e.accountPhotoUrl,i=e.accountSpaceUsage,r=e.experiments,a=this.props,c=a.logoutContinuationPath,u=a.showInstallLink,l=a.showSettingsLink,d=a.user,p=a.viewer,h=this.getUpsellLinks(this.state,this.props),f=h.quotaBarCTA,m=h.menuItemUpsells;return o.createElement(s.AccountMenuView,{user:d,viewer:p,accountPhotoUrl:n,disabled:t,accountSpaceUsage:i,quotaBarCTA:f,menuItemUpsells:m,logoutContinuationPath:c,showInstallLink:u,showSettingsLink:l,onClickChangeAvatar:this.handleChangeAvatar,onClickTrigger:this.onClickTrigger,experiments:r})},i.defaultProps={accountPhotoUrl:null,showInstallLink:!0,showSettingsLink:!0,apiV2Client:new l.ApiV2Client},i=n.__decorate([a.eventHandler],i)})(o.Component),_=c(m,["/static/css/account_menu_common-vfln_YaOO.css","/static/css/pagelet-vflBp79rc.css","/static/css/spectrum/index.web-vflCr8xOd.css"]);t.AccountMenu=_}),define("modules/clean/react/account_menu/account_menu_view",["require","exports","tslib","spectrum/account_menu","spectrum/button","spectrum/popover","external/react","modules/clean/react/account_menu/urls","modules/core/i18n","modules/clean/react/account_menu/types","modules/clean/display_format","modules/clean/react/account_menu/profile_picture"],function(e,t,n,o,i,r,a,s,c,u,l,d){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var p=function(){return null},h=function(e){return a.createElement(o.AccountMenuItem,n.__assign({target:"_blank",rel:"noopener"},e))},f=function(e){return a.createElement(o.AccountMenuItem,{href:s.getLogoutUrl(e.continuation)},c._("Sign out"))},m=function(){return a.createElement(h,{href:s.INSTALL_URL},c._("Install"))};t.OverQuotaIcon=function(e){return a.createElement("svg",n.__assign({width:"24px",height:"24px",viewBox:"0 0 24 24"},e),a.createElement("g",{stroke:"none",strokeWidth:"1",fillRule:"evenodd"},a.createElement("g",{transform:"translate(-224.000000, -32.000000)"},a.createElement("g",{transform:"translate(224.000000, 32.000000)"},a.createElement("path",{d:"M16.4822397,17.9600934 C18.6953749,17.9600934 19.6038811,16.3972799 18.5180399,14.4810895 L13.960911,6.43909736 C12.8721172,4.51769655 11.1038811,4.52290698 10.0180399,6.43909736 L5.46091101,14.4810895 C4.37211722,16.4024903 5.27664243,17.9600934 7.4967112,17.9600934 L16.4822397,17.9600934 Z M12.9894755,15.9600934 L10.9894755,15.9600934 L10.9894755,13.9600934 L12.9894755,13.9600934 L12.9894755,15.9600934 L12.9894755,15.9600934 Z M12.9894755,12.9600934 L10.9894755,12.9600934 L10.9894755,8.96009345 L12.9894755,8.96009345 L12.9894755,12.9600934 L12.9894755,12.9600934 Z",id:"Shape"})))))},t.QuotaBar=function(e){var n=e.accountSpaceUsage,o=e.subgrowthProAccountDropdownRecalc,i=e.userIsBasic;if(n.currentStatus===u.AccountSpaceUsageStatus.READY){var r=n.used,s=n.allocated,d=c._("%(used)s of %(allocated)s used").format({used:l.format_bytes(r),allocated:l.format_bytes(s)});if(i)if("V1"===o){var p=Math.max(0,s-r);d=c._("%(space_remaining)s of space remaining").format({space_remaining:l.format_bytes(p)})}else if("V2"===o){var h=Math.max(0,Math.round(100*(1-r/s)));d=c._("%(percent_remaining)s of your space remaining").format({percent_remaining:c.format_percent(h)})}if(r<=s){return a.createElement("div",{className:"quota-bar-container"},a.createElement("div",{className:"quota-bar-empty"},a.createElement("div",{className:"quota-bar-used",style:{width:Math.min(100,r/s*100)+"%"}}),void 0),d,void 0,void 0)}return a.createElement("div",{className:"quota-bar-container quota-bar-container--over-quota"},a.createElement("div",{className:"quota-bar-empty"},a.createElement("div",{className:"quota-bar-used quota-bar-used--over-quota"})),d,a.createElement("span",{className:"ax-visually-hidden"},c._("Exceeded account quota")),a.createElement(t.OverQuotaIcon,null))}return a.createElement("div",{className:"quota-bar-container"},a.createElement("div",{className:"quota-bar-empty"}),c._("Loading quota usage..."))};var _=function(e){var t=e.quotaBarCTA,n=t.label,o=t.href;return a.createElement("a",{className:"account-menu-upgrade-link",href:o},n)},g=function(e){return a.createElement(h,{href:e.href},e.label)},v=function(){return a.createElement(o.AccountMenuItem,{href:s.SETTINGS_URL},c._("Settings"))},b=function(e){var n,o,r=e.accountSpaceUsage,s=e.quotaBarCTA,c=e.experiments,l=e.userIsBasic;return r&&r.currentStatus!==u.AccountSpaceUsageStatus.NOT_APPLICABLE&&(n=a.createElement(t.QuotaBar,{accountSpaceUsage:r,subgrowthProAccountDropdownRecalc:c&&c.subgrowthProAccountDropdownRecalc,userIsBasic:l})),null!=s&&(o=a.createElement(_,{quotaBarCTA:s})),a.createElement("div",{className:"account-menu-user-summary"},a.createElement(i.Button,{variant:"circular",className:"account-menu-user-summary__change-avatar",onClick:e.onClickChangeAvatar},a.createElement(d.ProfilePicture,{size:40,src:e.accountPhotoUrl})),a.createElement("div",{className:"account-menu-user-summary__display-name"},e.userDisplayName),n,o)},y=(function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.handleTriggerClick=function(){var e=t.props,n=e.disabled,o=e.onClickTrigger;!n&&o&&o()},t}return n.__extends(t,e),t.prototype.render=function(){var e=this.props,t=e.disabled,n=e.accountPhotoUrl,s=e.accountSpaceUsage,u=e.quotaBarCTA,l=e.menuItemUpsells,h=e.logoutContinuationPath,_=e.showInstallLink,y=e.showSettingsLink,S=e.user,w=e.onClickChangeAvatar,N=e.experiments,A=S.display_name,E=S&&!S.paid&&!S.is_team;return a.createElement(r.Popover,{className:"account-menu",onSelection:p},a.createElement(r.PopoverTrigger,{disabled:t,"aria-label":c._("Account menu")},a.createElement(i.Button,{tagName:"span",onClick:this.handleTriggerClick,disabled:t,variant:"circular"},a.createElement(d.ProfilePicture,{src:n}))),a.createElement(r.PopoverContent,{attachment:"right"},a.createElement(o.AccountMenuTitle,null,a.createElement(b,{accountPhotoUrl:n,userDisplayName:A,onClickChangeAvatar:w,accountSpaceUsage:s,quotaBarCTA:u,experiments:N,userIsBasic:E})),y&&a.createElement(v,null),_&&a.createElement(m,null),l&&l.map(g),a.createElement(o.AccountMenuSeparator,null),a.createElement(f,{continuation:h})))},t})(a.PureComponent);t.AccountMenuView=y}),define("modules/clean/react/account_menu/maestro_account_menu",["require","exports","tslib","modules/clean/react/account_menu/account_menu","external/react","modules/constants/account_menu"],function(e,t,n,o,i,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=(function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n.__extends(t,e),t.prototype.render=function(){var e=this.props,t=e.user,n=e.viewer,a=r.SHOW_INSTALL_LINK;return i.createElement(o.AccountMenu,{user:t,viewer:n,dropdownHorizontalDisplacement:-40,showInstallLink:a})},t})(i.Component);t.MaestroAccountMenu=a}),define("modules/clean/react/account_menu/profile_picture",["require","exports","external/react","modules/core/i18n","spectrum/avatar","modules/clean/static_urls"],function(e,t,n,o,i,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=r.static_url("/static/images/avatar/faceholder-32-vflKWtuU5.png"),s=r.static_url("/static/images/avatar/faceholder-32@2x-vflYmh947.png");t.ProfilePicture=function(e){return n.createElement(i.Avatar,{size:e.size,src:e.src||a,srcSet:e.srcSet||(e.src?void 0:s+" 2x"),alt:o._("Account photo")})}}),define("modules/clean/react/account_menu/types",["require","exports"],function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});(function(e){e[e.LOADING=1]="LOADING",e[e.READY=2]="READY",e[e.NOT_APPLICABLE=3]="NOT_APPLICABLE"})(t.AccountSpaceUsageStatus||(t.AccountSpaceUsageStatus={}))}),define("modules/clean/react/account_menu/urls",["require","exports","modules/core/uri","modules/core/i18n","modules/constants/trademark"],function(e,t,n,o,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getLogoutUrl=function(e){return new n.URI({scheme:"https",authority:"www.dropbox.com",path:"/logout",query:e?{cont:e}:void 0}).toString()},t.INSTALL_URL=new n.URI({scheme:"https",authority:"www.dropbox.com",path:"/install"}).toString(),t.SETTINGS_URL=new n.URI({scheme:"https",authority:"www.dropbox.com",path:"/account"}).toString(),t.upsellLinks={UPGRADE_PLANS:{label:o._("Upgrade"),href:new n.URI({scheme:"https",authority:"www.dropbox.com",path:"/plans",query:{trigger:"direct"}}).toString()},TRY_BUSINESS:{label:o._("Try %(trademark_business)s").format({trademark_business:i.TRADEMARK_BUSINESS}),href:new n.URI({scheme:"https",authority:"www.dropbox.com",path:"/business/try",query:{_tk:"dropdown"}}).toString()},UPGRADE_PROFESSIONAL:{label:o._("Upgrade to %(dropbox_professional)s",{comment:"Upsell link in account header dropdown for experiment subgrowth_pro_header_dropdown_propensity"}).format({dropbox_professional:i.DROPBOX_PROFESSIONAL}),href:new n.URI({scheme:"https",authority:"www.dropbox.com",path:"/pro",query:{_tk:"dropdown"}}).toString()}}}),define("modules/clean/react/maestro/header_conditions",["require","exports"],function(e,t){"use strict";function n(e){return!e.is_team_assume_user_session&&!e.is_reseller_session}Object.defineProperty(t,"__esModule",{value:!0}),t.showAccountMenu=n}),define("modules/clean/react/maestro/non_pagelet_top_menu_container",["require","exports","tslib","external/react","modules/clean/react/maestro/top_menu_container","modules/clean/react/account_menu/maestro_account_menu","modules/clean/react/css","modules/clean/react/maestro/header_conditions","modules/clean/react/user_notifications/dropdown","modules/clean/viewer"],function(e,t,n,o,i,r,a,s,c,u){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var l=(function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n.__extends(t,e),t.prototype.renderTopMenus=function(e){var t;return e&&(t=o.createElement(r.MaestroAccountMenu,{user:this.props.user,viewer:this.props.viewer})),[o.createElement("div",{className:"notifications-widget-container",key:"notifications-widget"},o.createElement(c.UserNotificationsDropdown,{isPagelet:!1})),o.createElement("div",{className:"account-menu-widget-container",key:"account-menu-widget"},t)]},t.prototype.render=function(){var e=s.showAccountMenu(this.props.viewer),t=e?"":"top-menu-container--account-menu-hidden",r=n.__assign({},this.props,{rightContent:this.renderTopMenus(e),classNames:t});return o.createElement(i.TopMenuContainer,n.__assign({},r))},t.defaultProps={viewer:u.Viewer.get_viewer()},t})(o.Component);t.NonPageletTopMenuContainer=a(l,["/static/css/pagelet-vflBp79rc.css"],[i.TopMenuContainer,c.UserNotificationsDropdown])}),define("modules/clean/react/maestro/nonpagelet_header",["require","exports","tslib","external/react","modules/clean/react/css","modules/clean/viewer","modules/clean/react/maestro/header","modules/clean/react/maestro/non_pagelet_top_menu_container"],function(e,t,n,o,i,r,a,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var c=(function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n.__extends(t,e),t.prototype.getUser=function(){var e=r.Viewer.get_viewer().get_users();if(0===e.length)throw new Error("No logged in user detected. This header can only be used with a logged in user.");return e[0]},t.prototype.render=function(){var e=o.createElement(s.NonPageletTopMenuContainer,n.__assign({},this.props,{user:this.getUser()}));return o.createElement("div",{className:"maestro"},o.createElement("div",{className:"maestro-header--without-nav"},o.createElement("header",{className:"maestro-header page-header__shadow"},o.createElement("div",{className:"page-header"},o.createElement(a.MaestroHeaderLogo,null),o.createElement("div",{className:"maestro-header--right-content"},e)))))},t.defaultProps={showSearchBar:!1,isSearchBarExpanded:!1},t})(o.Component),u=i(c,["/static/css/maestro_header_without_nav-vflAHAovi.css"],[],!0);t.NonPageletMaestroHeader=u}),define("modules/clean/react/user_notifications/actions",["require","exports","modules/clean/bolt","modules/clean/loggers/notification_logger","modules/clean/loggers/notification_tray_logger","modules/clean/react/user_notifications/api","modules/clean/react/user_notifications/constants","modules/clean/react/user_notifications/dispatcher","modules/clean/react/user_notifications/models","modules/clean/react/user_notifications/store","modules/clean/referrer_cleansing_redirect"],function(e,t,n,o,i,r,a,s,c,u,l){"use strict";return new((function(){function t(){var e=this;this.onUserNotificationUpdate=function(){e.load().then(function(t){var n=e.getBoltChannelStates(t);e.boltClient.update_states(n)},function(){})},this.userNotificationRefreshCallback=function(){e.load().then(function(t){e.boltClient.unsubscribe();var o=e.getBoltChannelStates(t);o.length>0&&(e.boltClient=new n.BoltClient(o,e.onUserNotificationUpdate,e.userNotificationRefreshCallback),e.boltClient.start())},function(){})}}return t.prototype.asyncSharingAction=function(t){e(["modules/clean/react/user_notifications/sharing_actions"],t)},t.prototype.asyncGroupAction=function(t){e(["modules/clean/react/user_notifications/group_actions"],t)},t.prototype.load=function(){return s.userNotificationsDispatcher.dispatch({type:a.ActionTypes.LOAD_REQUEST}),r.getAll(u.userNotificationsStore.getCursor(),this.activeUserOnlyMode).then(function(e){var t=[];return t=t.concat(e.notifications),o.NotificationLogger.logReceive(t),s.userNotificationsDispatcher.dispatch({type:a.ActionTypes.LOAD_SUCCESS,data:e}),e},function(){s.userNotificationsDispatcher.dispatch({type:a.ActionTypes.LOAD_FAILURE})})},t.prototype.loadOnceAndWatch=function(e){var t=this;this.hasLoadedOnce||(this.hasLoadedOnce=!0,this.activeUserOnlyMode=null!=e&&e,this.load().then(function(e){t.watch(e)},function(){}))},t.prototype.acknowledge=function(e){s.userNotificationsDispatcher.dispatch({type:a.ActionTypes.ACKNOWLEDGEMENT_REQUEST_SINGLE,data:{notifications:[e]}}),r.ack(e)},t.prototype.markAllAsSeen=function(){var e=u.userNotificationsStore.getUnseen();0!==e.length&&(r.markAsSeen(e),s.userNotificationsDispatcher.dispatch({type:a.ActionTypes.MARK_AS_SEEN_REQUEST}))},t.prototype.watch=function(e){var t=this.getBoltChannelStates(e);t.length>0&&(this.boltClient=new n.BoltClient(t,this.onUserNotificationUpdate,this.userNotificationRefreshCallback),this.boltClient.start())},t.prototype.getBoltChannelStates=function(e){var t=[];for(var o in e.cursor)if(e.cursor.hasOwnProperty(o)){var i=null,r=window.ensemble;if(r&&r.viewer&&(i=r.viewer.getActiveUser()),!this.activeUserOnlyMode||(null!=i?i.userId:null)===parseInt(o,10)){var a=new n.SignedChannelState("user_notification",o,e.cursor[o],e.boltToken[o]);t.push(a)}}return t},t.prototype.acknowledgeAll=function(){0!==u.userNotificationsStore.getUnacknowledgedCount()&&(i.logMarkAllAsRead(),o.NotificationLogger.logMarkAsRead(u.userNotificationsStore.getUnacknowledged(),o.NotificationLocations.TRAY),s.userNotificationsDispatcher.dispatch({type:a.ActionTypes.ACKNOWLEDGEMENT_REQUEST}),r.ackAll(this.activeUserOnlyMode))},t.prototype.viewNotifications=function(){this.markAllAsSeen()},t.prototype.actionPerformed=function(e,t){o.NotificationLogger.logAction(e,t),e.isUnread&&this.acknowledge(e)},t.prototype.triggerGenericLegacyNotificationAction=function(e){this.actionPerformed(e,"click")},t.prototype.dismissLegacySharingNotification=function(e,t){this.actionPerformed(e,"button_1"),this.asyncSharingAction(function(e){e.registerDismiss(t)})},t.prototype.mountFromLegacySharingNotification=function(e,t){this.actionPerformed(e,"button_0"),this.asyncSharingAction(function(e){e.registerMount(t)})},t.prototype.upgradeToMountFromLegacySharingNotification=function(e){this.actionPerformed(e,"button_0"),this.asyncSharingAction(function(e){e.upgradeToMount()})},t.prototype.triggerBluenoteAction=function(e,t,n){this.actionPerformed(e,n),t.actionType===c.BluenoteActionTypes.OpenUrl?this.performBluenoteOpenUrlAction(t.params):t.actionType===c.BluenoteActionTypes.MountSharedFolder?this.asyncSharingAction(function(n){n.performBluenoteMountSharedFolder(e,t.params)}):t.actionType===c.BluenoteActionTypes.ApproveGroupJoinRequest?this.asyncGroupAction(function(n){n.performBluenoteApproveGroupJoinRequestAction(e,t.params)}):t.actionType===c.BluenoteActionTypes.RemoveGroupJoinRequest&&this.asyncGroupAction(function(n){n.performBluenoteRemoveGroupJoinRequestAction(e,t.params)})},t.prototype.performBluenoteOpenUrlAction=function(e){e.urlPath&&l.redirect(e.urlPath)},t})())}),define("modules/clean/react/user_notifications/api",["require","exports","jquery","modules/clean/ajax","modules/clean/react/user_notifications/api_helper"],function(e,t,n,o,i){"use strict";function r(e,t){void 0===e&&(e=null),void 0===t&&(t=!1);var r={count:100,template_version:5};null!=e&&(r.last_received_nid_by_user_id=JSON.stringify(e));var a;if(t){if(null===e){var s=window,c=s.__REGISTER_NOTIFICATIONS_PREFETCH_HANDLER;if(c)return c.prefetchDeferred||(c.prefetchDeferred=n.Deferred(),c(function(e){c.prefetchDeferred.resolve(i.parseGetAllResponse(e))},function(){return null})),c.prefetchDeferred}a=o.SilentBackgroundRequest({url:"/web/notifications/retrieve_user",data:r,subject_user:window.ensemble.viewer.getActiveUser().userId,dataType:"json"})}else a=o.SilentBackgroundRequest({url:"/web/notifications/retrieve",data:r,dataType:"json"});return a.then(i.parseGetAllResponse)}function a(e){void 0===e&&(e=!1);var t;return t=e?o.SilentBackgroundRequest({url:"/web/notifications/ack_all_user",subject_user:window.ensemble.viewer.getActiveUser().userId,dataType:"json"}):o.SilentBackgroundRequest({url:"/web/notifications/ack_all",dataType:"json"}),t.then(function(e){return e.map(i.userNotificationDeserializer)})}function s(e){o.SilentBackgroundBeaconRequest({url:"/web/notifications/ack",subject_user:e.userId,data:{nids:JSON.stringify([e.id])},dataType:"json"})}function c(e){for(var t={},n=0,i=e;n<i.length;n++){var r=i[n];r.userId&&r.id&&(t[r.userId]||(t[r.userId]=[])).push(r.id)}var a={nids_by_user_id:JSON.stringify(t)};o.SilentBackgroundRequest({url:"/web/notifications/mark_seen",data:a,dataType:"json"})}Object.defineProperty(t,"__esModule",{value:!0});t.getAll=r,t.ackAll=a,t.ack=s,t.markAsSeen=c}),define("modules/clean/react/user_notifications/avatar_icon",["require","exports","tslib","external/react","modules/clean/avatar/initials_avatar","modules/clean/avatar/size"],function(e,t,n,o,i,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=(function(e){function t(t){var n=e.call(this,t)||this,o=null,i=n.props.avatarIconRecord;return null!=i.avatarUrl&&(o=n.props.thumbStore.get_thumb(i.avatarUrl)),n.state={avatarImage:o},n}return n.__extends(t,e),
  t.prototype.componentDidMount=function(){this.bindAvatarUrl(this.props)},t.prototype.componentWillUnmount=function(){this.unbindAvatarUrl()},t.prototype.componentWillReceiveProps=function(e){var t=this.props.avatarIconRecord,n=e.avatarIconRecord;t.avatarUrl!==n.avatarUrl&&(this.unbindAvatarUrl(),this.bindAvatarUrl(e))},t.prototype.bindAvatarUrl=function(e){var t=this,n=e.avatarIconRecord;null!=n.avatarUrl&&(this.thumbRequestId=e.thumbStore.bind_url(n.avatarUrl,{onSuccess:function(){var o=e.thumbStore.get_thumb(n.avatarUrl);t.setState({avatarImage:o})}}))},t.prototype.unbindAvatarUrl=function(){this.props.thumbStore.unbind_url(this.thumbRequestId)},t.prototype.render=function(){var e=this.props.avatarIconRecord;return null!=this.state.avatarImage?o.createElement("img",{className:this.props.className,src:this.state.avatarImage,alt:"",width:this.props.size,height:this.props.size}):o.createElement(i.InitialsAvatarWithColorDerivedFromName,{name:e.avatarInitials,dimension:this.props.size,initials:e.avatarInitials,shape:"CIRCLE",optionalClass:this.props.className})},t.displayName="AvatarIcon",t.defaultProps={size:r.AVATAR_DIMENSION_BY_SIZE.MEDIUM},t})(o.Component);t.AvatarIcon=a}),define("modules/clean/react/user_notifications/dispatcher",["require","exports","modules/clean/flux/dispatcher"],function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.userNotificationsDispatcher=n.Dispatcher}),define("modules/clean/react/user_notifications/dropdown",["require","exports","tslib","external/lodash","external/react","modules/clean/accessibility/tabbable","modules/clean/loggers/notification_logger","modules/clean/loggers/notification_tray_logger","modules/clean/react/css","modules/clean/react/user_notifications/actions","modules/clean/react/user_notifications/dropdown_bell","modules/clean/react/user_notifications/dropdown_body","modules/clean/react/user_notifications/shared/tray_chrome","modules/clean/react/user_notifications/renderer","modules/clean/react/user_notifications/store","modules/constants/notifications","spectrum/popover","modules/core/i18n"],function(e,t,n,o,i,r,a,s,c,u,l,d,p,h,f,m,_,g){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var v=(function(t){function c(e){var n=t.call(this,e)||this;return n.onTrayMount=function(){s.logTrayOpen(n.state.actionableCount),u.viewNotifications()},n.logRenderWrapper=function(e,t){a.NotificationLogger.logRender(e,t,a.NotificationLocations.TRAY)},n.onMenuToggle=function(e){var t=e.isOpen;n.setState({isOpen:t}),c.requireAsyncModules()},n.state={actionableCount:f.userNotificationsStore.getActionableCount(),notifications:f.userNotificationsStore.getAllVisible(),isStoreLoading:f.userNotificationsStore.isLoading(),isDisabled:!0,isOpen:!1},n}return n.__extends(c,t),c.prototype.componentWillMount=function(){new r},c.prototype.componentDidMount=function(){u.loadOnceAndWatch(this.props.isPagelet),this.removeStoreListener=f.userNotificationsStore.addListener(this.onUpdateFromStore.bind(this)),this.onUpdateFromStore();var e=new h.NotificationRenderer;this.notificationRenderFunc=e.renderNotification.bind(e),this.setState(function(e,t){return e.isDisabled=!1,e})},c.prototype.componentWillUnmount=function(){this.removeStoreListener()},c.prototype.onUpdateFromStore=function(){this.setState(function(e,t){return e.actionableCount=f.userNotificationsStore.getActionableCount(),e.notifications=f.userNotificationsStore.getAllVisible(),e.isStoreLoading=f.userNotificationsStore.isLoading(),e})},c.prototype.render=function(){var e;return e=m.SHARED_TRAY_MODULE_ENABLED?i.createElement("div",{id:"event-feed-container"},i.createElement("div",{id:"event-feed"},i.createElement(p.NotificationsTrayChrome,{unreadSectionTitle:g._("Unread"),readSectionTitle:g._("Recent"),notifications:this.state.notifications,markAllAsReadButtonTitle:g._("Mark all as read"),markAllAsReadAction:u.acknowledgeAll,isLoading:this.state.isStoreLoading,loadingMessage:g._("Loading ..."),emptyMessage:g._("You don’t have any notifications yet."),notifRenderFunc:this.notificationRenderFunc,notifLogRenderFunc:this.logRenderWrapper,onTrayMount:this.onTrayMount}))):i.createElement(d.UserNotificationsDropdownBody,null),i.createElement(_.Popover,{onSelection:o.noop,onMenuToggle:this.onMenuToggle},i.createElement(_.PopoverTrigger,{"aria-label":g._("Notifications menu"),className:"notification-button"},i.createElement(l.UserNotificationsDropdownBell,{actionableCount:this.state.actionableCount,isSelected:this.state.isOpen})),i.createElement(_.PopoverContent,{attachment:"right",className:"notifications-popover-content"},i.createElement(_.PopoverContentTitle,null,g._("Notifications")),i.createElement("div",{className:"notifications-dropdown"},e)))},c.displayName="UserNotificationsDropdown",c.requireAsyncModules=o.once(function(){return e(["modules/clean/react/user_notifications/sharing_actions"],function(){return null})}),c.defaultProps={isPagelet:!1,accountMenuVisible:!0},c})(i.Component),b=c(v,["/static/css/scooter/scooter-scoped-vflhQ6850.css","/static/css/spectrum/index.web-vflCr8xOd.css","/static/css/notifications-vflgEpZvD.css"]);t.UserNotificationsDropdown=b}),define("modules/clean/react/user_notifications/dropdown_bell",["require","exports","tslib","spectrum/icon_global","external/react","modules/core/i18n"],function(e,t,n,o,i,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=(function(e){function t(t){var n=e.call(this,t)||this,o=n.props.actionableCount>0;return o&&n.scheduleShakeReset(),n.state={isShaking:o},n}return n.__extends(t,e),t.prototype.componentWillUnmount=function(){clearTimeout(this.shakeResetTimeout)},t.prototype.componentWillReceiveProps=function(e){e.actionableCount>0&&e.actionableCount!==this.props.actionableCount&&(this.setState({isShaking:!0}),this.scheduleShakeReset())},t.prototype.scheduleShakeReset=function(){var e=this;clearTimeout(this.shakeResetTimeout),this.shakeResetTimeout=setTimeout(function(){e.setState({isShaking:!1})},500)},t.prototype.renderBell=function(){return i.createElement(o.IconGlobal,{name:"notifications",className:"mcl-notifications-icon",selected:this.props.isSelected})},t.prototype.renderBadge=function(){return this.props.actionableCount?i.createElement("div",{className:"badge-red-dot"}):null},t.prototype.render=function(){var e="";return this.props.actionableCount>0&&(e=r.ungettext("%(count)s new","%(count)s new",this.props.actionableCount,{comment:"new notification count"}).format({count:this.props.actionableCount})),i.createElement("div",{className:"notification-button-bell-container"},i.createElement("span",{className:"ax-visually-hidden"},e),this.renderBell(),this.renderBadge())},t.defaultProps={actionableCount:0},t})(i.Component);t.UserNotificationsDropdownBell=a}),define("modules/clean/react/user_notifications/dropdown_bluenote_row",["require","exports","tslib","external/classnames","external/purify","external/react","modules/clean/keycode","modules/clean/react/button","modules/clean/react/user_notifications/actions","modules/clean/react/user_notifications/avatar_icon","modules/clean/react/user_notifications/generic_icon","modules/clean/react/user_notifications/models","modules/clean/react/user_notifications/single_task_preview","modules/clean/react/user_notifications/thumbnail_preview"],function(e,t,n,o,i,r,a,s,c,u,l,d,p,h){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var f=(function(t){function f(n){var o=t.call(this,n)||this;return o.handleSurfaceAction=function(){var e=o.props.notification,t=e.typeData.surfaceAction;null!=t&&c.triggerBluenoteAction(e,t,"surface")},o.handleKeyDown=function(e){e.keyCode!==a.KeyCode.ENTER&&e.keyCode!==a.KeyCode.SPACE||o.handleSurfaceAction()},o.handleMountSharedFolderClick=function(t,n,i,r){var a=(n.typeData.buttonActions||[])[r];"V1"===o.state.expSubgrowthProOQWebTraySharedFolder?(t.stopPropagation(),e(["modules/clean/growth/experiments/overquota_helper"],function(e){e.OverquotaHelper.showSubgrowthProOQWebTraySharedFolderModal({oqa:"wb_oq_shm_tray"})})):"V1"===o.state.expSubgrowthProNQWebTraySharedFolder?e(["modules/clean/growth/experiments/overquota_helper"],function(e){e.OverquotaHelper.logExposureSubgrowthProNQWebTraySharedFolder()}):(t.stopPropagation(),c.triggerBluenoteAction(n,a,"button_"+r))},o.state={expSubgrowthProOQWebTraySharedFolder:"CONTROL",expSubgrowthProNQWebTraySharedFolder:"CONTROL"},o}return n.__extends(f,t),f.prototype.componentDidMount=function(){var t=this;e(["modules/clean/growth/experiments/overquota_helper"],function(e){e.OverquotaHelper.getVariantSubgrowthProWebTraySharedFolder().then(function(e){var o=n.__assign({quota:"",variant:""},e);"oq"===o.quota?t.setState({expSubgrowthProOQWebTraySharedFolder:o.variant}):"nq"===o.quota&&t.setState({expSubgrowthProNQWebTraySharedFolder:o.variant})})})},f.prototype.renderNotificationText=function(e){var t=e.typeData.displayMessage;return t?r.createElement("div",{className:"feed-text--button-wrapper"},r.createElement("button",{tabIndex:-1,className:"u-unbutton u-font-left feed-text__button"},r.createElement("div",{className:"feed-text__button-text",dangerouslySetInnerHTML:{__html:i.sanitize(t)}}))):null},f.prototype.renderImage=function(e){var t=e.typeData.icon;return t&&(t.avatarInitials||t.avatarUrl)?r.createElement(u.AvatarIcon,{avatarIconRecord:t,thumbStore:this.props.thumbStore,className:"feed-image feed-image--bluenote"}):r.createElement(l.GenericIcon,{genericIconRecord:t,className:"feed-image feed-image--bluenote"})},f.prototype.renderTimeStamp=function(e){if(this.props.hideDisplayTimestamp)return null;var t=e.displayTime;return r.createElement("span",{className:"feed-time"},t)},f.prototype.renderPreview=function(e){var t=e.typeData.preview;if(!t)return null;var n=null;t.showThumbnail&&e.bluenoteObject&&(n=r.createElement(h.ThumbnailPreview,{object:e.bluenoteObject}));var o=null;t.tasks&&t.tasks.tasks&&t.tasks.tasks.length>0&&t.tasks.tasks[0]&&(o=r.createElement(p.SingleTaskPreview,{task:t.tasks.tasks[0]}));var i=null;return t.quote&&(i=r.createElement("div",{className:"preview-quote"},t.quote)),r.createElement("div",null,n,o,i)},f.prototype.renderButton=function(e,t,n){var o=this;return r.createElement(s.button,{className:"notification u-mar-right-xs u-mar-top-xs",importance:n>0?"tertiary":void 0,onClick:function(i){i.target.disabled=!0;var r=(e.typeData.buttonActions||[])[n];r.actionType===d.BluenoteActionTypes.MountSharedFolder?o.handleMountSharedFolderClick(i,e,t,n):(c.triggerBluenoteAction(e,r,"button_"+n),i.stopPropagation())}},t)},f.prototype.renderButtonActions=function(e){var t=this,n=[];return(e.typeData.buttonActions||[]).forEach(function(o,i){n.push(t.renderButton(e,o.buttonLabel,i))}),n.length>0?r.createElement("span",{className:"feed-action action-available"},n):null},f.prototype.render=function(){var e=this.props.notification,t=e.typeData;if(!t)return null;var n=o({"feed-row":!0,clickable:null!=t.surfaceAction,read:this.props.isAcknowledged});return r.createElement("div",{onClick:this.handleSurfaceAction,onKeyDown:this.handleKeyDown,className:n,role:"button",tabIndex:0},this.renderImage(e),this.renderNotificationText(e),this.renderPreview(e),this.renderTimeStamp(e),this.renderButtonActions(e))},f.displayName="UserNotificationsDropdownBluenoteRow",f})(r.Component);t.UserNotificationsDropdownBluenoteRow=f}),define("modules/clean/react/user_notifications/dropdown_body",["require","exports","tslib","external/react","external/react-dom","jquery","modules/clean/loggers/folder_invite_impression_logger","modules/clean/loggers/notification_logger","modules/clean/loggers/notification_tray_logger","modules/clean/photos/thumb_loading/generic_thumb_store","modules/clean/static_urls","modules/clean/react/user_notifications/actions","modules/clean/react/user_notifications/constants","modules/clean/react/user_notifications/dropdown_row","modules/clean/react/user_notifications/dropdown_bluenote_row","modules/clean/react/user_notifications/event_emitter","modules/clean/react/user_notifications/models","modules/clean/react/user_notifications/store","modules/core/i18n","modules/clean/react/user_notifications/legacy_thumb_loader"],function(e,t,n,o,i,r,a,s,c,u,l,d,p,h,f,m,_,g,v,b){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var y=(function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.onUpdateFromStore=function(){t.setStateFromStore(),t.legacyRender()},t.onScroll=function(){t.hasMore&&t.scrollWithinOffsetToBottom(10)&&t.appendNotifications(10)},t.onMouseScroll=function(e){var n=e.originalEvent||e,o=n.detail?n.detail*-40:n.wheelDelta,r=i.findDOMNode(t);!t.hasMore&&o<=0&&t.scrollWithinOffsetToBottom(0)?e.preventDefault():o>=0&&0===r.scrollTop&&e.preventDefault()},t}return n.__extends(t,e),t.prototype.componentWillMount=function(){this.folderInviteImpressionLogger=new a.FolderInviteImpressionLogger,this.folderInviteImpressionLogger.listenTo(m)},t.prototype.componentDidMount=function(){this.removeStoreListener=g.userNotificationsStore.addListener(this.onUpdateFromStore),this.addEventHandlers(),this.setStateFromStore(),this.legacyRender(),c.logTrayOpen(this.badgeCount),d.viewNotifications()},t.prototype.shouldComponentUpdate=function(){return!1},t.prototype.componentWillUnmount=function(){this.removeStoreListener(),this.folderInviteImpressionLogger.unlistenTo(m)},t.prototype.addEventHandlers=function(){var e=r(i.findDOMNode(this));e.scroll(this.onScroll),e.on("mousewheel",this.onMouseScroll),e.on("DOMMouseScroll",this.onMouseScroll)},t.prototype.setStateFromStore=function(){var e=g.userNotificationsStore.getAll();this.notifications=e.filter(function(e){return!e.isInvisible}),this.isLoading=g.userNotificationsStore.isLoading(),this.badgeCount=g.userNotificationsStore.getActionableCount()},t.prototype.removeNotifications=function(){return r(i.findDOMNode(this)).find("#event-feed").empty(),this.hasMore=this.notifications.length>0},t.prototype.appendNotifications=function(e){var t=r(i.findDOMNode(this)),n=t.find(".feed-row").length,a=this.notifications.slice(n,n+e);s.NotificationLogger.logRender(a,n,s.NotificationLocations.TRAY);for(var c=new u.GenericThumbStore,l=new b.LegacyThumbLoader,d=0,v=a;d<v.length;d++){var y=v[d],S=g.userNotificationsStore.isAcknowledged(y);if(y.rawDropdownRowHtml){var w=document.createElement("div");t.find("#event-feed").append(w),i.render(o.createElement(h,{notification:y,legacyThumbLoader:l,isAcknowledged:S}),w)}else if(y.typeId===_.NotificationTypes.Bluenote){var w=document.createElement("div");t.find("#event-feed").append(w),i.render(o.createElement(f.UserNotificationsDropdownBluenoteRow,{notification:y,thumbStore:c,isAcknowledged:S}),w)}}var N=n+a.length;this.hasMore=N<this.notifications.length,t.toggleClass("empty",0===N),m.emit(p.EventTypes.RENDERED_NOTIFICATIONS,{notifications:a})},t.prototype.scrollWithinOffsetToBottom=function(e){var t=i.findDOMNode(this);return t.scrollHeight-t.scrollTop-t.offsetHeight<=e},t.prototype.legacyRender=function(){this.isLoading||(this.removeNotifications(),this.appendNotifications(10))},t.prototype.render=function(){return o.createElement("div",{id:"event-feed-container",className:"show"},o.createElement("div",{id:"event-feed"},o.createElement("div",{id:"notification-loading"},o.createElement("img",{src:l.static_url("/static/images/icons/ajax-loading-small-vfl3Wt7C_.gif"),alt:v._("Loading...")}))),o.createElement("div",{id:"event-feed-empty"},o.createElement("img",{src:l.static_url("/static/images/empty_notifications-vflQy8YVJ.png"),alt:""}),o.createElement("div",{id:"event-feed-empty-text"},v._("We’ll let you know when we’ve got something new for you!"))))},t.displayName="UserNotificationsDropdownBody",t})(o.Component);t.UserNotificationsDropdownBody=y}),define("modules/clean/react/user_notifications/dropdown_row",["require","exports","tslib","external/react","external/react-dom-factories","external/prop-types","external/lodash","jquery","modules/clean/react/user_notifications/actions","modules/clean/react/user_notifications/legacy_thumb_loader","modules/clean/react/user_notifications/models","modules/clean/sprite","modules/clean/datetime"],function(e,t,n,o,i,r,a,s,c,u,l,d){"use strict";var p=i.div;return(function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._buildLegacyElement=function(e,n){var o=s(t.refs.dropdownLegacyRow);return o.html(e.rawDropdownRowHtml),t._initImages(o),t._setTimeLabel(o,e),t._addClientStateClasses(o,e,n),t._initActionHandlers(e,o),o},t._initImages=function(e){return e.find("img").each(function(e,n){var o=s(n);return o.attr("alt",""),t._loadImage(o)})},t._setTimeLabel=function(e,n){var o=e.find("#feed-time-label");if(null!=o)return t.props.hideDisplayTimestamp?o.text(""):o.text(n.displayTime)},t._loadImage=function(e){var n=e.data("src");if(n)return t.props.legacyThumbLoader.load(n).progress(function(){return e.data("src",null),e.data("loading-src",n)}).then(function(t){e.data("loading-src",null);var n=function(){return e.addClass("thumbnail"),e.parent(".feed-thumbnail").addClass("has-frame")};return 0===t.indexOf("data:image")?n():(e.load(n),e.error(a.once(function(){var t=e.data("fail-src")||d.SPACER;return e.attr("src",t)}))),e.attr("src",t)})},t._addClientStateClasses=function(e,t,n){var o=e.hasClass("feed-row")?e:e.find(".feed-row");if(t.isInvisible&&o.addClass("invisible"),n)return o.addClass("read")},t._initActionHandlers=function(e,t){return t.on("click",function(){return c.triggerGenericLegacyNotificationAction(e),!0}),t.on("click",".share-content-dismiss",function(){return c.dismissLegacySharingNotification(e,this),!1}),t.on("click",".share-content-mount",function(){return c.mountFromLegacySharingNotification(e,this),!1}),t.on("click",".share-content-upgrade-mount",function(){return c.upgradeToMountFromLegacySharingNotification(e),!1})},t}return n.__extends(t,e),t.prototype.componentDidMount=function(){return this._buildLegacyElement(this.props.notification,this.props.isAcknowledged)},t.prototype.render=function(){return p({ref:"dropdownLegacyRow"})},t.displayName="UserNotificationsDropdownRow",t.propTypes={notification:r.instanceOf(l.UserNotification).isRequired,legacyThumbLoader:r.instanceOf(u.LegacyThumbLoader).isRequired,isAcknowledged:r.bool.isRequired,hideDisplayTimestamp:r.bool},t})(o.Component)}),define("modules/clean/react/user_notifications/event_emitter",["require","exports","external/eventemitter3"],function(e,t,n){"use strict";return new n}),define("modules/clean/react/user_notifications/generic_icon",["require","exports","external/react","modules/clean/react/image","modules/clean/static_urls"],function(e,t,n,o,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GenericIcon=function(e){var t=e.genericIconRecord,r=null!=t?t.lowResIconUrl:null,a=null!=t?t.highResIconUrl:null;return null!=r&&null!=a||(r=i.static_url("/static/images/icons32/system_notification_default_icon-vflY4Rt4U.png"),a=i.static_url("/static/images/icons64/system_notification_default_icon-vflc0pSwy.png")),n.createElement("div",{className:e.className},n.createElement(o.Image,{src:r,srcHiRes:a}))},t.GenericIcon.displayName="GenericIcon"}),define("modules/clean/react/user_notifications/legacy_thumb_loader",["require","exports","external/lodash","jquery","modules/clean/photos/batch_thumb_loader"],function(e,t,n,o,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=(function(){function e(){this._cache={};var e=new i.BatchThumbLoader({batch_size:16,max_parallel_requests:24});this._queueThumb=function(t,n,o){return e.queue_thumb(t,n,{onrequest:o})},this._flushQueue=n.debounce(function(){return e.flush()},0)}return e.prototype.load=function(e){if(!this._cache[e]){var t=new o.Deferred;this._queueThumb(e,t.resolve,t.notify),this._flushQueue(),this._cache[e]=t.promise()}return this._cache[e]},e})();t.LegacyThumbLoader=r}),define("modules/clean/react/user_notifications/renderer",["require","exports","external/react","modules/clean/photos/thumb_loading/generic_thumb_store","modules/clean/react/user_notifications/dropdown_bluenote_row","modules/clean/react/user_notifications/dropdown_row","modules/clean/react/user_notifications/legacy_thumb_loader","modules/clean/react/user_notifications/models"],function(e,t,n,o,i,r,a,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var c=(function(){function e(){this.legacyThumbLoader=new a.LegacyThumbLoader,this.genericThumbStore=new o.GenericThumbStore}return e.prototype.renderNotification=function(e,t){return e.rawDropdownRowHtml?n.createElement(r,{notification:e,legacyThumbLoader:this.legacyThumbLoader,isAcknowledged:t,hideDisplayTimestamp:!0}):e.typeId===s.NotificationTypes.Bluenote?n.createElement(i.UserNotificationsDropdownBluenoteRow,{notification:e,thumbStore:this.genericThumbStore,hideDisplayTimestamp:!0,isAcknowledged:t}):null},e})();t.NotificationRenderer=c}),define("modules/clean/react/user_notifications/shared/notification_row_wrapper",["require","exports","tslib","external/classnames","external/react","modules/clean/react/css"],function(e,t,n,o,i,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=(function(e){function t(t){var n=e.call(this,t)||this;return n.state={hover:!1},n.onMouseOver=n.onMouseOver.bind(n),n.onMouseOut=n.onMouseOut.bind(n),n}return n.__extends(t,e),t.prototype.onMouseOver=function(){this.setState({hover:!0})},t.prototype.onMouseOut=function(){this.setState({hover:!1})},t.prototype.renderInfoSheet=function(){var e=o({"notification-row-info-sheet":!0,"notification-row-info-sheet--visible":this.state.hover,"notification-row-info-sheet--unread":this.props.unread});return i.createElement("div",{className:e},i.createElement("div",{className:"notification-row-info-sheet--timestamp"},this.props.timestamp))},t.prototype.render=function(){return i.createElement("div",{className:"notification-row-wrapper",onMouseOver:this.onMouseOver,onMouseOut:this.onMouseOut},this.renderInfoSheet(),this.props.row)},t})(i.Component),s=r(a,["/static/css/user_notifications_shared-vflZTq_On.css"]);t.NotificationRowWrapper=s}),define("modules/clean/react/user_notifications/shared/tray_chrome",["require","exports","tslib","external/react","external/react-dom","modules/clean/react/css","modules/clean/react/user_notifications/shared/tray_section"],function(e,t,n,o,i,r,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var s=(function(e){function t(t){var n=e.call(this,t)||this;n.handleOnScroll=function(){n.scrollWithinOffsetToBottom(10)&&(n.logRendersForPage(n.state.visiblePages),n.setState({visiblePages:n.state.visiblePages+1}))},n.handleOnWheel=function(e){var t=e.originalEvent||e,o=t.deltaY?t.deltaY*-40:t.wheelDelta,r=i.findDOMNode(n);o<=0&&n.scrollWithinOffsetToBottom(0)?e.preventDefault():o>=0&&0===r.scrollTop&&e.preventDefault()};var o=n.processNotifications(n.props.notifications);return n.state={visiblePages:1,unreadNotifications:o.unreadNotifications,readNotifications:o.readNotifications},n}return n.__extends(t,e),t.prototype.componentDidMount=function(){this.props.onTrayMount(),this.logRendersForPage(0)},t.prototype.processNotifications=function(e){var t=this.state&&this.state.unreadNotifications||[],n={};t.forEach(function(e){return n[e.key]=!0});var o=[],i=[];return e.forEach(function(e){e.isUnread||n[e.key]?o.push(e):i.push(e)}),{unreadNotifications:o,readNotifications:i}},t.prototype.logRendersForPage=function(e){var t=this.state.unreadNotifications.concat(this.state.readNotifications).slice(10*e,10*(e+1));this.props.notifLogRenderFunc(t,10*e)},t.prototype.shouldComponentUpdate=function(e,t,n){return!(e.isLoading&&!this.props.isLoading)},t.prototype.componentWillReceiveProps=function(e,t){this.setState(this.processNotifications(e.notifications))},t.prototype.scrollWithinOffsetToBottom=function(e){var t=i.findDOMNode(this);return t.scrollHeight-t.scrollTop-t.offsetHeight<=e},t.prototype.render=function(){if(this.props.isLoading)return o.createElement("div",{className:"notifications-tray--loading"},this.props.loadingMessage);if(0===this.state.unreadNotifications.length&&0===this.state.readNotifications.length)return o.createElement("div",{className:"notifications-tray--empty"},this.props.emptyMessage);var e=this.state.unreadNotifications.slice(0,10*this.state.visiblePages),t=this.state.readNotifications.slice(0,10*this.state.visiblePages-e.length);return o.createElement("div",{className:"notifications-tray--loaded",onScroll:this.handleOnScroll,onWheel:this.handleOnWheel},o.createElement(a.NotificationsTraySection,{notifications:e,sectionTitle:this.props.unreadSectionTitle,actionButtonText:this.props.markAllAsReadButtonTitle,actionButtonAction:this.props.markAllAsReadAction,notifRenderFunc:this.props.notifRenderFunc,isUnreadSection:!0}),o.createElement(a.NotificationsTraySection,{notifications:t,sectionTitle:this.props.readSectionTitle,notifRenderFunc:this.props.notifRenderFunc,isUnreadSection:!1}))},t.displayName="NotificationsTrayChrome",t})(o.Component),c=r(s,["/static/css/user_notifications_shared-vflZTq_On.css"]);t.NotificationsTrayChrome=c}),define("modules/clean/react/user_notifications/shared/tray_section",["require","exports","tslib","external/react","modules/clean/react/css","modules/clean/react/user_notifications/shared/notification_row_wrapper"],function(e,t,n,o,i,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=(function(e){function t(t){var n=e.call(this,t)||this;return n.onClickActionButton=n.onClickActionButton.bind(n),n}return n.__extends(t,e),t.prototype.onClickActionButton=function(){this.props.actionButtonAction&&this.props.actionButtonAction()},t.prototype.renderReadSectionHeader=function(){var e=null;return this.props.actionButtonText&&(e=o.createElement("button",{className:"notifications-tray-section-header--button",onClick:this.onClickActionButton},this.props.actionButtonText)),o.createElement("div",{className:"notifications-tray-section-header"},o.createElement("span",{className:"notifications-tray-section-header--title"},this.props.sectionTitle),e)},t.prototype.render=function(){if(0===this.props.notifications.length)return null;for(var e=[],t=0,n=this.props.notifications;t<n.length;t++){var i=n[t],a=this.props.notifRenderFunc(i,!i.isUnread);null!=a&&e.push(o.createElement(r.NotificationRowWrapper,{row:a,timestamp:i.displayTime,unread:i.isUnread}))}return o.createElement("div",null,this.renderReadSectionHeader(),e)},t})(o.Component),s=i(a,["/static/css/user_notifications_shared-vflZTq_On.css"]);t.NotificationsTraySection=s}),define("modules/clean/react/user_notifications/single_task_preview",["require","exports","tslib","external/classnames","spectrum/checkbox","external/react"],function(e,t,n,o,i,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=(function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n.__extends(t,e),t.prototype.render=function(){var e=this.props.task,t=e.isComplete?"checked":"unchecked",n=o({"preview-single-task--text":!0,"preview-single-task--text--complete":e.isComplete});return r.createElement("div",{className:"preview-single-task"},r.createElement("div",null,r.createElement(i.Checkbox,{className:"preview-single-task--checkbox",checked:t,disabled:!0})),r.createElement("div",{className:n},e.name))},t})(r.Component);t.SingleTaskPreview=a}),define("modules/clean/react/user_notifications/store",["require","exports","tslib","external/lodash","modules/clean/flux/flux_store","modules/clean/react/user_notifications/constants","modules/clean/react/user_notifications/dispatcher","modules/clean/react/user_notifications/models","modules/clean/react/user_notifications/api_helper"],function(e,t,n,o,i,r,a,s,c){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var u=(function(e){function t(t){var n=e.call(this,t)||this;return n.isAcknowledged=function(e){return e.isRead},n.markNotificationAsReadLocally=function(e){e.isUnread&&(e.status=s.NotificationStatuses.Read)},n.isLoadingFlag=!1,n.userNotifications=[],n}return n.__extends(t,e),t.prototype.isLoading=function(){return this.isLoadingFlag},t.prototype.getActionableCount=function(){return this.getUnseenInternal().length},t.prototype.getUnacknowledgedCount=function(){return this.getUnacknowledgedInternal().length},t.prototype.getCursor=function(){return this.cursor},t.prototype.getAll=function(){return this.userNotifications},t.prototype.getAllVisible=function(){return this.userNotifications.filter(function(e){return!e.isInvisible})},t.prototype.getUnacknowledged=function(){return this.getUnacknowledgedInternal()},t.prototype.getUnacknowledgedInternal=function(){return this.userNotifications.filter(function(e){return e.isUnread})},t.prototype.getUnseen=function(){return this.getUnseenInternal()},t.prototype.getUnseenInternal=function(){return this.userNotifications.filter(function(e){return!e.isSeen})},t.prototype.onLoadRequest=function(){this.isLoadingFlag||(this.isLoadingFlag=!0,this.__emitChange())},t.prototype.onLoadSuccess=function(e){if(this.isLoadingFlag&&(this.isLoadingFlag=!1,this.__emitChange()),o.isEqual(e.cursor,this.cursor)||(this.cursor=e.cursor,this.__emitChange()),e.notifications.length>0){var t={};e.notifications.concat(this.userNotifications).forEach(function(e){t[e.key]||(t[e.key]=e)}),this.userNotifications=o.values(t).sort(c.userNotificationComparator),this.__emitChange()}},t.prototype.onLoadFailure=function(){this.isLoadingFlag&&(this.isLoadingFlag=!1,this.__emitChange())},t.prototype.onAcknowledgementRequest=function(){this.userNotifications.forEach(this.markNotificationAsReadLocally),this.__emitChange()},t.prototype.onAcknowledgementRequestSingle=function(e){this.markNotificationAsReadLocally(e),this.__emitChange()},t.prototype.onMarkAsSeenRequest=function(){this.userNotifications.forEach(function(e){e.isSeen||(e.seenState=s.NotificationSeenState.Seen)}),this.__emitChange()},t.prototype.__onDispatch=function(e){switch(e.action.type){case r.ActionTypes.LOAD_REQUEST:this.onLoadRequest();break;case r.ActionTypes.LOAD_SUCCESS:this.onLoadSuccess(e.action.data);break;case r.ActionTypes.LOAD_FAILURE:this.onLoadFailure();break;case r.ActionTypes.ACKNOWLEDGEMENT_REQUEST:this.onAcknowledgementRequest();break;case r.ActionTypes.ACKNOWLEDGEMENT_REQUEST_SINGLE:this.onAcknowledgementRequestSingle(e.action.data.notifications[0]);break;case r.ActionTypes.MARK_AS_SEEN_REQUEST:this.onMarkAsSeenRequest()}},t})(i.FluxStore);t.UserNotificationsStore=u,t.userNotificationsStore=new u(a.userNotificationsDispatcher)}),define("modules/clean/react/user_notifications/thumbnail_preview",["require","exports","tslib","external/react","spectrum/file_icon","spectrum/icon_content"],function(e,t,n,o,i,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={"paper-pad":"paper-small","paper-folder":"folder-small","dropbox-folder":"folder-small"},s=(function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n.__extends(t,e),t.prototype.render=function(){var e=this.props.object||{},t=e.type,n=e.name;return t&&n?o.createElement("div",{className:"preview-thumbnail--wrapper"},o.createElement("div",{className:"preview-thumbnail"},"dropbox-file"===t?o.createElement(i.FileIcon,{path:n,variant:"small",className:"preview-thumbnail--icon"}):o.createElement(r.IconContent,{name:a[t]||"unknown-small",className:"preview-thumbnail--icon"}),o.createElement("div",{className:"preview-thumbnail--text"},n))):null},t.displayName="ThumbnailPreview",t})(o.Component);t.ThumbnailPreview=s}),define("modules/clean/sprite",["require","exports","jquery","modules/clean/static_urls","modules/core/html"],function(e,t,n,o,i){"use strict";return{SPACER:o.static_url("/static/images/icons/icon_spacer-vflN3BYt2.gif"),CLASS_PREFIX:"s_",_make_class:function(e,t){return this.CLASS_PREFIX+e+"_"+t},src:function(e,t,o){return this.clear(e),n(e).addClass(this._make_class(t,o))},replace:function(e,t,o,i){return n(e).removeClass(this._make_class(t,o)).addClass(this._make_class(t,i))},clear:function(e){var t=this,o=e.className.split(" ");return o=n.grep(o,function(e){
  return e&&0!==e.indexOf(t.CLASS_PREFIX)}),e.className=o.join(" ")},make:function(e,t,o){return o=this._prep_attrs(e,t,o),n("<img />",o)[0]},html:function(e,t,n){n=this._prep_attrs(e,t,n);var o=["<img "];for(var r in n)o.push(r,'="',i.HTML._raw_escape(n[r]),'" ');return o.push("/>"),new i.HTML(o.join(""))},_prep_attrs:function(e,t,n){void 0===n&&(n={}),n.src=n.src||this.SPACER;var o=["sprite","sprite_"+e,this._make_class(e,t)];return n.class&&o.push(n.class),n.class=o.join(" "),n},_get:function(e){return e.className},_set:function(e,t){return e.className=t,e.src=this.SPACER}}});
  //# sourceMappingURL=pkg-notifications.min.js-vflQ9L8r3.map