define(["require","exports","tslib","react","modules/clean/analytics","modules/clean/em_string","modules/clean/filepath","modules/clean/react/copy_to_dropbox/actions","modules/clean/react/modal","modules/clean/react_format","modules/clean/share_download/types","modules/clean/share_download/utils","modules/clean/viewer","modules/core/i18n","modules/core/notify"],(function(e,t,o,a,n,r,s,l,m,i,c,d,u,p,_){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),a=o.__importDefault(a),s=o.__importStar(s);var y=(function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.handleAccept=function(){var e=f(t.props.role);_.Notify.success(e),l.copySharedFile(t.props.shareToken,t.props.userId)},t}return o.__extends(t,e),t.prototype.componentDidMount=function(){n.WebMiscActivityLogger.log("show-c2d-modal")},t.prototype.render=function(){var e=this.props,t=e.copyable,o=e.role,n=d.getCopyableName(t),l=d.getCopyableType(t);return a.default.createElement(m.Modal,{title:b(n,o),acceptButtonText:p._("Save"),dismissButtonText:p._("Cancel"),onAccept:this.handleAccept,onDismiss:this.props.onDismiss,style:"default-maestro"},a.default.createElement("p",{className:"db-modal-message"},(function(e,t,o){var n=u.Viewer.get_viewer(),l=n.get_user_by_role(t);if(e=r.Emstring.em_snippet(e,15),l&&l.is_cdm_member)return i.reactFormat(p._("%(name)s will be saved to the %(cdm_tmf_name)s folder in your %(team_name)s Dropbox account."),{name:e,cdm_tmf_name:s.filename(l.cdm_tmf_path),team_name:n.team_name,strong:a.default.createElement("strong",null)});if(n.is_paired)switch(t){case"personal":return i.reactFormat(p._("%(name)s will be saved to your personal Dropbox account and synced to any connected devices."),{name:e,strong:a.default.createElement("strong",null)});case"work":switch(o){case c.CopyableType.Collection:return p._("This album will be instantly saved to your %(team_name)s Dropbox and downloaded to all the computers linked to your %(team_name)s account.").format({team_name:n.team_name});case c.CopyableType.Folder:return p._("This folder will be instantly saved to your %(team_name)s Dropbox and downloaded to all the computers linked to your %(team_name)s account.").format({team_name:n.team_name});default:return p._("This file will be instantly saved to your %(team_name)s Dropbox and downloaded to all the computers linked to your %(team_name)s account.").format({team_name:n.team_name})}}switch(o){case c.CopyableType.Collection:return p._("This album will be instantly saved to your Dropbox and downloaded to all the computers linked to your account.");case c.CopyableType.Folder:return p._("This folder will be instantly saved to your Dropbox and downloaded to all the computers linked to your account.");default:return p._("This file will be instantly saved to your Dropbox and downloaded to all the computers linked to your account.")}})(n,o,l)))},t})(a.default.Component);function f(e){var t=u.Viewer.get_viewer();if(t.is_paired)switch(e){case"personal":return p._("Saving to your personal Dropbox...");case"work":return p._("Saving to your %(team_name)s Dropbox...").format({team_name:t.team_name})}return p._("Saving to your Dropbox...")}function b(e,t){var o=u.Viewer.get_viewer(),a=o.get_user_by_role(t);if(a&&a.is_cdm_member)return p._("Save to your member folder?");if(o.is_paired)switch(t){case"personal":return p._("Save to your personal Dropbox account?");case"work":var n=o.team_name,s=new r.Emstring(n||"").length,l=Math.max(10,15-s);return p._("Save ā%(name)sā to my %(team_name)s Dropbox").format({name:r.Emstring.em_snippet(e,l),team_name:n})}return p._("Save ā%(name)sā to my Dropbox").format({name:r.Emstring.em_snippet(e,15)})}t.CopyToDropboxModal=y}));
//# sourceMappingURL=modal.min.js-vfllMqNRy.map