define("modules/clean/avatar/contact_avatar",["require","exports","tslib","react","prop-types","modules/clean/avatar/avatar_with_default","modules/clean/avatar/initials_avatar","modules/clean/avatar/size","modules/clean/contacts/contact","modules/clean/contacts/types","modules/core/i18n","modules/core/user_i18n"],(function(e,t,n,r,i,o,s,a,l,c,u,d){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),r=n.__importDefault(r),i=n.__importStar(i),o=n.__importDefault(o),c=n.__importDefault(c),d=n.__importStar(d);var p=r.default.createElement,_=(function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n.__extends(t,e),t.prototype.render=function(){var e,t,n=this.props.contact,r=n.name||n.email,i=n.photo_url;n.type===c.default.FB&&(i="https://graph.facebook.com/"+n.fb_id+"/picture");var l="";this.props.dimension!==a.AVATAR_DIMENSION_BY_SIZE.XSMALL&&(l=d.getInitials(r)),n.type===c.default.NEW_STYLE_GROUP?(e=u._("Group"),t="SQUARE"):(e=u._("User"),t="CIRCLE");var _={alt:e,dimension:this.props.dimension,photoUrl:i,shape:t,optionalClass:this.props.optionalClass,defaultAvatar:p(s.InitialsAvatarWithColorDerivedFromName,{alt:e,dimension:this.props.dimension,name:r,initials:l,shape:t,optionalClass:this.props.optionalClass})};return p(o.default,_)},t.displayName="ContactAvatar",t.propTypes={dimension:i.oneOf(a.VALID_AVATAR_DIMENSIONS).isRequired,contact:i.instanceOf(l.Contact).isRequired,optionalClass:i.string},t})(r.default.Component);t.default=_})),define("modules/clean/beacon",["require","exports","tslib","external/lodash","jquery","modules/clean/beacon_nodeps","modules/clean/bolt_nodeps","modules/core/exception"],(function(e,t,n,r,i,o,s,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),r=n.__importStar(r),i=n.__importDefault(i),o=n.__importStar(o),s=n.__importStar(s),a=n.__importStar(a);var l=(function(e){function t(t,n,o){var s=e.call(this,t,n,o,"beacon.dropbox.com",i.default.ajax,r,a)||this;return s._token=t,s._authn_cb=n,s._authz_cb=o,s}return n.__extends(t,e),t})(o.Transmitter);t.Transmitter=l;var c=(function(e){function t(t,n,o){return e.call(this,t,n,o,s,"thunder.dropbox.com",i.default.ajax,r,a)||this}return n.__extends(t,e),t})(o.Receiver);t.Receiver=c,t.Agent=o.Agent,t.AgentStatus=o.AgentStatus,t.Platforms=o.Platforms,t.PresenceParams=o.PresenceParams,t.PresenceType=o.PresenceType,t.Source=o.Source,t.UserAppPresence=o.UserAppPresence,t.UserContextPresence=o.UserContextPresence})),define("modules/clean/beacon_nodeps",["require","exports"],(function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n={WEB:0,IOS:1,ANDROID:2,DESKTOP:3};t.Platforms=n;var r=(function(){function e(e,t,r){void 0===r&&(r=null),this.platform=e,this.surface=t,this.identifier=r;var i=!1;for(var o in n){var s=n[o];if(this.platform===s){i=!0;break}}if(!i)throw new Error("platform must be from Beacon.Platforms");if(this.surface.length>32||0===this.surface.length)throw new Error("surface must be populated and <= 32 chars.");if((null!=this.identifier?this.identifier.length:void 0)>128)throw new Error("identifier must be <= 128 chars.");null===this.identifier&&(this.identifier="")}return e.from_json=function(t){return new e(t.platform,t.surface,t.identifier)},e})();t.Source=r;var i=(function(){function e(e,t,n,r){if(this.user_id=e,this.app=t,this.context=n,this.source=r,this.user_id.length>256)throw new Error("user_id must be <= 256 chars.");if(this.app.length>32||0===this.app.length)throw new Error("app must be populated and <= 32 chars.");if(this.context.length>64||0===this.context.length)throw new Error("context must be populated and <= 64 chars.")}return e.from_json=function(t){var n=r.from_json(t.source);return new e(t.user_id,t.app,t.context,n)},e})();t.Agent=i;var o=(function(){function e(e,t,n){if(void 0===n&&(n=null),this.agent=e,this.status=t,this.auth_key=n,this.status.length>32)throw new Error("status must be <= 32 chars")}return e.from_json=function(t){return new e(i.from_json(t.agent),t.status)},e})();t.AgentStatus=o;var s={UserContext:"UserContext",UserApp:"UserApp",Context:"Context"};t.PresenceType=s;var a=function(e,t,n,r,i){if(this.type=e,this.user_id=t,this.app=n,this.context=r,this.token=i,this.type!==s.UserContext&&this.type!==s.UserApp&&this.type!==s.Context)throw new Error("Unsupported type: "+this.type+".");if((null!=this.user_id?this.user_id.length:void 0)>256)throw new Error("user_id must be <= 256 chars.");if(this.app.length>32)throw new Error("app must be <= 32 chars.");if((null!=this.context?this.context.length:void 0)>64)throw new Error("context must be <= 64 chars.")};t.PresenceParams=a;var l=function(e,t){this.presence_params=e,this.agents=t};t.UserContextPresence=l;var c=(function(){function e(e,t){this.presence_params=e,this.status=t}return e.initClass=function(){this.Status={Offline:1,Online:2}},e})();t.UserAppPresence=c,c.initClass();var u=function(e,t,n){this.presence_params=e,this.snapshot=t,this.delta=n},d=(function(){function e(e,t,n,r,i,o,s){void 0===s&&(s=null),this._heartbeat=this._heartbeat.bind(this),this._handle_heartbeat_success=this._handle_heartbeat_success.bind(this),this._handle_heartbeat_error=this._handle_heartbeat_error.bind(this),this._token=e,this._authn_cb=t,this._authz_cb=n,this._beacon_server=r,this._ajax=i,this._lodash=o,this._exclog=s,this._started=!1,this._heartbeat_xhr=null,this._timeout_id=null,this._presence_data=[],this._offline_agents=[],this._has_changes=!1}return e.prototype.start=function(){if(!this._started)return this._backoff_window=5e3,this._started=!0,this._has_changes=!1,this._heartbeat()},e.prototype.stop=function(){return this._started=!1,this._heartbeat_xhr=null,window.clearTimeout(this._timeout_id),this._timeout_id=null},e.prototype.add_or_update_agents=function(e){for(var t=0,n=Array.from(e);t=400&&e.status<500){if(401===e.status)return window.setTimeout(this._authn_cb,0),void this.stop();400===e.status&&null!=this._exclog&&this._exclog.reportStack("Bad request: "+e.responseText)}var r=Math.random()*this._backoff_window;return this._backoff_window=Math.min(2*this._backoff_window,12e4),this._timeout_id=window.setTimeout(this._heartbeat,r)}},e})();t.Transmitter=d;var p=(function(){function e(e,t,n,r,i,o,s,a){var l=this;void 0===a&&(a=null),this._compact_context_updates=this._compact_context_updates.bind(this),this._on_update=this._on_update.bind(this),this._on_refresh=this._on_refresh.bind(this),this._presence_params=e,this._update_callback=t,this._refresh_callback=n,this._bolt=r,this._thunder_hostname=i,this._ajax=o,this._lodash=s,this._exclog=a;var c=Array.from(this._presence_params).map((function(e){return l._presence_params_to_bolt_channel(e)}));this._thunder_client=new this._bolt.ThunderClient(c,this._on_update,this._on_refresh,this._thunder_hostname,this._ajax,this._lodash,this._exclog)}return e.prototype.start=function(){return this._thunder_client.start()},e.prototype.stop=function(){return this._thunder_client.unsubscribe()},e.prototype.add_presence_params=function(e){var t=this,n=this._presence_params.length;if(this._presence_params=this._lodash.union(e,this._presence_params),this._presence_params.length===n)return!1;this._thunder_client.unsubscribe();var r=Array.from(this._presence_params).map((function(e){return t._presence_params_to_bolt_channel(e)}));return this._thunder_client=new this._bolt.ThunderClient(r,this._on_update,this._on_refresh,this._thunder_hostname,this._ajax,this._lodash,this._exclog),this._thunder_client.start(),!0},e.prototype._presence_params_to_bolt_channel=function(e){switch(e.type){case s.UserContext:return new this._bolt.SignedChannelState("beacon_uc-"+e.app,e.user_id+"|"+e.context,"0",e.token);case s.UserApp:return new this._bolt.SignedChannelState("beacon_ua-"+e.app,e.user_id,"0",e.token);case s.Context:return new this._bolt.SignedChannelState("beacon_c-"+e.app,e.context,"0",e.token);default:throw new Error("Unknown type: "+e.type)}},e.prototype._bolt_channel_to_presence_params=function(e){var t,n=e.app_id.split("-"),r=e.unique_id.split("|");if(2!==n.length)throw new Error("Unexpected format of Bolt app_id: "+e.app_id+".");var i=n[1],o="",l="";switch(n[0]){case"beacon_uc":if(2!==r.length)throw new Error("Unexpected format of beacon_uc: "+e.unique_id+".");t=s.UserContext,o=r[0],l=r[1];break;case"beacon_ua":if(1!==r.length)throw new Error("Unexpected format of beacon_ua: "+e.unique_id+".");t=s.UserApp,o=r[0];break;case"beacon_c":if(1!==r.length)throw new Error("Unexpected format of beacon_c: "+e.unique_id+".");t=s.Context,l=r[0];break;default:throw new Error("Unknown Bolt app_id: "+e.app_id+".")}return new a(t,o,i,l,null)},e.prototype._compact_context_updates=function(e,t){for(var n,r,i=!1,o=[],s=0,a=Array.from(t);s",{id:"flash_copy_container"}).append(i.default("
",{id:l})).css({position:"absolute",zIndex:1});(function(e,t){e.on("mouseover",(function(){return t.addClass("hovered")})),e.on("mousedown",(function(){return t.addClass("pressed")})),e.on("mouseout",(function(){return t.removeClass("hovered pressed")})),e.on("mouseup",(function(){return t.removeClass("pressed")}))})(c,t),a.append(c),s.clone_position(c,t,{});var u=(function(e,t){return window.ClipboardSWFRegister=window.ClipboardSWFRegister||{},window.ClipboardSWFRegister[e]=function(){return t()},"ClipboardSWFRegister."+e})(l,n);return window.copyLoaded=function(){var t=i.default("#"+l)[0];return t.setCopyText(e),t.setCallbackFunction(u)},r.embedSWF(o.static_url("/static/swf/copy_clipboard-vflvMcZTC.swf"),l,"100%","100%","6.0.65",!1,!1,{wmode:"transparent",scale:"exactfit",allowScriptAccess:"always"}),c}})),define("modules/clean/components/title_bubble",["require","exports","tslib","classnames","react","react-dom","react-dom-factories","prop-types","jquery","modules/clean/react/css"],(function(e,t,n,r,i,o,s,a,l,c){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),r=n.__importDefault(r),i=n.__importDefault(i),o=n.__importStar(o),s=n.__importStar(s),a=n.__importStar(a),l=n.__importDefault(l);var u=(function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.state={isChildFocused:!1},t}return n.__extends(t,e),t.prototype.componentDidMount=function(){var e=this;l.default(o.findDOMNode(this)).on("focusin.title-bubble",(function(t){return e.setState({isChildFocused:!0})})).on("focusout.title-bubble",(function(t){return e.setState({isChildFocused:!1})})).on("mouseenter.title-bubble",(function(){return"function"==typeof e.props.onMouseEnter?e.props.onMouseEnter():void 0}))},t.prototype.componentWillUnmount=function(){l.default(o.findDOMNode(this)).off("focusin.title-bubble").off("focusout.title-bubble").off("mouseenter.title-bubble")},t.prototype.render=function(){var e=this,t={"c-title-bubble":!0,"is-child-focused":this.state.isChildFocused,"c-title-bubble--respect-line-break":this.props.respectLineBreaks};return t["c-title-bubble--"+this.props.direction.slice(0,1)]=!0,s.div({className:r.default([t,this.props.className]),"data-title":this.props.text,onClick:function(t){if(t.detail>0)return e.setState({isChildFocused:!1})},onMouseLeave:function(){return e.setState({isChildFocused:!1})}},this.props.children)},t.displayName="TitleBubble",t.propTypes={text:a.string.isRequired,direction:a.oneOf(["north","south","east","west"]).isRequired,onMouseEnter:a.func,respectLineBreaks:a.bool,className:a.string},t})(i.default.Component),d=c.requireCssWithComponent(u,["/static/css/scooter/scooter-scoped-vflYtdnTb.css"]);t.default=d})),define("modules/clean/contacts/bloodhound_contacts_v2",["require","exports","tslib","bloodhound","modules/clean/contacts/config","modules/clean/contacts/contact","modules/clean/profile_services/profile_services_link","modules/clean/viewer","modules/core/cookies"],(function(e,t,n,r,i,o,s,a,l){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),r=n.__importDefault(r),i=n.__importStar(i),s=n.__importStar(s);var c={};function u(e,t){(function(e,t){if(!(e.id in c))return;var n=c[e.id];t=t.filter(o.ContactCommon.is_valid),n.clearRemoteCache(),n.clear(),n.add(t)})(e,t.includeForUser(e.id).contacts)}function d(e){var t=document.createElement("a");t.href=e;var n=t.hostname||window.location.hostname;if(-1===n.indexOf(".dropbox.com",n.length-".dropbox.com".length))throw new Error("Cannot send the CSRF token to "+n);return e}t.BloodhoundContactsV2={getOrCreateForUser:function(e){if(e.id in c)return c[e.id];var t,n=i.getSearchConfigForUser(e);if(n.remoteEndpoint){var p=String(e.id);t={url:d(n.remoteEndpoint),prepare:function(e,t){return t.type="POST",t.headers={"X-CSRF-Token":l.Cookies.read("__Host-js_csrf"),"X-Dropbox-Uid":p},t.data={query:JSON.stringify(e)},t.data._subject_uid=p,t},rateLimitBy:"debounce",rateLimitWait:n.remoteDebounceWait}}var _=new r.default({datumTokenizer:o.ContactCommon.get_index_tokens,queryTokenizer:r.default.tokenizers.whitespace,identify:o.ContactCommon.get_key,sufficient:n.sufficientResults,sorter:o.ContactCommon.sorter,local:[],remote:t});if(c[e.id]=_,a.Viewer.get_viewer().is_user_signed_in(e)){var h=n.localCacheStore.getOrCreateForUser(e);h.load_contacts(!1,(function(t){u(e,t),h.register_for_updates("bloodhound_contacts_v2",(function(t){u(e,t)}))}))}return s.LinkedProfileServices.get_linked_profile_services_for_user(e.id).register_for_service_changes("bloodhound_contacts_v2",(function(e){_.clearRemoteCache()})),c[e.id]},search:function(e,n,r,o){var s=t.BloodhoundContactsV2.getOrCreateForUser(e),a=i.getSearchConfigForUser(e);if(!n)return r([]),void(o&&a.remoteEndpoint&&o([]));var l=a.localCacheStore.getOrCreateForUser(e);l.is_loaded()?s.search(n,r,o):l.load_contacts(!1,(function(e){s.search(n,r,o)})),l.refresh_contacts(!1)},getAll:function(e){return t.BloodhoundContactsV2.getOrCreateForUser(e).all()}}})),define("modules/clean/contacts/cache",["require","exports","tslib","modules/clean/ajax","modules/clean/bolt","modules/clean/contacts/cache_type","modules/clean/contacts/list","modules/clean/viewer","modules/core/browser","modules/core/exception"],(function(e,t,n,r,i,o,s,a,l,c){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),r=n.__importStar(r),i=n.__importStar(i),s=n.__importDefault(s),l=n.__importStar(l);var u=(function(){function e(e){this.callbacks={},this.one_time_callbacks=[],this.cached_contacts=null,this._cache_download_name=e,this.should_force_refresh=!1,this.request_perf_records=[],this._config=null}return e.initClass=function(){this.MAX_REQUEST_PERF_RECORDS=20},e.prototype.register_for_updates=function(e,t){this.callbacks[e]=t},e.prototype.unregister_for_updates=function(e){null!=this.callbacks[e]&&delete this.callbacks[e]},e.prototype.get_contacts_count=function(){return null!=this.cached_contacts?this.cached_contacts.length():0},e.prototype.get_downloaded_time=function(){var e=this,t=_(l.performance(),"getEntriesByName",(function(t){return t.getEntriesByName(e._get_contacts_downloaded_mark_name())}));return t&&t.length?t[0].startTime:null},e.prototype.get_request_perf_records=function(){return this.request_perf_records},e.prototype._is_contact_get_or_check_ajax_request=function(e){var t=e.initiatorType,n=e.name;return"xmlhttprequest"===t&&n.endsWith(this._config.getUrl)},e.prototype._find_last_perf_entry=function(e){void 0===e&&(e=500);var t=_(l.performance(),"getEntriesByType",(function(e){return e.getEntriesByType("resource")}));if(null!=t?t.length:void 0)for(var n=Math.min(t.length-1,e);n>=0;n--)if(this._is_contact_get_or_check_ajax_request(t[n]))return t[n];return null},e.prototype._record_perf_stats=function(t){void 0===t&&(t={});var n=this._find_last_perf_entry();if(n&&(t.ttfb=n.responseStart-n.requestStart,t.downloading_time=n.responseEnd-n.responseStart,t.duration=n.duration,this.request_perf_records.push(t),this.request_perf_records.length>e.MAX_REQUEST_PERF_RECORDS))return this.request_perf_records=this.request_perf_records.slice(this.request_perf_records.length-1)},e.prototype._get_request_url=function(){throw new Error("method unimplemented")},e.prototype._get_request_params=function(){throw new Error("method unimplemented")},e.prototype._contacts_loaded_callback=function(e){throw new Error("method unimplemented")},e.prototype._fetch_contacts=function(){var e=this;return r.BackgroundRequest({url:this._get_request_url(),data:this._get_request_params(),success:function(t,n,r){var i=JSON.parse(t);if(e._contacts_loaded_callback(i),e._schedule_fetch)return e._schedule_fetch()}})},e.prototype._get_versioned_params=function(e,t){void 0===t&&(t=!0);var n={version:e};return t&&(n.force_refresh=this.should_force_refresh,this.should_force_refresh=!1),null!=this.digest&&(n.digest=this.digest),null!=this.limit&&(n.limit=this.limit),n},e.prototype._get_contacts_downloaded_mark_name=function(){return this._cache_download_name+"-"+this.instance},e.prototype._is_page_hidden=function(){return null!=window.document.visibilityState&&window.document.hidden},e.prototype._add_one_time_callback=function(e){if(null!=e&&!Array.from(this.one_time_callbacks).includes(e))return this.one_time_callbacks.push(e)},e.prototype._invoke_all_callbacks=function(e){return this._invoke_callbacks(this.one_time_callbacks,e,!0),this._invoke_callbacks(this.callbacks,e,!1)},e.prototype._invoke_one_time_callbacks=function(e){return this._invoke_callbacks(this.one_time_callbacks,e,!0)},e.prototype._invoke_callbacks=function(e,t,n){return(function(){for(var r=[],i=0,o=Array.from(Object.keys(e));it.sort_key?-1:e.sort_key0})),a={},l=function(e){i.BloodhoundContactsV2.search(c.user,e,(function(t){a[e]=r.processMatches(t,void 0,e)}))},c=this,u=0,d=o;u0)return(function(){for(var n=[],r=0,i=Array.from(e);r0&&(o.ttfr=Math.floor(i-s)),r?(o.local_duration=Math.floor(i-s),o.num_local_results=n):(o.remote_duration=Math.floor(i-s),o.num_additional_remote_results=n),o.num_results+=n;return t.contactsDataSource.isSearchLocalOnly()&&r||!r?(o=t._prepareSearchStatsForLogging(o,e,i,!0),t.contact_search_logger.add_timing_record(o),t.contact_search_logger.count_search(o.is_slow),delete t.unfinished_contact_search_queries[e]):void 0}}},t._logSearchBegin=function(e){if(t._shouldLogSearch()&&e){var n=v.performance().now();return t._flush_unfinished_queries_cache(n),t.unfinished_contact_search_queries[e]={begin_time:n,num_results:0}}},t._shouldLogSearch=function(){return t.props.shouldLogContactSearch&&null!=t.contact_search_logger&&null!=I(v.performance(),(function(e){return e.now}))},t._flush_unfinished_queries_cache=function(e){if(t._shouldLogSearch()){for(var n in null==e&&(e=v.performance().now()),t.unfinished_contact_search_queries){var r=t.unfinished_contact_search_queries[n];e-r.begin_time100:i&&0===e.num_results?e.is_slow=!1:e.is_slow=e.duration>100;var s=t.contactsDataSource.getStats().localContactsDownloadedTime;return e.started_before_download=null==s||o0&&-1===this.state.selectionIndex?this._changeSelectionIndex(0):void 0},shouldComponentUpdate:function(e,t){return!l.isEqual(e,this.props)||!l.isEqual(t,this.state)},getDefaultProps:function(){return{showContactImport:!1,teamGroupInfo:null,onSelect:function(e){},renderQueryOption:function(e){return D(R,{contact:e})}}},onSelectionIndexChange:function(e){return null!=this.refs.pagingList?this.refs.pagingList.scrollAround(e):void 0},render:function(){if(p.require_css("/static/css/react/contacts_typeahead-vflRzfV9H.css"),!this.getOptions().length)return s.div({});var e={"typeahead-selector":!0,"contacts-selector":!0};e[this.props.customClass]=null!=this.props.customClass;var t=this.props.listHeight;return D(v.default,{customClass:r.default(e),pageSize:4,itemSize:54,ref:"pagingList",listHeight:t},this.renderOptions())}});t.ContactsTypeaheadSelector=x;var R=(function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._renderPrimary=function(){return t._renderMatch(t.props.contact.name,t.props.contact.nameMatch)},t._renderSecondary=function(){switch(t.props.contact.type){case u.default.EMAIL:return t.props.contact.email===t.props.contact.name?"":t._renderMatch(t.props.contact.email,t.props.contact.emailMatch);case u.default.FB:return C._("Facebook message");case u.default.NEW_STYLE_GROUP:return t.props.contact.members;default:return""}},t._renderMatch=function(e,t){if(e&&(e=_.Emstring.em_snippet(e,22)),!t)return e;for(var n=e.indexOf("…"),r=0,i=[],o=0,a=Array.from(t.highlighted);or&&i.push(e.slice(r,c));var d=c+u;d>n&&-1!==n&&(d=n);var p=e.slice(c,d);i.push(s.strong({key:"highlight-"+p+"-"+c},p)),r=d}return rn.props.lastDay&&e.setTime(n.props.lastDay.getTime())},n.getDaysInMonth=function(e){return new Date(e.getFullYear(),e.getMonth()+1,0).getDate()},n.setPrevMonthButtonRef=function(e){n.refPrevButton=e},n.setNextMonthButtonRef=function(e){n.refNextButton=e},n.setCurrentDayButtonRefAndMaintainFocus=function(e){var t=document.activeElement&&document.activeElement.getAttribute("data-day-in-month");n.refCurrentDayButton=e,n.refCurrentDayButton&&t&&n.refCurrentDayButton.focus()},n.handleDayClicked=function(e){var t=e.target,r=parseInt(t.getAttribute("data-day-in-month")||"",10),i=new Date(n.state.viewDate.getFullYear(),n.state.viewDate.getMonth(),r);n.setState({currentlyActiveDate:i}),n.props.onDateChange(i)},n.handleKeyDownOnDay=function(e){if(27===e.which)return n.props.onEscapePressed(),void e.preventDefault();if(9===e.which){var t=void 0,r=n.refNextButton.classList.contains("u-l-dn")?null:n.refNextButton,i=n.refPrevButton.classList.contains("u-l-dn")?null:n.refPrevButton;return(t=e.shiftKey?r||i:i||r)&&t.focus(),void e.preventDefault()}if(-1!==[p,_,h,d].indexOf(e.which)){var o=n.getDaysInMonth(n.props.initDate),s=(n.state.currentlyActiveDate||n.props.initDate).getDate(),a=null;switch(e.which){case p:a=Math.max(1,s-7);break;case _:a=Math.min(o,s+1);break;case h:a=Math.min(o,s+7);break;case d:a=Math.max(1,s-1)}if(null!=a){var l=new Date(n.state.viewDate.getTime());l.setDate(a),n.clampToFirstLastDate(l),n.setState({currentlyActiveDate:l})}e.preventDefault()}},n.renderDay=function(e,t){var i=!t;n.props.lastDay&&(t=t||e>n.props.lastDay),n.props.firstDay&&(t=t||e0;r--){var i=new Date(t.getFullYear(),t.getMonth(),t.getDate());i.setDate(i.getDate()-r),e.push(n.renderDay(i,!0))}for(var s=new Date(n.state.viewDate.getFullYear(),n.state.viewDate.getMonth(),1);s.getMonth()===n.state.viewDate.getMonth();)e.push(n.renderDay(s)),s=new Date(n.state.viewDate.getFullYear(),n.state.viewDate.getMonth(),s.getDate()+1);for(var a=new Date(n.state.viewDate.getFullYear(),n.state.viewDate.getMonth()+1,0);6!==a.getDay();)a=new Date(a.getFullYear(),a.getMonth(),a.getDate()+1),e.push(n.renderDay(a,!0));var l=[],c=[];return e.forEach((function(e,t){c.push(e),(t+1)%7==0&&(l.push(o.default.createElement("tr",{key:"week-"+t},c)),c=[])})),l},n.offsetViewDateByMonth=function(e){n.setState({viewDate:new Date(n.state.viewDate.getFullYear(),n.state.viewDate.getMonth()+e,1)})},n.handleClickNextMonth=function(){n.offsetViewDateByMonth(1)},n.handleClickPrevMonth=function(){n.offsetViewDateByMonth(-1)},n.handleKeyDownMonthButton=function(e){if(27===e.which)return n.props.onEscapePressed(),void e.preventDefault();if(9===e.which){var t=!e.shiftKey,r=void 0,i=n.refNextButton.classList.contains("u-l-dn")?void 0:n.refNextButton,o=n.refPrevButton.classList.contains("u-l-dn")?void 0:n.refPrevButton,s=n.refCurrentDayButton;(r=e.target===n.refPrevButton?t?i||s:s||i:t?s||o:o||s)&&r.focus(),e.preventDefault()}},n.renderMonthChangers=function(){var e=[],t=new Date(n.state.viewDate.getFullYear(),n.state.viewDate.getMonth(),1),i=new Date(n.state.viewDate.getFullYear(),n.state.viewDate.getMonth(),n.getDaysInMonth(n.state.viewDate)),s={"arrow-select":!0,"u-l-dn":t<=n.props.firstDay,"ax-focusable":!0,"u-l-fl":!0};e.push(o.default.createElement("button",{className:r.default(s),onClick:n.handleClickPrevMonth,ref:n.setPrevMonthButtonRef,onKeyDown:n.handleKeyDownMonthButton},o.default.createElement("span",{className:"c-arrow c-arrow--left u-thide"},u._("Previous month"))));var a={"arrow-select":!0,"u-l-dn":i>=n.props.lastDay,"ax-focusable":!0,"u-l-fr":!0};return e.push(o.default.createElement("button",{className:r.default(a),onClick:n.handleClickNextMonth,ref:n.setNextMonthButtonRef,onKeyDown:n.handleKeyDownMonthButton},o.default.createElement("span",{className:"c-arrow c-arrow--right u-thide"},u._("Next month")))),e},n.renderWeekdayRows=function(){return[u._("Sunday"),u._("Monday"),u._("Tuesday"),u._("Wednesday"),u._("Thursday"),u._("Friday"),u._("Saturday")].map((function(e){return o.default.createElement("th",{key:e},o.default.createElement("abbr",{title:e},e.slice(0,3)))}))},n.calendarId=++f,n}return n.__extends(t,e),t.prototype.componentDidMount=function(){this.refCurrentDayButton&&this.refCurrentDayButton.focus()},t.prototype.componentWillUpdate=function(e,t){if(t.viewDate&&t.viewDate.getMonth()!==this.state.viewDate.getMonth()){var n=new Date(t.viewDate.getTime()),r=this.getDaysInMonth(t.viewDate);n.setDate(Math.min(r,this.state.currentlyActiveDate.getDate())),this.clampToFirstLastDate(n),this.setState({currentlyActiveDate:n})}},t.prototype.render=function(){var e={"c-calendar":!0,"c-card":!0,"u-pad-xs":!0,"u-left":this.props.alignAtLeft,"u-right":!this.props.alignAtLeft},t="calendar-header-"+ ++this.calendarId,n=this.renderMonthChangers(),i=n[0],s=n[1],l=o.default.createElement("strong",{id:t,"aria-live":"assertive","aria-atomic":"true"},u._("%(month)s %(year)s",{comment:"For example 'January 2010'. This is used as part of a calendar."}).format({month:a.month_name(this.state.viewDate.getMonth()),year:this.state.viewDate.getFullYear()}));return o.default.createElement("div",{className:r.default(e)},o.default.createElement("div",{className:"c-calendar__nav u-mar-bottom-s u-font-center u-cf"},i,s,l),o.default.createElement("table",{className:"c-calendar__picker"},o.default.createElement("thead",{className:"ax-visually-hidden"},o.default.createElement("tr",null,this.renderWeekdayRows())),o.default.createElement("tbody",null,this.renderDays())))},t.displayName="CalendarView",t.defaultProps={onDateChange:m,onEscapePressed:m,alignAtLeft:!1},t})(o.default.Component);t.CalendarView=w,t.Calendar=l.requireCssWithComponent(g,["/static/css/scooter/scooter-scoped-vflYtdnTb.css","/static/css/components/calendar-vflO2TC4l.css"])})),define("modules/clean/react/overquota_modal_helpers",["require","exports"],(function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.constructImageObject=function(e){void 0===e&&(e="");var t=function(e){return"/static/images/pro/overquota/"+e+".png"},n=function(e,n,r){return{height:r,width:n,src:t(e),srcHiRes:t(e+"@2x")}};switch(e){case"V1":return n("illo-catbox",138,98);case"V2":return n("illo-clown-car",138,111);default:return n("overquota-folder",130,90)}}})),define("modules/clean/react/pass/constants",["require","exports"],(function(e,t){"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.ActionTypes={PASS_PERMISSION_REQUEST:"PASS_PERMISSION_REQUEST",UPDATE_PERMISSIONS:"UPDATE_PERMISSIONS",FETCH_PASS_CONCLUDED:"FETCH_PASS_CONCLUDED",FETCH_PASS_ERROR:"FETCH_PASS_ERROR",RECEIVE_PRESENCE_DELTA:"RECEIVE_PRESENCE_DELTA",RECEIVE_PRESENCE_SNAPSHOT:"RECEIVE_PRESENCE_SNAPSHOT",RESET_PASS_INFO:"RESET_PASS_INFO",UPDATE_SEEN_STATE_INFO:"UPDATE_SEEN_STATE_INFO",UPDATE_SEEN_STATE_INFO_CONTINUE:"UPDATE_SEEN_STATE_INFO_CONTINUE",DISCONTINUE_SEEN_STATE_INFO:"DISCONTINUE_SEEN_STATE_INFO",UPDATE_SEEN_STATE_UNAVAILABLE:"FETCH_SEEN_STATE_UNAVAILABLE"},t.EventTypes={PASS_CLICK:"PASS_CLICK",PASS_SHOWN:"PASS_SHOWN",PASS_HOVER:"PASS_HOVER"},t.LoggingActions={STATUS_BEGIN:"status_begin",STATUS_RECEIVE:"status_receive",SEEN_STATE_BEGIN:"seen_state_begin",SEEN_STATE_RECEIVE:"seen_state_receive",SEEN_STATE_USERS_BEGIN:"seen_state_users_begin",SEEN_STATE_USERS_RECEIVE:"seen_state_users_receive",TRANSMITTER_TOKEN_BEGIN:"transmitter_token_begin",TRANSMITTER_TOKEN_RECEIVE:"transmitter_token_receive",RECEIVER_TOKEN_BEGIN:"receiver_token_begin",RECEIVER_TOKEN_RECEIVE:"receiver_token_receive",PRESENCE_RECEIVE:"presence_receive",MEMBER_COUNTS_BEGIN:"member_counts_begin",MEMBER_COUNTS_RECEIVE:"member_counts_receive",LIST_MEMBERS_BEGIN:"list_members_begin",LIST_MEMBERS_RECEIVE:"list_members_receive",LIST_MEMBERS_NO_SEEN_STATE:"list_members_no_seen_state"},(function(e){e[e.NOT_YET_KNOWN=0]="NOT_YET_KNOWN",e[e.FETCHING=1]="FETCHING",e[e.ERROR=2]="ERROR",e[e.SEEN_STATE_SUCCESS=3]="SEEN_STATE_SUCCESS",e[e.SEEN_STATE_DISALLOWED=4]="SEEN_STATE_DISALLOWED",e[e.PRESENCE_SUCCESS=5]="PRESENCE_SUCCESS",e[e.PASS_SUCCESS=6]="PASS_SUCCESS",e[e.PASS_MIXED_SUCCESS=7]="PASS_MIXED_SUCCESS",e[e.CONCLUDED=8]="CONCLUDED"})(n=t.PassFetchingStatus||(t.PassFetchingStatus={})),(function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.WEB=1]="WEB",e[e.MOBILE=2]="MOBILE",e[e.DESKTOP=3]="DESKTOP"})(t.PassPlatform||(t.PassPlatform={})),t.fetchingStatusSeenStateIsComplete=function(e){return-1!==[n.SEEN_STATE_SUCCESS,n.SEEN_STATE_DISALLOWED,n.PASS_SUCCESS,n.PASS_MIXED_SUCCESS,n.CONCLUDED].indexOf(e)},t.fetchingStatusCanLogAsShown=function(e){return e===n.PASS_SUCCESS||e===n.PASS_MIXED_SUCCESS},t.fetchingStatusIsSuccessful=function(e){return-1!==[n.PASS_SUCCESS,n.PASS_MIXED_SUCCESS,n.CONCLUDED].indexOf(e)},t.fetchingStatusIsComplete=function(e){return-1!==[n.PASS_SUCCESS,n.PASS_MIXED_SUCCESS,n.ERROR,n.CONCLUDED].indexOf(e)},t.fetchingStatusIsError=function(e){return e===n.ERROR},t.MAX_FACES_NORMAL=5,t.MAX_OVERFLOW_BUTTON_INDICATOR=99,t.FACEPILE_CLASSNAME="react-pass__facepile",t.FACEPILE_DELAYED_CLASSNAME="react-pass__facepile--delayed",t.PRESENCE_RECEIVED_CLASSNAME="facepile-presence-received",t.EMPTY_FACEPILE_CLASSNAME="react-pass__facepile--empty"})),define("modules/clean/react/pass/utils",["require","exports","tslib","external/lodash","modules/clean/react/pass/constants","modules/core/i18n","modules/core/user_i18n"],(function(e,t,n,r,i,o,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),r=n.__importStar(r),s=n.__importStar(s),(function(e){function t(e){return e.startsWith("dbafvid:")}e.isAnonymousUserId=t,e.isAnonymousSeenState=function(e){return t(e.seen_state_user.user_id)},e.getAnonymousUserIds=function(e){return r.filter(e,t)},e.filterAnonymousUserIds=function(e){return r.reject(e,t)},e.getAnonymousViewerInitials=function(e){return s.isCjkLocale()&&1===e.split(" ").length?e.substring(0,1):s.getInitials(e)}})(t.AnonymousViewerUtils||(t.AnonymousViewerUtils={})),t.parsePlatformString=function(e){switch(e){case"web":return i.PassPlatform.WEB;case"mobile":return i.PassPlatform.MOBILE;case"desktop":return i.PassPlatform.DESKTOP}return i.PassPlatform.UNKNOWN},t.getOnPlatformText=function(e){switch(e){case i.PassPlatform.WEB:return o._("on web");case i.PassPlatform.DESKTOP:return o._("on desktop");case i.PassPlatform.MOBILE:return o._("on mobile")}return null},t.shouldIncrementOverflowBasisForAccessType=function(e){if(e)switch(e.type){case"link_only":case"view_link_access":case"edit_link_access":return!0;case"view_member_access":case"edit_member_access":return e.value.group_access_only}return!1}})),define("modules/clean/react/select",["require","exports","tslib","classnames","create-react-class","react","react-dom","react-dom-factories","prop-types","external/lodash","jquery","modules/clean/keycode","modules/clean/react/form_error_mixin","modules/clean/react/hidden","modules/clean/react/sprite","modules/clean/react/util","modules/core/dom"],(function(e,t,n,r,i,o,s,a,l,c,u,d,p,_,h,m,f){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),r=n.__importDefault(r),i=n.__importDefault(i),o=n.__importDefault(o),s=n.__importStar(s),a=n.__importStar(a),l=n.__importStar(l),c=n.__importStar(c),u=n.__importDefault(u),p=n.__importDefault(p),m=n.__importStar(m),f=n.__importStar(f);var y=o.default.createElement,g=l.oneOfType([l.string,l.number]),v=(function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.state={id:c.uniqueId("option")},t}return n.__extends(t,e),t.prototype.componentWillReceiveProps=function(e){if(null!=e.id)return this.setState({id:e.id})},t.prototype.render=function(){var e={"list-item":!0,"select-option":!0,"select-option-disabled":this.props.disabled};null!=this.props.className&&(e[this.props.className]=!0);var t=this.props.value,n=u.default.extend(!0,{},this.props);return delete n.value,a.div(u.default.extend({"data-value":t},n,{id:this.state.id,role:"option",className:r.default(e),"aria-disabled":this.props.disabled}),this.props.children)},t.displayName="selectOption",t.propTypes={id:l.string,className:l.string,disabled:l.bool,title:l.string,value:g,error:l.shape({message_text:l.string,message_html:l.string})},t})(o.default.Component);t.option=v;var b=i.default({displayName:"selectInput",mixins:[p.default],mouseInput:!0,propTypes:{name:l.string,onChange:l.func,defaultValue:g,style:l.object,value:g,variant:l.string,className:l.string,ariaLabelId:l.string,ariaDescriptionId:l.string,valueLink:l.object,isDisabled:l.bool,headerElement:l.element},getDefaultProps:function(){return{errorWrapperClassName:"select-input-error-wrapper",ariaLabelId:"",ariaDescriptionId:"",style:null,headerElement:null}},getInitialState:function(){return{open:!1,focused:null,keyboarsSelectPrefix:"",selectOptionId:c.uniqueId("selected-option"),listboxId:c.uniqueId("listbox"),value:this.props.defaultValue}},_getFilteredChildren:function(){return c.isArray(this.props.children)?c.filter(this.props.children,(function(e){return e})):this.props.children},render:function(){var e=this,t={"select-input":!0,"select-input-dropdown-shown":this.state.open,"select-input-disabled":this.props.isDisabled};this.props.variant&&(t[this.props.variant]=!0),this.props.className&&(t[this.props.className]=!0);var n={"list-menu":!0,"select-input-dropdown":!0,"select-input-disable-error":this.props["disable-errors"]},i=this.renderErrorIfEnabled(),s=this.props.ariaDescriptionId;((null!=this.props.error?this.props.error.message_text:void 0)||null!=(null!=this.props.error?this.props.error.message_html:void 0))&&(s=i.props.id);var l,c=this.selectedOption();return a.div({className:r.default(t),style:this.props.style,ref:"wrapperDiv"},i,a.button({className:"select-input-button","aria-expanded":this.state.open,"aria-describedby":s,"aria-controls":this.state.listboxId,"aria-labelledby":this.props.ariaLabelId+" "+c.props.id,ref:"selectButton",tabIndex:0,onClick:this.handleClickOnInputButton},a.div({className:"select-input-input filter-item__filter-input",ref:"label"},c,a.div({className:"select-input-dropdown-arrow"},y(h.Sprite,{group:"web",name:"arrow-down-gray",alt:""})))),y(_.HiddenSelect,{name:this.props.name,defaultValue:this.props.defaultValue,value:this.getValue(),options:(l=[],o.default.Children.forEach(e._getFilteredChildren(),(function(e){return l.push(e.props.value)})),l)}),a.div({className:"hidden-option-container"},a.div({id:this.state.listboxId,className:r.default(n),role:"listbox",onKeyDown:this.handleKeydown,onMouseMove:this.handleMouseMove,tabIndex:-1,ref:"dropdown"},this.menuChildren())))},handleMouseMove:function(e){var t;if(!this.props.isDisabled){e.pageX===n&&e.pageY===t||(this.mouseInput=!0);var n=e.pageX;return e.pageY}},_commonPrefixLen:function(e,t){e=e.trim().toLowerCase(),t=t.trim().toLowerCase();for(var n=0;n=this._commonPrefixLen(e,r.text)?this.setState({keyboarsSelectPrefix:e,focused:n.value}):this.setState({keyboarsSelectPrefix:e,focused:r.value})},handleKeydown:function(e){var t=this;if(!this.props.isDisabled){switch(this.mouseInput=!1,e.keyCode){case d.KeyCode.TAB:return this.setState({open:!1,focused:null}),!0;case d.KeyCode.ENTER:case d.KeyCode.SPACE:this.state.open&&this.state.focused?(this.setValue(this.state.focused),this.setState({open:!1})):this.toggle();break;case d.KeyCode.ESC:if(this.state.open){var n=this.getValue();this.setValue(n),this.setState({open:!1})}break;case d.KeyCode.UP:this.state.open?this.setState({focused:this.prev(this.state.focused)}):this.setState({open:!0});break;case d.KeyCode.DOWN:this.state.open?this.setState({focused:this.next(this.state.focused)}):this.setState({open:!0});break;default:if(!this.state.open)return!0;if(!c.values(d.KeyCode).includes(e.keyCode)){var r=String.fromCharCode(e.which),i=this.state.keyboarsSelectPrefix+r;this._keyboardSelect(i),this._keyboardSelect_timeout&&clearTimeout(this._keyboardSelect_timeout),this._keyboardSelect_timeout=setTimeout((function(){return t.setState({keyboarsSelectPrefix:""}),t._keyboardSelect_timeout=null}),500)}}return!1}},prev:function(e){var t=null,n=null;return o.default.Children.forEach(this._getFilteredChildren(),(function(r){if(n||r.props.disabled||(n=r),r.props.value===e&&(t=n),!r.props.disabled)return n=r})),null!=t?t.props.value:void 0},next:function(e){var t,n,r=null,i=null;return o.default.Children.forEach(this._getFilteredChildren(),(function(t){if(!t.props.disabled)return(null!=i?i.props.value:void 0)===e&&(r=t),i=t})),n=function(e){return e.props.value},null!=(t=r||i)?n(t):void 0},menuChildren:function(){var e=this,t=this.getValue();return o.default.Children.map(this._getFilteredChildren(),(function(n){return o.default.cloneElement(n,{onMouseEnter:function(){if(f.scroll_lock_document(),e.mouseInput)return e.setState({focused:n.props.value})},onMouseOut:function(){return f.scroll_unlock_document()},onClick:function(){if(!n.props.disabled)return e.setState({open:!1}),e.setValue(n.props.value)},className:r.default({"focused-option":null!=e.state.focused&&e.state.focused===n.props.value,"selected-option":t===n.props.value},n.props.className)})}))},componentWillMount:function(){var e=o.default.Children.map(this._getFilteredChildren(),(function(e){return{value:e.props.value,text:m.getText(e).trim().toLowerCase()}}));return this.sortedOptions=c.sortBy(e,"text")},componentDidMount:function(){var e=this;return this.globalMenuCloser=function(t){if(e.state.open){var n=u.default(t.target).closest(".select-input");if(!n.length||n[0]!==s.findDOMNode(e.refs.wrapperDiv))return e.setState({open:!1,focused:null})}},u.default(document).on("click",this.globalMenuCloser)},componentWillUnmount:function(){return u.default(document).off("click",this.globalMenuCloser)},componentDidUpdate:function(e,t){var n,r=u.default(s.findDOMNode(this.refs.dropdown)),i=u.default(s.findDOMNode(this.refs.selectButton));this.state.open&&(n=r.find("[data-value='"+this.state.focused+"']"),r.attr("aria-activedescendant",n.attr("id"))),this.state.open&&this.state.focused&&null==this.props.headerElement&&(n=r.find("[data-value='"+this.state.focused+"']"),r.attr("aria-activedescendant",n.attr("id")),(function(e,t){var n=e.scrollTop(),r=n+e.height(),i=t.position().top+n,o=i+t.height();ir&&e.scrollTop(o-e.height())})(r,n));var o=t.open&&!this.state.open;if(!t.open&&this.state.open&&r.focus(),o)return i.focus()},selectedOption:function(){var e=this,t=null;return null!=this.props.headerElement?this.props.headerElement:(o.default.Children.forEach(this._getFilteredChildren(),(function(n){if(t||(t=n),(null!=n?n.props.value:void 0)===e.getValue())return t=n})),t?o.default.cloneElement(t,{id:this.state.selectOptionId}):null)},handleClickOnInputButton:function(e){return e.preventDefault(),this.toggle()},toggle:function(){if(!this.props.isDisabled)return this.state.open?this.setState({open:!1,focused:null}):this.setState({open:!0,focused:this.getValue()})},getValue:function(){var e,t;return null!=(e=null!=(t=null!=this.props.value?this.props.value:null!=this.props.valueLink?this.props.valueLink.value:void 0)?t:this.state.value)?e:this.props.defaultValue},setValue:function(e){var t=this.getValue();if(this.props.valueLink?this.props.valueLink.requestChange(e):this.setState({value:e}),t!==e||null!=this.props.headerElement)return"function"==typeof this.props.onChange?this.props.onChange(t,e):void 0}});t.input=b})),define("modules/clean/sharing/api/client",["require","exports","tslib","immutable","external/lodash","modules/clean/api_v2/error","modules/clean/api_v2/types","modules/clean/api_v2/user_client","modules/clean/sharing/api/types/metadata","modules/clean/sharing/api/util/types","modules/clean/sharing/access_level","modules/clean/sharing/constants","modules/clean/viewer","modules/core/exception","modules/constants/sharing"],(function(e,t,n,r,i,o,s,a,l,c,u,d,p,_,h){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),r=n.__importStar(r),i=n.__importStar(i),t.FilePolicy=l.FilePolicy,t.FolderPolicy=l.FolderPolicy,t.TeamSharingPolicies=l.TeamSharingPolicies,t.parseFolderPolicy=c.parseFolderPolicy;var m=(function(e){function t(t){var n=e.call(this)||this;return n.message=t,n.name="ShareError",n.stack=(new Error).stack,n}return n.__extends(t,e),t})(Error);t.ShareError=m;var f=(function(e){function t(t,n){var r=t.userId,i=t.isNonUserRelativeContext,o=e.call(this,n)||this;return null==i&&(i=!1),o.userId=r,i&&null==o.teamMemberId&&(o.teamMemberId=p.Viewer.get_viewer().work_user.team_member_id),o}return n.__extends(t,e),t.initClass=function(){this.prototype._getAccountBatchCache={},this.prototype._getCurrentAccountCache=null},t.prototype._headers=function(t){var r;return null!=this.teamMemberId?n.__assign(((r={})[s.ApiV2HeaderNames.DropboxApiSelectAdmin]=this.teamMemberId,r),e.prototype._headers.call(this,t)):e.prototype._headers.call(this,t)},t.prototype.validateMembers=function(e){e.contentId,e.accessLevel,e.members;throw new TypeError("Not implemented")},t.prototype._validateMembers=function(e){var t=e.contentId,n=e.contentType,r=e.accessLevel,i=e.members;return this.ns("sharing").rpc("targets/validate",{access_level:c.accessLevelConstToApi(r),content_type:n,content_id:t,members:i},{subjectUserId:this.userId})},t.prototype.addMembers=function(e){e.contentId,e.members,e.accessLevel,e.customMessage,e.quiet,e.addMessageAsComment;throw new TypeError("Not implemented")},t.prototype.addMembersWithAccessLevel=function(e){e.contentId,e.members,e.customMessage,e.quiet;throw new TypeError("Not implemented")},t.prototype.removeMember=function(e){e.contentId,e.memberId;throw new TypeError("Not implemented")},t.prototype.getMetadata=function(e){e.contentId,e.actions;throw new TypeError("Not implemented")},t.prototype.getMetadataInternal=function(e){e.contentId,e.actions;throw new TypeError("Not implemented")},t.prototype.getMetadataAlpha=function(e){e.contentId,e.actions;throw new TypeError("Not implemented")},t.prototype.listMembers=function(e){e.contentId,e.isAlpha;throw new TypeError("Not implemented")},t.prototype.listMembersContinue=function(e){e.cursor,e.isAlpha;throw new TypeError("Not implemented")},t.prototype.getMemberCounts=function(e){e.contentId;throw new TypeError("Not implemented")},t.prototype.getParentFolderAccess=function(e){e.contentId,e.memberId,e.accessLevel;throw new TypeError("Not implemented")},t.prototype.updateMember=function(e){e.contentId,e.memberId,e.accessLevel;throw new TypeError("Not implemented")},t.prototype.dismissInviteNotification=function(e){var t=e.contentId;return this.ns("sharing").rpc("dismiss_invite_notification",{content_id:t},{subjectUserId:this.userId})},t.prototype.getSharingPrefs=function(){return this.ns("users").rpc("get_sharing_prefs",void 0,{subjectUserId:this.userId}).then(c.sharingPrefsApiToRecord)},t.prototype.setSharingPrefs=function(e){return this.ns("users").rpc("set_sharing_prefs",e,{subjectUserId:this.userId})},t.prototype.claimMembership=function(e){var t=e.contentUrl;return this.ns("sharing").rpc("claim_membership",{content_url:t},{subjectUserId:this.userId})},t.prototype.checkJobStatus=function(e){var t=e.jobId;return this.ns("sharing").rpc("check_job_status",{async_job_id:t},{subjectUserId:this.userId})},t.prototype.getAccountBatch=function(e){var t=e.accountIds;return t.length>0?(h.SHARING_EXPERIMENTS.FIX_MAX_ACCOUNT_BATCH_SIZE&&t.length>300&&(t=t.slice(0,300)),this.ns("users").rpc("get_account_batch",{account_ids:t},{subjectUserId:this.userId}).then((function(e){return e.map(c.accountInfoApiToRecord)}))):Promise.resolve([])},t.prototype.getAccountBatchCached=function(e){var t=this,r=e.accountIds,o=this._getAccountBatchCache,s=Array.from(i.partition(r,(function(e){return e in o}))),a=s[0],l=s[1],c=i.values(i.pick(o,a));return this.getAccountBatch({accountIds:l}).then((function(e){var r=i.zipObject(e.map((function(e){return e.account_id})),e);return t._getAccountBatchCache=n.__assign({},o,r),e.concat(c)}))},t.prototype.resetGetAccountBatchCache=function(){return this._getAccountBatchCache={}},t.prototype.getCurrentAccount=function(e){return this.ns("users").rpc("get_current_account",void 0,{subjectUserId:this.userId}).then((function(e){return c.fullAccountApiToRecord(e)}))},t.prototype.getCurrentAccountCached=function(e){return null==this._getCurrentAccountCache&&(this._getCurrentAccountCache=this.getCurrentAccount()),this._getCurrentAccountCache},t.prototype.resetGetCurrentAccountCache=function(){return this._getCurrentAccountCache={}},t.prototype.requestAccess=function(e){var t=e.contentUrl,n=e.customMessage;return this.ns("sharing").rpc("request_access",{content_url:t,custom_message:n},{subjectUserId:this.userId})},t.prototype.sharedLinkInfo=function(e){var t=e.fileIdOrPath;return _.assert(null!=t,"an fqPath or fileId must be present to retrieve shared link info"),this.ns("sharing").rpc("alpha/list_shared_links",{path:t,direct_only:!0},{subjectUserId:this.userId}).then((function(e){return e.links.map((function(e){return c.linkMetadataApiToRecord(e)}))}))},t.prototype.createSharedLink=function(e){var t=e.fileIdOrPath,n=e.settings;return _.assert(null!=t,"an fqPath or fileId must be present to retrieve shared link info"),this.ns("sharing").rpc("alpha/create_shared_link_with_settings",{path:t,settings:n},{subjectUserId:this.userId}).then(c.linkMetadataApiToRecord)},t.prototype.modifySharedLinkSettings=function(e){var t=e.url,n=e.settings,r=e.remove_expiration;return this.ns("sharing").rpc("alpha/modify_shared_link_settings",{url:t,settings:n,remove_expiration:r},{subjectUserId:this.userId}).then(c.linkMetadataApiToRecord)},t.prototype.revokeSharedLink=function(e){var t=e.url;return this.ns("sharing").rpc("revoke_shared_link",{url:t},{subjectUserId:this.userId})},t.prototype._addAccountsToMembership=function(e){return this._addAccountsToMembershipBatch(r.Map([[1,e]])).then((function(e){return e.get(1)}))},t.prototype._addAccountsToMembershipBatch=function(e){var t=e.valueSeq().flatMap((function(e){return e.users.valueSeq()})).map((function(e){return e.memberId()})).toSet().toArray();return t.length>0?this.getAccountBatchCached({accountIds:t}).then((function(t){var n=r.Map(t.map((function(e){return[e.account_id,e]})));return e.map((function(e,t){return e.set("users",e.users.map((function(e){var t=n.get(e.account_id);return null!=t?e.set("account",t):e})))}))})):Promise.resolve(e)},t})(a.UserApiV2Client);t.ShareApiClient=f,f.initClass();var y=(function(e){function t(t){var n=t.userId,r=t.isNonUserRelativeContext,i=e.call(this,{userId:n,isNonUserRelativeContext:r})||this;return i.getMetadata=i.getMetadata.bind(i),i.getMetadataInternal=i.getMetadataInternal.bind(i),i.getMetadataAlpha=i.getMetadataAlpha.bind(i),i.validateFqPath=i.validateFqPath.bind(i),i._promises={},i}return n.__extends(t,e),t.prototype.validateMembers=function(e){e.contentId,e.accessLevel,e.members;return this.createPromise("validateMembers")},t.prototype.addMembers=function(e){e.contentId,e.members,e.accessLevel,e.customMessage,e.quiet,e.addMessageAsComment;return this.createPromise("addMembers")},t.prototype.addMembersWithAccessLevel=function(e){e.contentId,e.members,e.customMessage,e.quiet;return this.createPromise("addMembersWithAccessLevel")},t.prototype.getMetadata=function(e){e.contentId,e.actions;return this.createPromise("getMetadata")},t.prototype.getMetadataInternal=function(e){e.contentId,e.actions;return this.createPromise("getMetadataInternal")},t.prototype.getMetadataAlpha=function(e){e.contentId,e.actions;return this.createPromise("getMetadataAlpha")},t.prototype.dismissInviteNotification=function(e){e.contentId,e.cursor;return this.createPromise("dismissInviteNotification")},t.prototype.getSharingPrefs=function(){return this.createPromise("getSharingPrefs")},t.prototype.listMembers=function(e){e.contentId,e.isAlpha;return this.createPromise("listMembers")},t.prototype.listMembersContinue=function(e){e.cursor,e.isAlpha;return this.createPromise("listMembersContinue")},t.prototype.getMemberCounts=function(e){e.contentId;return this.createPromise("getMemberCounts")},t.prototype.getParentFolderAccess=function(e){e.contentId,e.memberId,e.accessLevel;return this.createPromise("getParentFolderAccess")},t.prototype.removeMember=function(e){e.contentId,e.memberId;return this.createPromise("removeMember")},t.prototype.setLinkSettings=function(e){e.linkSettings,e.url;return this.createPromise("setLinkSettings")},t.prototype.share=function(e){e.fqPath,e.memberPolicy,e.aclUpdatePolicy,e.sharedLinkPolicy,e.forceAsync;return this.createPromise("share")},t.prototype.shareInternal=function(e){e.fqPath,e.folderPolicy,e.forceAsync,e.confidential;return this.createPromise("shareInternal")},t.prototype.requestAccess=function(e){e.contentUrl,e.customMessage;return this.createPromise("requestAccess")},t.prototype.sharedLinkInfo=function(e){e.fileIdOrPath;return this.createPromise("sharedLinkInfo")},t.prototype.transferContent=function(e){e.contentId,e.memberId;return this.createPromise("transferContent")},t.prototype.createSharedLink=function(e){e.fileIdOrPath;return this.createPromise("createSharedLink")},t.prototype.updateMember=function(){return this.createPromise("updateMember")},t.prototype.updatePolicyAlpha=function(){return this.createPromise("updatePolicyAlpha")},t.prototype.validateFqPath=function(e){e.fqPath,e.actions;return this.createPromise("validateFqPath")},t.prototype.getCurrentAccountCached=function(e){return this.createPromise("getCurrentAccountCached")},t.prototype.modifySharedLinkSettings=function(e){e.url,e.settings,e.remove_expiration;return this.createPromise("modifySharedLinkSettings")},t.prototype.revokeSharedLink=function(e){e.url;return this.createPromise("revokeSharedLink")},t.prototype.relinquishMembership=function(e){e.contentId,e.leaveACopy;return this.createPromise("relinquishMembership")},t.prototype.setConfidentiality=function(e){e.contentId,e.confidential,e.keep_inherited_members;return this.createPromise("setConfidentiality")},t.prototype.validatePathContinue=function(e,t){return this.createPromise("validatePathContinue")},t.prototype.createPromise=function(e){var t=this._promises[e];return t&&t.calledBeforeCreatePromise?(this._promises[e]=null,t.promise):((t={}).promise=new Promise((function(e,n){return t.resolve=e,t.reject=n})),this._promises[e]=t,t.promise)},t.prototype.getPromise=function(e){return null!=this._promises[e]?this._promises[e].promise:void 0},t.prototype.resolvePromise=function(e,t,n){void 0===n&&(n=!1),this._promises[e]||this.createPromise(e);var r=this._promises[e];return r.calledBeforeCreatePromise=n,r.resolve.apply(null,t),r.promise},t.prototype.rejectPromise=function(e,t){this._promises[e]||this.createPromise(e);var n=this._promises[e];return n.reject.apply(null,t),n.promise},t})(f);t.MockShareApiClient=y;var g=(function(e){function t(t){var n=t.userId,r=t.isNonUserRelativeContext,i=e.call(this,{userId:n,isNonUserRelativeContext:r})||this;return i.getMetadata=i.getMetadata.bind(i),i.getMetadataAlpha=i.getMetadataAlpha.bind(i),i.getMetadataBatchAlpha=i.getMetadataBatchAlpha.bind(i),i}return n.__extends(t,e),t.prototype.validateMembers=function(e){var t=e.contentId,n=e.accessLevel,r=e.members;return this._validateMembers({accessLevel:n,contentId:t,members:r,contentType:l.ContentTypes.File})},t.prototype.addMembers=function(e){var t=e.contentId,n=e.members,r=e.customMessage,i=void 0===r?null:r,o=e.quiet,s=void 0!==o&&o,a=e.accessLevel,l=e.addMessageAsComment,d=void 0!==l&&l;null==a&&(a=u.ACCESS_LEVEL.READER);var p=c.accessLevelConstToApi(a);return 0===(null!=i?i.length:void 0)&&(i=null),this.ns("sharing").rpc("add_file_member",{file:t,members:n,custom_message:i,quiet:s,access_level:p,add_message_as_comment:d},{subjectUserId:this.userId})},t.prototype.removeMember=function(e){var t=this,n=e.contentId,r=e.memberId;return this.ns("sharing").rpc("remove_file_member_2",{file:n,member:c.makeMemberSelector(r)},{subjectUserId:this.userId}).then((function(e){return c.memberAccessLevelApiToRecord(t.userId,e)}))},t.prototype.getMetadata=function(e){var t=e.contentId,n=e.actions,r=void 0===n?[]:n;return this.ns("sharing").rpc("get_file_metadata",{file:t,actions:r},{subjectUserId:this.userId}).then(c.fileMetadataApiToRecord)},t.prototype.getMetadataAlpha=function(e){var t=e.contentId,n=e.actions,r=void 0===n?[]:n,i=e.sourceURL;return this.ns("sharing").rpc("alpha/get_file_metadata",{file:t,actions:r,url:i},{subjectUserId:this.userId}).then(c.fileMetadataApiToRecord)},t.prototype.getMetadataBatchAlpha=function(e){var t=e.contentIds,n=e.actions,r=void 0===n?[]:n;return this.ns("sharing").rpc("alpha/get_file_metadata/batch",{files:t,actions:r},{subjectUserId:this.userId}).then((function(e){return e.map((function(e){return c.fileMetadataApiToRecord(e.result)}))}))},t.prototype.listMembers=function(e){var t=e.contentId,n=e.url,r=void 0===n?null:n,i=e.limit,o=e.isAlpha,s=void 0!==o&&o,a=e.includeSeenState;null==i&&(i=100),null==a&&(a=!0);var l={file:t,actions:d.MEMBER_ACTION.ALL,include_inherited:!0,limit:i,url:s?r:void 0,include_seen_state:a},u=this.ns("sharing");return(s?u.rpc("alpha/list_file_members",l,{subjectUserId:this.userId}):u.rpc("list_file_members",l,{subjectUserId:this.userId})).then(c.membershipApiToRecord).then(this._addAccountsToMembership.bind(this))},t.prototype.listMembersContinue=function(e){var t=e.cursor,n=e.url,r=void 0===n?null:n,i=e.isAlpha,o=void 0!==i&&i,s={cursor:t,url:o?r:void 0},a=this.ns("sharing");return(o?a.rpc("alpha/list_file_members/continue",s,{subjectUserId:this.userId}):a.rpc("list_file_members/continue",s,{subjectUserId:this.userId})).then((function(e){return c.membershipApiToRecord(e,null)})).then(this._addAccountsToMembership.bind(this))},t.prototype.listMembersBatch=function(e){var t=e.contentIds,n=e.limit;return null==n&&(n=10),this.ns("sharing").rpc("list_file_members/batch",{files:t,limit:n},{subjectUserId:this.userId}).then((function(e){for(var t={},n=0,i=Array.from(e);ni?r():e().then((function(e){switch(e[".tag"]){case"failed":return r(e);case"complete":return t(e);case"in_progress":return window.setTimeout(s,n,t,r)}})).catch(o.catchApiError((function(e){return r(e)})))};return new Promise(s)};function w(e,t){return null!=e?t(e):void 0}})),define("modules/clean/sharing/api/types/metadata",["require","exports","tslib","immutable","modules/clean/api_v2/types"],(function(e,t,n,r,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),r=n.__importStar(r),t.MemberPolicy={team:new i.UnionScalar("team"),anyone:new i.UnionScalar("anyone")},t.AclUpdatePolicy={owner:new i.UnionScalar("owner"),editors:new i.UnionScalar("editors")},t.SharedLinkPolicy={anyone:new i.UnionScalar("anyone"),members:new i.UnionScalar("members")},t.SharedFolderMemberMemberPolicy={team:new i.UnionScalar("team"),anyone:new i.UnionScalar("anyone")},t.SharedFolderJoinPolicy={from_team_only:new i.UnionScalar("from_team_only"),from_anyone:new i.UnionScalar("from_anyone")},t.SharedLinkCreatePolicy={default_public:new i.UnionScalar("default_public"),default_team_only:new i.UnionScalar("default_team_only"),team_only:new i.UnionScalar("team_only")},t.RequestedVisibilityPolicy={policy_name:"requested_visibility",password:"password",public:"public",team_only:"team_only"},t.ResolvedVisibilityPolicy={policy_name:"resolved_visibility",only_you:"only_you",password:"password",public:"public",shared_folder_only:"shared_folder_only",team_and_password:"team_and_password",team_only:"team_only"},t.VisibilityDisallowedReason={delete_and_recreate:"delete_and_recreate",restricted_by_shared_folder:"restricted_by_shared_folder",restricted_by_team:"restricted_by_team",user_account_type:"user_account_type",user_not_on_team:"user_not_on_team",permission_denied:"permission_denied"},t.LinkExpiryPolicy={policy_name:"expires"},t.ViewerInfoPolicy={policy_name:"viewer_info_policy",enabled:"enabled",disabled:"disabled"},t.DownloadPolicy={policy_name:"download_policy",allow:"allow",disallow:"disallow"},t.LinkAudience={public:"public",team:"team",members:"members",default_on:"default_on"},t.GroupManagementType={user_managed:new i.UnionScalar("user_managed"),company_managed:new i.UnionScalar("company_managed"),system_managed:new i.UnionScalar("system_managed")};var o=(function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n.__extends(t,e),t})(r.Record({id:null,name:null},"Team"));t.Team=o;var s=(function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n.__extends(t,e),t})(r.Record({display_name:null,member_id:null,team_info:null},"TeamMemberInfo"));t.TeamMemberInfo=s;var a=(function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n.__extends(t,e),t})(r.Record({id:null,name:null,sharing_policies:null},"FullTeam"));t.FullTeam=a;var l=(function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n.__extends(t,e),t})(r.Record({shared_folder_member_policy:null,shared_folder_join_policy:null,shared_link_create_policy:null},"TeamSharingPolicies"));t.TeamSharingPolicies=l;var c=(function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n.__extends(t,e),t})(r.Record({account_id:null,display_name:null,disabled:!1,email:null,email_verified:!1,familiar_name:null,given_name:null,is_teammate:!1,profile_photo_url:null,surname:null,team_member_id:null},"BasicAccount"));t.BasicAccount=c;var u=(function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n.__extends(t,e),t})(r.Record({account_id:null,display_name:null,disabled:!1,email:null,email_verified:!1,familiar_name:null,given_name:null,profile_photo_url:null,surname:null,team:null,team_member_id:null},"FullAccount"));t.FullAccount=u;var d=(function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n.__extends(t,e),t})(r.Record({allow:!1,reason:null},"PermissionSetting"));t.PermissionSetting=d;var p=(function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n.__extends(t,e),t.prototype.contentId=function(){return this.shared_folder_id||this.path_lower},t.prototype.isSharedFolder=function(){return Boolean(this.shared_folder_id)},t.prototype.isNewSharedFolder=function(){return!this.shared_folder_id},t})(r.Record({access_type:null,is_confidential:!1,is_inside_team_folder:!1,is_team_folder:!1,link_metadata:null,members_cursor:null,name:null,owner_team:null,parent_shared_folder_id:null,path_lower:null,permissions:null,policy:null,preview_url:null,shared_folder_id:null,time_invited:null,can_mount:null,folder_size:null,invite_info:null,parent_folder_name:null},"SharedFolderMetadata"));t.SharedFolderMetadata=p;var _=(function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n.__extends(t,e),t})(r.Record({acl_update_policy:null,download_policy:null,member_policy:null,viewer_info_policy:null,resolved_member_policy:null,shared_link_policy:null},"FolderPolicy"));t.FolderPolicy=_;var h=(function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n.__extends(t,e),t})(r.Record({change_options:null,disable_viewer_info:null,edit_contents:null,enable_viewer_info:null,invite_editor:null,invite_viewer:null,invite_viewer_no_comment:null,leave_a_copy:null,relinquish_membership:null,remove_download_policy:null,set_download_policy:null,update_confidentiality:null,unmount:null,unshare:null,create_link:null},"FolderPermissions"));t.FolderPermissions=h;var m=(function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n.__extends(t,e),t})(r.Record({entries:r.Map(),cursor:null},"ListFoldersResult"));t.ListFoldersResult=m;var f=(function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n.__extends(t,e),t.prototype.contentId=function(){return this.id},t.prototype.isSharedFolder=function(){return!1},t.prototype.isNewSharedFolder=function(){return!1},t})(r.Record({access_type:null,id:null,file_policy:null,link_metadata:null,name:null,owner_team:null,policy:null,parent_shared_folder_id:null,path_display:null,path_lower:null,permissions:null,preview_url:null,time_invited:null,is_cloud_doc:null},"SharedFileMetadata"));t.SharedFileMetadata=f;var y=(function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n.__extends(t,e),t})(r.Record({change_options:null,disable_viewer_info:null,edit_contents:null,enable_viewer_info:null,invite_viewer:null,invite_editor:null,invite_viewer_no_comment:null,relinquish_membership:null,remove_download_policy:null,set_download_policy:null,unshare:null,view_members:null,create_link:null,create_edit_link:null,create_view_link:null,share_message_as_comment:null},"FilePermissions"));t.FilePermissions=y;var g=(function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n.__extends(t,e),t})(r.Record({audience:null,download_policy:null,viewer_info_policy:null},"FilePolicy"));t.FilePolicy=g;var v=(function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n.__extends(t,e),t})(r.Record({entries:r.Map(),cursor:null},"ListFilesResult"));t.ListFilesResult=v;var b,w=(function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n.__extends(t,e),t.prototype.getMemberCount=function(){return this.memberCount||this.invitees.count()+this.groups.count()+this.users.count()},t})(r.Record({cursor:null,invitees:r.Map(),groups:r.Map(),users:r.Map(),memberCount:null},"SharingMembership"));t.SharingMembership=w,t.makeMemberKey=function(e,t){return e+":"+t},(function(e){e.USERS="users",e.GROUPS="groups",e.INVITEES="invitees"})(b=t.MembershipType||(t.MembershipType={}));var k=(function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return n.__extends(r,e),r.prototype.memberId=function(){return this.account_id},r.prototype.memberKey=function(){return t.makeMemberKey(this.is_inherited,this.memberId())},r.prototype.displayName=function(){return this.account?this.account.display_name:void 0},r.prototype.contactId=function(){return this.account_id},r.prototype.contactType=function(){return"dropbox_id"},r.prototype.type=function(){return b.USERS},r.prototype.email=function(){return this.account?this.account.email:void 0},r})(r.Record({access_type:null,inherited_access_type:null,account:null,account_id:null,initials:null,is_inherited:!1,permissions:null,platform_type:null,same_team:null,team_member_id:null,time_last_seen:null},"UserMembershipInfo"));t.UserMembershipInfo=k;var E=(function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return n.__extends(r,e),r.prototype.memberId=function(){return this.contact_type+":"+this.contact},r.prototype.memberKey=function(){return t.makeMemberKey(this.is_inherited,this.memberId())},r.prototype.displayName=function(){return this.contact},r.prototype.contactId=function(){return this.contact},r.prototype.contactType=function(){return"email"},r.prototype.type=function(){return b.INVITEES},r})(r.Record({access_type:null,inherited_access_type:null,contact:null,contact_type:null,initials:!1,is_inherited:null,permissions:null,same_team:null},"InviteeMembershipInfo"));t.InviteeMembershipInfo=E;var S=(function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return n.__extends(r,e),r.prototype.memberId=function(){return this.group_id},r.prototype.memberKey=function(){return t.makeMemberKey(this.is_inherited,this.memberId())},r.prototype.displayName=function(){return this.group_name},r.prototype.contactId=function(){return this.group_id},r.prototype.contactType=function(){return"dropbox_id"},r.prototype.type=function(){return b.GROUPS},r})(r.Record({access_type:null,inherited_access_type:null,group_external_id:null,group_id:null,group_management_type:null,group_name:null,group_type:null,initials:null,is_inherited:!1,is_member:!1,is_owner:!1,member_count:null,permissions:null,same_team:!0},"GroupMembershipInfo"));t.GroupMembershipInfo=S;var C=(function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n.__extends(t,e),t})(r.Record({leave_a_copy:null,make_editor:null,make_owner:null,make_viewer:null,make_viewer_no_comment:null,remove:null},"MemberPermissions"));t.MemberPermissions=C;var A=(function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n.__extends(t,e),t})(r.Record({total_unique_users:null,total_unique_inherited_members:null,users_outside_team:null,exceeds_count:!1},"MemberCounts"));t.MemberCounts=A;var D=(function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n.__extends(t,e),t})(r.Record({access_level:null,warning:null,parentFolders:null},"MemberAccessLevelResult"));t.MemberAccessLevelResult=D;var T=(function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n.__extends(t,e),t})(r.Record({name:null,shared_folder_id:null,path:null,permissions:null},"ParentFolderInfo"));t.ParentFolderInfo=T;var I=(function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n.__extends(t,e),t.prototype.isFolder=function(){return"folder"===this.file_type},t.prototype.teamInfo=function(){return this.content_owner_team_info?this.content_owner_team_info:this.team_member_info?this.team_member_info.team_info:void 0},t.prototype.accessLevel=function(){return this.link_permissions.link_access_level},t.prototype.isRighteousLink=function(){return Boolean(this.link_permissions&&this.link_permissions.audience_options&&this.link_permissions.effective_audience&&this.link_permissions.link_access_level)},t.prototype.canChangePassword=function(){return Boolean(this.link_permissions&&this.link_permissions.require_password?this.link_permissions.can_remove_password:this.link_permissions.can_set_password)},t.prototype.canChangeExpiration=function(){return Boolean(null!=this.expires?this.link_permissions.can_remove_expiry:this.link_permissions.can_set_expiry)},t.prototype.canChangeDownload=function(){return Boolean(this.link_permissions&&this.link_permissions.allow_download?this.link_permissions.can_disallow_download:this.link_permissions.can_allow_download)},t})(r.Record({url:null,client_modified:null,content_owner_team_info:null,expires:null,require_password:null,file_type:null,id:null,link_permissions:null,name:null,path_lower:null,rev:null,server_modified:null,size:null,team_member_info:null,preview_type:null},"LinkMetadata"));t.LinkMetadata=I;var x=(function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n.__extends(t,e),t})(r.Record({requested_visibility:null,link_password:null,expires:null,allow_download:null,audience:null,require_password:null},"LinkPolicy"));t.LinkPolicy=x;var R=(function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n.__extends(t,e),t.prototype.canChangeDownload=function(){return null!=this.can_disallow_download&&null!=this.can_allow_download&&null!=this.allow_download},t})(r.Record({allow_comments:null,can_revoke:null,allow_download:null,can_allow_download:null,can_disallow_download:null,can_set_expiry:null,can_remove_expiry:null,can_set_password:null,can_remove_password:null,require_password:null,effective_audience:null,link_access_level:null,requested_visibility:null,resolved_visibility:null,restricting_shared_folder_path:null,revoke_failure_reason:null,team_restricts_comments:null,visibility_policies:null,audience_options:null,can_use_extended_sharing_controls:null},"LinkPermissions"));t.LinkPermissions=R;var M=(function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n.__extends(t,e),t})(r.Record({policy:null,resolved_policy:null,allowed:null,disallowed_reason:null},"LinkVisibilityPolicy"));t.LinkVisibilityPolicy=M;var P=(function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n.__extends(t,e),t})(r.Record({audience:null,allowed:null},"LinkAudienceOption"));t.LinkAudienceOption=P;var O=(function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n.__extends(t,e),t})(r.Record({in_righteous_link_settings:!1,in_server_side_contact_validation_settings:!1},"SharingPrefs"));t.SharingPrefs=O;var N=(function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n.__extends(t,e),t})(r.Record({shared_folder_id:null,name:null,audience:null},"AudienceRestrictingSharedFolder"));t.AudienceRestrictingSharedFolder=N,t.ContentTypes={File:{".tag":"file"},Folder:{".tag":"folder"}}})),define("modules/clean/sharing/api/util/types",["require","exports","tslib","modules/clean/contacts/types","immutable","modules/clean/api_v2/types","modules/clean/react/pass/utils","modules/clean/sharing/access_level","modules/clean/sharing/link_info","modules/clean/sharing/api/types/metadata"],(function(e,t,n,r,i,o,s,a,l,c){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),r=n.__importDefault(r),i=n.__importStar(i),t.accessLevelConstToApi=function(e){var n=t.rawAccessLevelConstToApi(e);return new o.UnionScalar(n[".tag"])},t.rawAccessLevelConstToApi=function(e){switch(e){case a.ACCESS_LEVEL.OWNER:return{".tag":"owner"};case a.ACCESS_LEVEL.WRITER:return{".tag":"editor"};case a.ACCESS_LEVEL.READER:return{".tag":"viewer"};case a.ACCESS_LEVEL.READER_NO_COMMENT:return{".tag":"viewer_no_comment"};default:throw new Error("unknown access level: "+e)}},t.linkAccessLevelToApi=function(e){return new o.UnionScalar(e)},t.accessLevelApiToConst=function(e){switch(e.type||e){case"owner":return a.ACCESS_LEVEL.OWNER;case"editor":return a.ACCESS_LEVEL.WRITER;case"viewer":return a.ACCESS_LEVEL.READER;case"viewer_no_comment":return a.ACCESS_LEVEL.READER_NO_COMMENT}},t.groupManagementTypeApiToConst=function(e){if(!e)return null;switch(e[".tag"]){case"user_managed":return c.GroupManagementType.user_managed;case"company_managed":return c.GroupManagementType.company_managed;case"system_managed":return c.GroupManagementType.system_managed;default:return}},t.platformTypeApiToConst=function(e){return s.parsePlatformString(e.type)},t.hasFolderMetadataRecordInMetadata=function(e){return null!=e.path_lower&&null!=e.access_type&&null!=e.policy},t.folderPolicyApiToRecord=function(e){return null==e?new c.FolderPolicy:new c.FolderPolicy({acl_update_policy:e.acl_update_policy&&e.acl_update_policy[".tag"],download_policy:e.download_policy&&e.download_policy[".tag"],member_policy:e.member_policy&&e.member_policy[".tag"],resolved_member_policy:e.resolved_member_policy&&e.resolved_member_policy[".tag"],shared_link_policy:e.shared_link_policy&&e.shared_link_policy[".tag"],viewer_info_policy:e.viewer_info_policy&&e.viewer_info_policy[".tag"]})};t.audienceRestrictingSharedFolderToRecord=function(e){return new c.AudienceRestrictingSharedFolder({shared_folder_id:e.shared_folder_id,name:e.name,audience:e.audience[".tag"]})},t.parseFolderPolicy=t.folderPolicyApiToRecord,t.folderPermissionsApiToRecord=function(e){var t=(function(e){for(var t={},n=0,r=e;nAnyone with the link and the password can view this folder. Expires in a day.","Anyone with the link and the password can view this folder. Expires in %(expires_days)s days.",t),{expires_days:t,strong:r.default.createElement("strong",null)});case"public":return o.reactFormat(h("Anyone with the link can view this folder. Expires in a day.","Anyone with the link can view this folder. Expires in %(expires_days)s days.",t),{expires_days:t,strong:r.default.createElement("strong",null)});case"shared_folder_only":return o.reactFormat(h("Members of this folder with the link can view this folder. Expires in a day.","Members of this folder with the link can view this folder. Expires in %(expires_days)s days.",t),{expires_days:t,strong:r.default.createElement("strong",null)});case"team_and_password":return o.reactFormat(h("Anyone on your Dropbox team with the link and the password can view this folder. Expires in a day.","Anyone on your Dropbox team with the link and the password can view this folder. Expires in %(expires_days)s days.",t),{expires_days:t,strong:r.default.createElement("strong",null)});case"team_only":return o.reactFormat(h("Anyone on your Dropbox team with the link can view this folder. Expires in a day.","Anyone on your Dropbox team with the link can view this folder. Expires in %(expires_days)s days.",t),{expires_days:t,strong:r.default.createElement("strong",null)});case"only_you":return o.reactFormat(h("Only you can view via the link. Expires in a day.","Only you can view via the link. Expires in %(expires_days)s days.",t),{expires_days:t,strong:r.default.createElement("strong",null)});default:throw Error("Unknown visibility setting")}else switch(e.link_permissions.resolved_visibility){case"password":return o.reactFormat(h("Anyone with the link and the password can view this file. Expires in a day.","Anyone with the link and the password can view this file. Expires in %(expires_days)s days.",t),{expires_days:t,strong:r.default.createElement("strong",null)});case"public":return o.reactFormat(h("Anyone with the link can view this file. Expires in a day.","Anyone with the link can view this file. Expires in %(expires_days)s days.",t),{expires_days:t,strong:r.default.createElement("strong",null)});case"shared_folder_only":return o.reactFormat(h("Members of the containing shared folder with the link can view this file. Expires in a day.","Members of the containing shared folder with the link can view this file. Expires in %(expires_days)s days.",t),{expires_days:t,strong:r.default.createElement("strong",null)});case"team_and_password":return o.reactFormat(h("Anyone on your Dropbox team with the link and the password can view this file. Expires in a day.","Anyone on your Dropbox team with the link and the password can view this file. Expires in %(expires_days)s days.",t),{expires_days:t,strong:r.default.createElement("strong",null)});case"team_only":return o.reactFormat(h("Anyone on your Dropbox team with the link can view this file. Expires in a day.","Anyone on your Dropbox team with the link can view this file. Expires in %(expires_days)s days.",t),{expires_days:t,strong:r.default.createElement("strong",null)});case"only_you":return o.reactFormat(h("Only you can view via the link. Expires in a day.","Only you can view via the link. Expires in %(expires_days)s days.",t),{expires_days:t,strong:r.default.createElement("strong",null)});default:throw Error("Unknown visibility setting")}})()})(e):(function(e){return(function(){if(e.isFolder())switch(e.link_permissions.resolved_visibility){case"password":return o.reactFormat(_("Anyone with the link and password can view this folder"),{strong:r.default.createElement("strong",null)});case"public":return o.reactFormat(_("Anyone with the link can view this folder"),{strong:r.default.createElement("strong",null)});case"shared_folder_only":return o.reactFormat(_("Members of this folder with this link can view this folder"),{strong:r.default.createElement("strong",null)});case"team_and_password":return o.reactFormat(_("Anyone on your Dropbox team with the link and the password can view this folder"),{strong:r.default.createElement("strong",null)});case"team_only":return o.reactFormat(_("Anyone on your Dropbox team with the link can view this folder"),{strong:r.default.createElement("strong",null)});case"only_you":return o.reactFormat(_("Only you can view via the link."),{strong:r.default.createElement("strong",null)});default:throw Error("Unknown visibility setting")}else switch(e.link_permissions.resolved_visibility){case"password":return o.reactFormat(_("Anyone with the link and password can view this file"),{strong:r.default.createElement("strong",null)});case"public":return o.reactFormat(_("Anyone with the link can view this file"),{strong:r.default.createElement("strong",null)});case"shared_folder_only":return o.reactFormat(_("Members of the containing shared folder with the link can view this file"),{strong:r.default.createElement("strong",null)});case"team_and_password":return o.reactFormat(_("Anyone on your Dropbox team with the link and the password can view this file"),{strong:r.default.createElement("strong",null)});case"team_only":return o.reactFormat(_("Anyone on your Dropbox team with the link can view this file"),{strong:r.default.createElement("strong",null)});case"only_you":return o.reactFormat(_("Only you can view via the link."),{strong:r.default.createElement("strong",null)});default:throw Error("Unknown visibility setting")}})()})(e)},f=function(e){return null!=e.expires?(function(e){c.assert(!!e.expires,"this function should only be used when there is expiry for linkMetadata");var t=e.expires?e.expires.getTime():0,n=(function(){if(null!=e.expires){var n=t-(new Date).getTime();return n<0&&(n=0),Math.floor(n/864e5)}return-1})();return(function(){if(e.isFolder())switch(e.link_permissions.resolved_visibility){case"password":return o.reactFormat(h("Anyone with the link and the password can view this folder. Expires in a day. Downloads disabled.","Anyone with the link and the password can view this folder. Expires in %(expires_days)s days. Downloads disabled.",n),{expires_days:n,strong:r.default.createElement("strong",null)});case"public":return o.reactFormat(h("Anyone with the link can view this folder. Expires in a day. Downloads disabled.","Anyone with the link can view this folder. Expires in %(expires_days)s days. Downloads disabled.",n),{expires_days:n,strong:r.default.createElement("strong",null)});case"shared_folder_only":return o.reactFormat(h("Members of this folder with the link can view this folder. Expires in a day. Downloads disabled.","Members of this folder with the link can view this folder. Expires in %(expires_days)s days. Downloads disabled.",n),{expires_days:n,strong:r.default.createElement("strong",null)});case"team_and_password":return o.reactFormat(h("Anyone on your Dropbox team with the link and the password can view this folder. Expires in a day. Downloads disabled.","Anyone on your Dropbox team with the link and the password can view this folder. Expires in %(expires_days)s days. Downloads disabled.",n),{expires_days:n,strong:r.default.createElement("strong",null)});case"team_only":return o.reactFormat(h("Anyone on your Dropbox team with the link can view this folder. Expires in a day. Downloads disabled.","Anyone on your Dropbox team with the link can view this folder. Expires in %(expires_days)s days. Downloads disabled.",n),{expires_days:n,strong:r.default.createElement("strong",null)});case"only_you":return o.reactFormat(h("Only you can view via the link. Expires in a day. Downloads disabled.","Only you can view via the link. Expires in %(expires_days)s days. Downloads disabled.",n),{expires_days:n,strong:r.default.createElement("strong",null)});default:throw Error("Unknown visibility setting")}else switch(e.link_permissions.resolved_visibility){case"password":return o.reactFormat(h("Anyone with the link and the password can view this file. Expires in a day. Downloads disabled.","Anyone with the link and the password can view this file. Expires in %(expires_days)s days. Downloads disabled.",n),{expires_days:n,strong:r.default.createElement("strong",null)});case"public":return o.reactFormat(h("Anyone with the link can view this file.\nExpires in a day. Downloads disabled.","Anyone with the link can view this file. Expires in %(expires_days)s days. Downloads disabled.",n),{expires_days:n,strong:r.default.createElement("strong",null)});case"shared_folder_only":return o.reactFormat(h("Members of the containing shared folder with the link can view this file.\nExpires in a day. Downloads disabled.","Members of the containing shared folder with the link can view this file. Expires in %(expires_days)s days. Downloads disabled.",n),{expires_days:n,strong:r.default.createElement("strong",null)});case"team_and_password":return o.reactFormat(h("Anyone on your Dropbox team with the link and the password can view this file. Expires in a day. Downloads disabled.","Anyone on your Dropbox team with the link and the password can view this file. Expires in %(expires_days)s days. Downloads disabled.",n),{expires_days:n,strong:r.default.createElement("strong",null)});case"team_only":return o.reactFormat(h("Anyone on your Dropbox team with the link can view this file. Expires in a day. Downloads disabled.","Anyone on your Dropbox team with the link can view this file. Expires in %(expires_days)s days. Downloads disabled.",n),{expires_days:n,strong:r.default.createElement("strong",null)});case"only_you":return o.reactFormat(h("Only you can view via the link. Expires in a day. Downloads disabled.","Only you can view via the link. Expires in %(expires_days)s days. Downloads disabled.",n),{expires_days:n,strong:r.default.createElement("strong",null)});default:throw Error("Unknown visibility setting")}})()})(e):(function(e){return(function(){if(e.isFolder())switch(e.link_permissions.resolved_visibility){case"password":return o.reactFormat(_("Anyone with the link and password can view this folder. Downloads disabled."),{strong:r.default.createElement("strong",null)});case"public":return o.reactFormat(_("Anyone with the link can view this folder. Downloads disabled."),{strong:r.default.createElement("strong",null)});case"shared_folder_only":return o.reactFormat(_("Members of this folder with this link can view this folder. Downloads disabled."),{strong:r.default.createElement("strong",null)});case"team_and_password":return o.reactFormat(_("Anyone on your Dropbox team with the link and the password can view this folder. Downloads disabled."),{strong:r.default.createElement("strong",null)});case"team_only":return o.reactFormat(_("Anyone on your Dropbox team with the link can view this folder. Downloads disabled."),{strong:r.default.createElement("strong",null)});case"only_you":return o.reactFormat(_("Only you can view via the link. Downloads disabled."),{strong:r.default.createElement("strong",null)});default:throw Error("Unknown visibility setting")}else switch(e.link_permissions.resolved_visibility){case"password":return o.reactFormat(_("Anyone with the link and password can view this file. Downloads disabled."),{strong:r.default.createElement("strong",null)});case"public":return o.reactFormat(_("Anyone with the link can view this file. Downloads disabled."),{strong:r.default.createElement("strong",null)});case"shared_folder_only":return o.reactFormat(_("Members of the containing shared folder with the link can view this file. Downloads disabled."),{strong:r.default.createElement("strong",null)});case"team_and_password":return o.reactFormat(_("Anyone on your Dropbox team with the link and the password can view this file. Downloads disabled."),{strong:r.default.createElement("strong",null)});case"team_only":return o.reactFormat(_("Anyone on your Dropbox team with the link can view this file. Downloads disabled."),{strong:r.default.createElement("strong",null)});case"only_you":return o.reactFormat(_("Only you can view via the link. Downloads disabled."),{strong:r.default.createElement("strong",null)});default:throw Error("Unknown visibility setting")}})()})(e)},y=function(e){return!1===e.link_permissions.allow_download?f(e):m(e)};t.formatShmodelLinkDescription=y;var g=function(e,t){switch(e.link_permissions.link_access_level){case"editor":return v(e,t);case"viewer":return b(e,t);default:throw Error("Unknown link access level: %s".format(e.link_permissions.link_access_level))}};t.formatRighteousLinkDescription=g;t.formatLinkDescription=function(e,t){return e.isRighteousLink()?g(e,t):y(e)};t.formatLinkDescriptionPlainText=function(e,t,n){return e.isRighteousLink()?n?d.formatRighteousLinkAdvancedSettingsDescription(e,t):g(e,t):u.formatShmodelLinkDescriptionPlainText(e)};var v=function(e,t){switch(e.link_permissions.effective_audience){case"public":return _("Anyone with this link can edit the file.");case"team":return t?_("Anyone on your %(trademark_business)s team with this link can edit the file.").format({trademark_business:a.TRADEMARK_BUSINESS}):_("Anyone on the %(trademark_business)s team with this link can edit the file.").format({trademark_business:a.TRADEMARK_BUSINESS});case"no_one":return _("Members of the file with this link can edit.");default:throw Error("Unknown link audience: %s".format(e.link_permissions.effective_audience))}},b=function(e,t){switch(e.link_permissions.effective_audience){case"public":return _("Anyone with this link can view the file.");case"team":return t?_("Anyone on your %(trademark_business)s team with this link can view the file.").format({trademark_business:a.TRADEMARK_BUSINESS}):_("Anyone on the %(trademark_business)s team with this link can view the file.").format({trademark_business:a.TRADEMARK_BUSINESS});case"no_one":return _("Members of the file with this link can view.");default:throw Error("Unknown link audience: %s".format(e.link_permissions.effective_audience))}}})),define("modules/clean/sharing/link_description_advanced_settings",["require","exports","tslib","modules/core/i18n","modules/core/exception","modules/constants/trademark"],(function(e,t,n,r,i,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var s=(r=n.__importStar(r)).i18n_default_project("sharing"),a=s._,l=s.ungettext;t.formatRighteousLinkAdvancedSettingsDescription=function(e,t){return!1===e.link_permissions.allow_download?null!=e.expires?!1===e.link_permissions.require_password?f(e,t):y(e,t):!1===e.link_permissions.require_password?p(e,t):u(e,t):null!=e.expires?!1===e.link_permissions.require_password?m(e,t):h(e,t):!1===e.link_permissions.require_password?_(e,t):d(e,t)};var c=function(e){var t=e.expires?e.expires.getTime():0;if(null!=e.expires){var n=t-(new Date).getTime();return n<0&&(n=0),Math.floor(n/864e5)}return-1},u=function(e,t){switch(e.link_permissions.link_access_level){case"editor":switch(e.link_permissions.effective_audience){case"public":return a("Anyone with this link and password can edit the file. Downloads disabled.");case"team":return t?a("Anyone on your %(trademark_business)s team with this link and password can edit the file. Downloads disabled.").format({trademark_business:o.TRADEMARK_BUSINESS}):a("Anyone on the %(trademark_business)s team with this link and password can edit the file. Downloads disabled.").format({trademark_business:o.TRADEMARK_BUSINESS});case"no_one":return a("Members of the file with this link and password can edit. Downloads disabled.");default:throw Error("Unknown link audience: %s".format(e.link_permissions.effective_audience))}case"viewer":switch(e.link_permissions.effective_audience){case"public":return a("Anyone with this link and password can view the file. Downloads disabled.");case"team":return t?a("Anyone on your %(trademark_business)s team with this link and password can view the file. Downloads disabled.").format({trademark_business:o.TRADEMARK_BUSINESS}):a("Anyone on the %(trademark_business)s team with this link and password can view the file. Downloads disabled.").format({trademark_business:o.TRADEMARK_BUSINESS});case"no_one":return a("Members of the file with this link and password can view. Downloads disabled.");default:throw Error("Unknown link audience: %s".format(e.link_permissions.effective_audience))}default:throw Error("Unknown link access level: %s".format(e.link_permissions.link_access_level))}},d=function(e,t){switch(e.link_permissions.link_access_level){case"editor":switch(e.link_permissions.effective_audience){case"public":return a("Anyone with this link and password can edit the file.");case"team":return t?a("Anyone on your %(trademark_business)s team with this link and password can edit the file.").format({trademark_business:o.TRADEMARK_BUSINESS}):a("Anyone on the %(trademark_business)s team with this link and password can edit the file.").format({trademark_business:o.TRADEMARK_BUSINESS});case"no_one":return a("Members of the file with this link and password can edit.");default:throw Error("Unknown link audience: %s".format(e.link_permissions.effective_audience))}case"viewer":switch(e.link_permissions.effective_audience){case"public":return a("Anyone with this link and password can view the file.");case"team":return t?a("Anyone on your %(trademark_business)s team with this link and password can view the file.").format({trademark_business:o.TRADEMARK_BUSINESS}):a("Anyone on the %(trademark_business)s team with this link and password can view the file.").format({trademark_business:o.TRADEMARK_BUSINESS});case"no_one":return a("Members of the file with this link and password can view.");default:throw Error("Unknown link audience: %s".format(e.link_permissions.effective_audience))}default:throw Error("Unknown link access level: %s".format(e.link_permissions.link_access_level))}},p=function(e,t){switch(e.link_permissions.link_access_level){case"editor":switch(e.link_permissions.effective_audience){case"public":return a("Anyone with this link can edit the file. Downloads disabled.");case"team":return t?a("Anyone on your %(trademark_business)s team with this link can edit the file. Downloads disabled.").format({trademark_business:o.TRADEMARK_BUSINESS}):a("Anyone on the %(trademark_business)s team with this link can edit the file. Downloads disabled.").format({trademark_business:o.TRADEMARK_BUSINESS});case"no_one":return a("Members of the file with this link can edit. Downloads disabled.");default:throw Error("Unknown link audience: %s".format(e.link_permissions.effective_audience))}case"viewer":switch(e.link_permissions.effective_audience){case"public":return a("Anyone with this link can view the file. Downloads disabled.");case"team":return t?a("Anyone on your %(trademark_business)s team with this link can view the file. Downloads disabled.").format({trademark_business:o.TRADEMARK_BUSINESS}):a("Anyone on the %(trademark_business)s team with this link can view the file. Downloads disabled.").format({trademark_business:o.TRADEMARK_BUSINESS});case"no_one":return a("Members of the file with this link can view. Downloads disabled.");default:throw Error("Unknown link audience: %s".format(e.link_permissions.effective_audience))}default:throw Error("Unknown link access level: %s".format(e.link_permissions.link_access_level))}},_=function(e,t){switch(e.link_permissions.link_access_level){case"editor":switch(e.link_permissions.effective_audience){case"public":return a("Anyone with this link can edit the file.");case"team":return t?a("Anyone on your %(trademark_business)s team with this link can edit the file.").format({trademark_business:o.TRADEMARK_BUSINESS}):a("Anyone on the %(trademark_business)s team with this link can edit the file.").format({trademark_business:o.TRADEMARK_BUSINESS});case"no_one":return a("Members of the file with this link can edit.");default:throw Error("Unknown link audience: %s".format(e.link_permissions.effective_audience))}case"viewer":switch(e.link_permissions.effective_audience){case"public":return a("Anyone with this link can view the file.");case"team":return t?a("Anyone on your %(trademark_business)s team with this link can view the file.").format({trademark_business:o.TRADEMARK_BUSINESS}):a("Anyone on the %(trademark_business)s team with this link can view the file.").format({trademark_business:o.TRADEMARK_BUSINESS});case"no_one":return a("Members of the file with this link can view.");default:throw Error("Unknown link audience: %s".format(e.link_permissions.effective_audience))}default:throw Error("Unknown link access level: %s".format(e.link_permissions.link_access_level))}},h=function(e,t){i.assert(!!e.expires,"this function should only be used when there is expiry for linkMetadata");var n=c(e);switch(e.link_permissions.link_access_level){case"editor":switch(e.link_permissions.effective_audience){case"public":return l("Anyone with this link and password can edit the file. Expires in a day.","Anyone with this link and password can edit the file. Expires in %(num)d days.",n).format({num:n});case"team":return t?l("Anyone on your %(trademark_business)s team with this link and password can edit the file. Expires in a day.","Anyone on your %(trademark_business)s team with this link and password can edit the file. Expires in %(num)d days.",n).format({num:n,trademark_business:o.TRADEMARK_BUSINESS}):l("Anyone on the %(trademark_business)s team with this link and password can edit the file. Expires in a day.","Anyone on the %(trademark_business)s team with this link and password can edit the file. Expires in %(num)d days.",n).format({num:n,trademark_business:o.TRADEMARK_BUSINESS});case"no_one":return l("Members of the file with this link and password can edit. Expires in a day.","Members of the file with this link and password can edit. Expires in %(num)d days.",n).format({num:n,trademark_business:o.TRADEMARK_BUSINESS});default:throw Error("Unknown link audience: %s".format(e.link_permissions.effective_audience))}case"viewer":switch(e.link_permissions.effective_audience){case"public":return l("Anyone with this link and password can view the file. Expires in a day.","Anyone with this link and password can view the file. Expires in %(num)d days.",n).format({num:n});case"team":return t?l("Anyone on your %(trademark_business)s team with this link and password can view the file. Expires in a day.","Anyone on your %(trademark_business)s team with this link and password can view the file. Expires in %(num)d days.",n).format({num:n,trademark_business:o.TRADEMARK_BUSINESS}):l("Anyone on the %(trademark_business)s team with this link and password can view the file. Expires in a day.","Anyone on the %(trademark_business)s team with this link and password can view the file. Expires in %(num)d days.",n).format({num:n,trademark_business:o.TRADEMARK_BUSINESS});case"no_one":return l("Members of the file with this link and password can view. Expires in a day.","Members of the file with this link and password can view. Expires in %(num)d days.",n).format({num:n});default:throw Error("Unknown link audience: %s".format(e.link_permissions.effective_audience))}default:throw Error("Unknown link access level: %s".format(e.link_permissions.link_access_level))}},m=function(e,t){i.assert(!!e.expires,"this function should only be used when there is expiry for linkMetadata");var n=c(e);switch(e.link_permissions.link_access_level){case"editor":switch(e.link_permissions.effective_audience){case"public":return l("Anyone with this link can edit the file. Expires in a day.","Anyone with this link can edit the file. Expires in %(num)d days.",n).format({num:n});case"team":return t?l("Anyone on your %(trademark_business)s team with this link can edit the file. Expires in a day.","Anyone on your %(trademark_business)s team with this link can edit the file. Expires in %(num)d days.",n).format({num:n,trademark_business:o.TRADEMARK_BUSINESS}):l("Anyone on the %(trademark_business)s team with this link can edit the file. Expires in a day.","Anyone on the %(trademark_business)s team with this link can edit the file. Expires in %(num)d days.",n).format({num:n,trademark_business:o.TRADEMARK_BUSINESS});case"no_one":return l("Members of the file with this link can edit. Expires in a day.","Members of the file with this link can edit. Expires in %(num)d days.",n).format({num:n,trademark_business:o.TRADEMARK_BUSINESS});default:throw Error("Unknown link audience: %s".format(e.link_permissions.effective_audience))}case"viewer":switch(e.link_permissions.effective_audience){case"public":return l("Anyone with this link can view the file. Expires in a day.","Anyone with this link can view the file. Expires in %(num)d days.",n).format({num:n});case"team":return t?l("Anyone on your %(trademark_business)s team with this link can view the file. Expires in a day.","Anyone on your %(trademark_business)s team with this link can view the file. Expires in %(num)d days.",n).format({num:n,trademark_business:o.TRADEMARK_BUSINESS}):l("Anyone on the %(trademark_business)s team with this link can view the file. Expires in a day.","Anyone on the %(trademark_business)s team with this link can view the file. Expires in %(num)d days.",n).format({num:n,trademark_business:o.TRADEMARK_BUSINESS});case"no_one":return l("Members of the file with this link can view. Expires in a day.","Members of the file with this link can view. Expires in %(num)d days.",n).format({num:n});default:throw Error("Unknown link audience: %s".format(e.link_permissions.effective_audience))}default:throw Error("Unknown link access level: %s".format(e.link_permissions.link_access_level))}},f=function(e,t){i.assert(!!e.expires,"this function should only be used when there is expiry for linkMetadata");var n=c(e);switch(e.link_permissions.link_access_level){case"editor":switch(e.link_permissions.effective_audience){case"public":return l("Anyone with this link can edit the file. Expires in a day. Downloads disabled.","Anyone with this link can edit the file. Expires in %(num)d days. Downloads disabled.",n).format({num:n});case"team":return t?l("Anyone on your %(trademark_business)s team with this link can edit the file. Expires in a day. Downloads disabled.","Anyone on your %(trademark_business)s team with this link can edit the file. Expires in %(num)d days. Downloads disabled.",n).format({num:n,trademark_business:o.TRADEMARK_BUSINESS}):l("Anyone on the %(trademark_business)s team with this link can edit the file. Expires in a day. Downloads disabled.","Anyone on the %(trademark_business)s team with this link can edit the file. Expires in %(num)d days. Downloads disabled.",n).format({num:n,trademark_business:o.TRADEMARK_BUSINESS});case"no_one":return l("Members of the file with this link can edit. Expires in a day. Downloads disabled.","Members of the file with this link can edit. Expires in %(num)d days. Downloads disabled.",n).format({num:n});default:throw Error("Unknown link audience: %s".format(e.link_permissions.effective_audience))}case"viewer":switch(e.link_permissions.effective_audience){case"public":return l("Anyone with this link can view the file. Expires in a day. Downloads disabled.","Anyone with this link can view the file. Expires in %(num)d days. Downloads disabled.",n).format({num:n});case"team":return t?l("Anyone on your %(trademark_business)s team with this link can view the file. Expires in a day. Downloads disabled.","Anyone on your %(trademark_business)s team with this link can view the file. Expires in %(num)d days. Downloads disabled.",n).format({num:n,trademark_business:o.TRADEMARK_BUSINESS}):l("Anyone on the %(trademark_business)s team with this link can view the file. Expires in a day. Downloads disabled.","Anyone on the %(trademark_business)s team with this link can view the file. Expires in %(num)d days. Downloads disabled.",n).format({num:n,trademark_business:o.TRADEMARK_BUSINESS});case"no_one":return l("Members of the file with this link can view. Expires in a day. Downloads disabled.","Members of the file with this link can view. Expires in %(num)d days. Downloads disabled.",n).format({num:n});default:throw Error("Unknown link audience: %s".format(e.link_permissions.effective_audience))}default:throw Error("Unknown link access level: %s".format(e.link_permissions.link_access_level))}},y=function(e,t){i.assert(!!e.expires,"this function should only be used when there is expiry for linkMetadata");var n=c(e);switch(e.link_permissions.link_access_level){case"editor":switch(e.link_permissions.effective_audience){case"public":return l("Anyone with this link and password can edit the file. Expires in a day. Downloads disabled.","Anyone with this link and password can edit the file. Expires in %(num)d days. Downloads disabled.",n).format({num:n});case"team":return t?l("Anyone on your %(trademark_business)s team with this link and password can edit the file. Expires in a day. Downloads disabled.","Anyone on your %(trademark_business)s team with this link and password can edit the file. Expires in %(num)d days. Downloads disabled.",n).format({num:n,trademark_business:o.TRADEMARK_BUSINESS}):l("Anyone on the %(trademark_business)s team with this link and password can edit the file. Expires in a day. Downloads disabled.","Anyone on the %(trademark_business)s team with this link and password can edit the file. Expires in %(num)d days. Downloads disabled.",n).format({num:n,trademark_business:o.TRADEMARK_BUSINESS});case"no_one":return l("Members of the file with this link and password can edit. Expires in a day. Downloads disabled.","Members of the file with this link and password can edit. Expires in %(num)d days. Downloads disabled.",n).format({num:n});default:throw Error("Unknown link audience: %s".format(e.link_permissions.effective_audience))}case"viewer":switch(e.link_permissions.effective_audience){case"public":return l("Anyone with this link and password can view the file. Expires in a day. Downloads disabled.","Anyone with this link and password can view the file. Expires in %(num)d days. Downloads disabled.",n).format({num:n});case"team":return t?l("Anyone on your %(trademark_business)s team with this link and password and password can view the file. Expires in a day. Downloads disabled.","Anyone on your %(trademark_business)s team with this link and password can view the file. Expires in %(num)d days. Downloads disabled.",n).format({num:n,trademark_business:o.TRADEMARK_BUSINESS}):l("Anyone on the %(trademark_business)s team with this link and password can view the file. Expires in a day. Downloads disabled.","Anyone on the %(trademark_business)s team with this link and password can view the file. Expires in %(num)d days. Downloads disabled.",n).format({num:n,trademark_business:o.TRADEMARK_BUSINESS});case"no_one":return l("Members of the file with this link and password can view. Expires in a day. Downloads disabled.","Members of the file with this link and password can view. Expires in %(num)d days. Downloads disabled.",n).format({num:n});default:throw Error("Unknown link audience: %s".format(e.link_permissions.effective_audience))}default:throw Error("Unknown link access level: %s".format(e.link_permissions.link_access_level))}}})),define("modules/clean/sharing/link_description_plain_text",["require","exports","tslib","modules/core/i18n","modules/core/exception"],(function(e,t,n,r,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=(r=n.__importStar(r)).i18n_default_project("sharing"),s=o._,a=o.ungettext,l=function(e){var t=e.expires?e.expires.getTime():0;if(null!=e.expires){var n=t-(new Date).getTime();return n<0&&(n=0),Math.floor(n/864e5)}return-1};t.formatShmodelLinkDescriptionPlainText=function(e){return!1===e.link_permissions.allow_download?null!=e.expires?(function(e){i.assert(!!e.expires,"this function should only be used when there is expiry for linkMetadata");var t=l(e);return(function(){if(e.isFolder())switch(e.link_permissions.resolved_visibility){case"password":return a("Anyone with this link and the password can view the folder. Expires in a day. Downloads disabled.","Anyone with this link and the password can view the folder. Expires in %(num)d days. Downloads disabled.",t).format({num:t});case"public":return a("Anyone with this link can view the folder. Expires in a day. Downloads disabled.","Anyone with this link can view the folder. Expires in %(num)d days. Downloads disabled.",t).format({num:t});case"shared_folder_only":return a("Members of the folder with this link can view this folder. Expires in a day. Downloads disabled.","Members of the folder with this link can view this folder. Expires in %(num)d days. Downloads disabled.",t).format({num:t});case"team_and_password":return a("Anyone on your Dropbox team with this link and the password can view the folder. Expires in a day. Downloads disabled.","Anyone on your Dropbox team with this link and the password can view the folder. Expires in %(num)d days. Downloads disabled.",t).format({num:t});case"team_only":return a("Anyone on your Dropbox team with this link can view the folder. Expires in a day. Downloads disabled.","Anyone on your Dropbox team with this link can view the folder. Expires in %(num)d days. Downloads disabled.",t).format({num:t});case"only_you":return a("Only you can view via this link. Expires in a day. Downloads disabled.","Only you can view via this link. Expires in %(num)d days. Downloads disabled.",t).format({num:t});default:throw Error("Unknown visibility setting")}else switch(e.link_permissions.resolved_visibility){case"password":return a("Anyone with this link and the password can view the file. Expires in a day. Downloads disabled.","Anyone with this link and the password can view the file. Expires in %(num)d days. Downloads disabled.",t).format({num:t});case"public":return a("Anyone with this link can view the file.\nExpires in a day. Downloads disabled.","Anyone with this link can view the file. Expires in %(num)d days. Downloads disabled.",t).format({num:t});case"shared_folder_only":return a("Members of the containing shared folder with this link can view the file.\nExpires in a day. Downloads disabled.","Members of the containing shared folder with this link can view this file. Expires in %(num)d days. Downloads disabled.",t).format({num:t});case"team_and_password":return a("Anyone on your Dropbox team with this link and the password can view the file. Expires in a day. Downloads disabled.","Anyone on your Dropbox team with this link and the password can view the file. Expires in %(num)d days. Downloads disabled.",t).format({num:t});case"team_only":return a("Anyone on your Dropbox team with this link can view the file. Expires in a day. Downloads disabled.","Anyone on your Dropbox team with this link can view the file. Expires in %(num)d days. Downloads disabled.",t).format({num:t});case"only_you":return a("Only you can view via this link. Expires in a day. Downloads disabled.","Only you can view via this link. Expires in %(num)d days. Downloads disabled.",t).format({num:t});default:throw Error("Unknown visibility setting")}})()})(e):(function(e){return(function(){if(e.isFolder())switch(e.link_permissions.resolved_visibility){case"password":return s("Anyone with this link and password can view the folder. Downloads disabled.");case"public":return s("Anyone with this link can view the folder. Downloads disabled.");case"shared_folder_only":return s("Members of the folder with this link can view the folder. Downloads disabled.");case"team_and_password":return s("Anyone on your Dropbox team with this link and the password can view the folder. Downloads disabled.");case"team_only":return s("Anyone on your Dropbox team with this link can view the folder. Downloads disabled.");case"only_you":return s("Only you can view via this link. Downloads disabled.");default:throw Error("Unknown visibility setting")}else switch(e.link_permissions.resolved_visibility){case"password":return s("Anyone with this link and password can view the file. Downloads disabled.");case"public":return s("Anyone with this link can view the file. Downloads disabled.");case"shared_folder_only":return s("Members of the containing shared folder with this link can view the file. Downloads disabled.");case"team_and_password":return s("Anyone on your Dropbox team with this link and the password can view the file. Downloads disabled.");case"team_only":return s("Anyone on your Dropbox team with this link can view the file. Downloads disabled.");case"only_you":return s("Only you can view via this link. Downloads disabled.");default:throw Error("Unknown visibility setting")}})()})(e):null!=e.expires?(function(e){i.assert(!!e.expires,"this function should only be used when there is expiry for linkMetadata");var t=l(e);return(function(){if(e.isFolder())switch(e.link_permissions.resolved_visibility){case"password":return a("Anyone with this link and the password can view the folder. Expires in a day.","Anyone with this link and the password can view the folder. Expires in %(num)d days.",t).format({num:t});case"public":return a("Anyone with this link can view the folder. Expires in a day.","Anyone with this link can view the folder. Expires in %(num)d days.",t).format({num:t});case"shared_folder_only":return a("Members of the folder with this link can view the folder. Expires in a day.","Members of the folder with this link can view the folder. Expires in %(num)d days.",t).format({num:t});case"team_and_password":return a("Anyone on your Dropbox team with this link and the password can view the folder. Expires in a day.","Anyone on your Dropbox team with this link and the password can view the folder. Expires in %(num)d days.",t).format({num:t});case"team_only":return a("Anyone on your Dropbox team with this link can view the folder. Expires in a day.","Anyone on your Dropbox team with this link can view the folder. Expires in %(num)d days.",t).format({num:t});case"only_you":return a("Only you can view via this link. Expires in a day.","Only you can view via this link. Expires in %(num)d days.",t).format({num:t});default:throw Error("Unknown visibility setting")}else switch(e.link_permissions.resolved_visibility){case"password":return a("Anyone with this link and the password can view the file. Expires in a day.","Anyone with this link and the password can view the file. Expires in %(num)d days.",t).format({num:t});case"public":return a("Anyone with this link can view the file. Expires in a day.","Anyone with this link can view the file. Expires in %(num)d days.",t).format({num:t});case"shared_folder_only":return a("Members of the containing shared folder with this link can view the file. Expires in a day.","Members of the containing shared folder with this link can view the file. Expires in %(num)d days.",t).format({num:t});case"team_and_password":return a("Anyone on your Dropbox team with this link and the password can view the file. Expires in a day.","Anyone on your Dropbox team with this link and the password can view the file. Expires in %(num)d days.",t).format({num:t});case"team_only":return a("Anyone on your Dropbox team with this link can view the file. Expires in a day.","Anyone on your Dropbox team with this link can view the file. Expires in %(num)d days.",t).format({num:t});case"only_you":return a("Only you can view via this link. Expires in a day.","Only you can view via this link. Expires in %(num)d days.",t).format({num:t});default:throw Error("Unknown visibility setting")}})()})(e):(function(e){return(function(){if(e.isFolder())switch(e.link_permissions.resolved_visibility){case"password":return s("Anyone with this link and password can view the folder.");case"public":return s("Anyone with this link can view the folder.");case"shared_folder_only":return s("Members of the folder with this link can view the folder.");case"team_and_password":return s("Anyone on your Dropbox team with this link and the password can view the folder.");case"team_only":return s("Anyone on your Dropbox team with this link can view the folder.");case"only_you":return s("Only you can view via this link.");default:throw Error("Unknown visibility setting")}else switch(e.link_permissions.resolved_visibility){case"password":return s("Anyone with this link and password can view the file.");case"public":return s("Anyone with this link can view the file.");case"shared_folder_only":return s("Members of the containing shared folder with this link can view the file.");case"team_and_password":return s("Anyone on your Dropbox team with this link and the password can view the file.");case"team_only":return s("Anyone on your Dropbox team with this link can view the file.");case"only_you":return s("Only you can view via this link.");default:throw Error("Unknown visibility setting")}})()})(e)}})),define("modules/clean/sharing/link_info",["require","exports"],(function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(e){var t=e.expires,n=e.isFolder,r=e.name,i=e.teamId,o=e.teamName,s=e.url,a=e.visibility,l=e.isPackage;this.expires=t,this.isFolder=n,this.name=r,this.teamId=i,this.teamName=o,this.url=s,this.visibility=a,this.isPackage=l};t.LinkInfo=n})),define("modules/clean/sharing/share_page/action_types",["require","exports","modules/clean/flux/action_type"],(function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n.withActionNamespace("share-page",{INITIALIZE:"initialize-store",EMAIL_UNVERIFIED:"email-unverified",RECENT_TAB_EMAIL_UNVERIFIED:"recent-tab-email-unverified",SWITCH_TAB:"switch-tab",SWITCH_ROLE:"switch-role",SWITCH_USER:"switch-user",LOAD_PRE_FOLDER_DATA_REQUEST:"load-pre-folder-data-request",LOAD_PRE_FOLDER_DATA_SUCCESS:"load-pre-folder-data-success",LOAD_PRE_FOLDER_DATA_ERROR:"load-pre-folder-data-error",LOAD_FOLDER_DATA_REQUEST:"load-folder-data-request",LOAD_FOLDER_DATA_SUCCESS:"load-folder-data-success",LOAD_FOLDER_DATA_ERROR:"load-folder-data-error",LOAD_PRE_FILE_DATA_REQUEST:"load-pre-file-data-request",LOAD_PRE_FILE_DATA_SUCCESS:"load-pre-file-data-success",LOAD_PRE_FILE_DATA_ERROR:"load-pre-file-data-error",LOAD_FILE_DATA_REQUEST:"load-file-data-request",LOAD_FILE_DATA_SUCCESS:"load-file-data-success",LOAD_FILE_DATA_ERROR:"load-file-data-error",MOUNT_FOLDER_REQUEST:"mount-folder-request",MOUNT_FOLDER_SUCCESS:"mount-folder-success",MOUNT_FOLDER_ERROR:"mount-folder-error",UNMOUNT_FOLDER_REQUEST:"unmount-folder-request",UNMOUNT_FOLDER_SUCCESS:"unmount-folder-success",UNMOUNT_FOLDER_ERROR:"unmount-folder-error",UNSHARE_FOLDER_REQUEST:"unshare-folder-request",UNSHARE_FOLDER_SUCCESS:"unshare-folder-success",UNSHARE_FOLDER_ERROR:"unshare-folder-error",FETCH_TEAM_POLICY_REQUEST:"fetch-team-policy-request",FETCH_TEAM_POLICY_SUCCESS:"fetch-team-policy-success",FETCH_TEAM_POLICY_ERROR:"fetch-team-policy-error",FETCH_FOLDER_POLICY_SUCCESS:"fetch-folder-policy-success",FETCH_METADATA_SUCCESS:"fetch-metadata-success",RELINQUISH_FOLDER_MEMBERSHIP_REQUEST:"relinquish-folder-membership-request",RELINQUISH_FOLDER_MEMBERSHIP_SUCCESS:"relinquish-folder-membership-success",RELINQUISH_FOLDER_MEMBERSHIP_ERROR:"relinquish-folder-membership-error",RELINQUISH_FILE_MEMBERSHIP_REQUEST:"relinquish-file-membership-request",RELINQUISH_FILE_MEMBERSHIP_SUCCESS:"relinquish-file-membership-success",RELINQUISH_FILE_MEMBERSHIP_ERROR:"relinquish-file-membership-error"});t.SharePageActionTypes=r})),define("modules/clean/sharing/ui_util",["require","exports","tslib","react","external/lodash","modules/clean/analytics","modules/clean/api_v2/error","modules/clean/contacts/contact_token_state","modules/clean/filepath","modules/clean/filetypes","modules/clean/react/icon/icon_helper","modules/clean/react_format","modules/clean/sharing/api/types/metadata","modules/clean/sharing/gating_util","modules/constants/trademark","modules/core/i18n"],(function(e,t,n,r,i,o,s,a,l,c,u,d,p,_,h,m){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),r=n.__importDefault(r),i=n.__importStar(i);var f=(m=n.__importStar(m)).i18n_default_project("sharing")._;t.SharingExperiments={};var y={strong:r.default.createElement("strong",null),em:r.default.createElement("em",null)};t.SHARE_UI_TYPE={SHARED_FILE:"shared-file",SHARED_FOLDER:"shared-folder",SHARED_LINK:"shared-link",PUBLIC:"public",NO_SHARE:"no-share"};var g,v={SINGLE_INVALID:f("The email address you entered is invalid."),SINGLE_OUT_OF_TEAM:f("You can only share with your team and people your admin has approved."),SINGLE_TOO_MANY_MEMBERS:f("Can’t share with this many people."),GENERAL_INVALID:f("One or more names or email addresses you entered are invalid."),GENERAL_OUT_OF_TEAM:f("Some of these people aren’t on your Dropbox team."),GENERAL_TOO_MANY_MEMBERS:d.reactFormat(f("This will put the folder over its %(member_limit)s-member limit. Learn more.",{comment:"member_limit will be a number greater than 200"}),{member_limit:_.GoldenGate.SHARING_TOTAL_LIMIT,a:r.default.createElement("a",{href:"/help/9292",target:"_blank",key:"help_center_article"})}),NONGROUP_INVITEE:f("Only groups can be added to team folders."),NO_PERMISSION:f("You don’t have permission to to share with this person."),GENERAL_NO_PERMISSION:f("You don’t have permission to to share with some of these people.")};t.CONTACT_ERROR_MESSAGES=v,(function(e){e.Error="error",e.Warn="warn"})(g||(g={})),t.ContactsErrorLevel=g;var b=function(e,t){return(t.displayName()||"").toLowerCase()},w=Math.pow(2,53)-1;t.makeMemberSortCmp=function(e,t,n){var r=n?(function(e){return function(t,n){var r,i,o,s=n.memberId()===t,a=n instanceof p.GroupMembershipInfo?"0":"1",l=(n.displayName()||"").toLowerCase(),c=null!=n.account_id&&e.has(n.account_id);return""+a+(c&&s?"a":c?"b":null!=n.time_last_seen?"c"+(r=n.time_last_seen,i=String(w-Number(r)),o=String(w).length,i.length_.GoldenGate.SHARING_TOTAL_LIMIT)return{state:a.ContactTokenState.invalid,msg:v.SINGLE_TOO_MANY_MEMBERS};if(e.invalid)l={state:a.ContactTokenState.invalid,msg:v.SINGLE_INVALID};else{if(e.email===t.email)return l;if(null!=n&&t.is_team&&e.dbx_team_id!==n.id&&!e.group_id){l={msg:v.SINGLE_OUT_OF_TEAM,state:"team"===(null!=r?r.member_policy:void 0)||"team"===(null!=r?r.resolved_member_policy:void 0)?a.ContactTokenState.invalid:a.ContactTokenState.warn}}}return l};t.validateContacts=function(e,t,n,r,i,o,s){for(var l=null,c=null,u=0,d=e;u0&&l!==g.Error&&s>_.GoldenGate.SHARING_TOTAL_LIMIT&&(l=g.Error,c=v.GENERAL_TOO_MANY_MEMBERS),{level:l,message:c}};t.logTiburonEvent=function(e,t,n,r){void 0===r&&(r={});var s=e.extras.origin;o.ShareTibEventLogger.log(t,n,s,i.assignIn(r,{file_id:e.extras.fileId,fq_path:e.displayPath(),ns_id:e.isSharedFolder()?e.sharedFolderId():void 0,modal_session_id:e.extras.modalSessionId}))};var E={access_error:f("You don’t have access to this content."),email_unverified:f("You haven’t verified your email. Check your email and try again."),bad_member:f("You entered an invalid name or email address."),cant_share_outside_team:f("Your team settings don’t allow sharing outside your team."),too_many_members:f("You’re sharing with too many people."),too_many_pending_invites:f("You’re sharing with too many people."),rate_limit:f("You’ve hit the limit of invites for today. Try again later."),insufficient_plan:f("You need a Dropbox %(trademark_plus)s or Business account to do this.").format({trademark_plus:h.TRADEMARK_PLUS}),team_folder:f("You can’t add members to a team folder. Contact your team admin."),no_permission:f("You don’t have permission to do this. Contact the owner.")};t.genAddMemberErrorMessage=function(e){return e.message?e.message:e instanceof s.AppError&&e.error&&e.error[".tag"]&&E[e.error[".tag"]]?E[e.error[".tag"]]:f("There was a problem completing this request.")};t.folderIconForMetadata=function(e){var t=null!=e.parent_shared_folder_id,n=!1;return e.permissions&&e.permissions.edit_contents&&(n=!e.permissions.edit_contents.allow),u.folder_icon({isShared:e.isSharedFolder(),isDeleted:null==e.path_lower,isInTeamFolderTree:t,isTeamFolder:e.is_team_folder,isViewOnly:n})};t.spectrumFolderIconForMetadata=function(e){var t=null!=e.parent_shared_folder_id,n=!1;e.permissions&&e.permissions.edit_contents&&(n=!e.permissions.edit_contents.allow);var r=c.FileTypes.FOLDER;return e.isSharedFolder()?r=c.FileTypes.SHARED_FOLDER:e.is_team_folder&&(r=c.FileTypes.TEAM_SHARED_FOLDER),u.spectrumFolderIcon({fileType:r,isInTeamFolderTree:t,isViewOnly:n})};t.fileIconForMetadata=function(e){return u.file_icon(e.name,{size:u.ICON_SIZES.LARGE})};t.getNewFolderPathFromContentName=function(e,t){return[l.normalize(t),e].join("/")};t.getMemberCountForTokens=function(e){return null==e?0:e.map((function(e){return e.group_size||1})).reduce((function(e,t){return e+t}),0)};t.convertIfHTML=function(e){return e.toHTML?d.reactFormat(e.toHTML(),y):e}})),define("modules/clean/teams/admin/api/admin_console_api_client",["require","exports","tslib","modules/clean/api_v2/types","modules/clean/cloud_docs/types","modules/clean/api_v2/default_team_client","modules/clean/filepath","modules/clean/sharing/api/util/types","modules/clean/viewer"],(function(e,t,n,r,i,o,s,a,l){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),s=n.__importStar(s);var c=(function(){function e(e){var t;void 0===e&&(e=!1),this.isCMForCDM=e;var n=l.Viewer.get_viewer().get_user_by_role("work");n&&(n.team_member_id&&(this.selectAdminParams={headers:(t={},t[r.ApiV2HeaderNames.DropboxApiSelectAdmin]=n.team_member_id,t)}),this.teamClient=new o.DefaultTeamApiV2Client(n))}return e.prototype.teamRoutes=function(){return this.teamClient.ns("team")},e.prototype.domainRoutes=function(){return this.teamClient.ns("domains")},e.prototype.teamMembersInternal=function(){return this.teamClient.ns("team_members_internal")},e.prototype.teamInsightsRoutes=function(){return this.teamClient.ns("team_insights")},e.prototype.teamLogRoutes=function(){return this.teamClient.ns("team_log")},e.prototype.usersRoutes=function(){return this.teamClient.ns("users")},e.prototype.filesRoutes=function(){return this.teamClient.ns("files")},e.prototype.sharingRoutes=function(){return this.teamClient.ns("sharing")},e.prototype.federationRoutes=function(){return this.teamClient.ns("federation")},e.prototype.fileTransfersRoutes=function(){return this.teamClient.ns("file_transfers")},e.prototype.cloudDocsRoutes=function(){return this.teamClient.ns("cloud_docs")},e.prototype.setPermanentDeletePolicy=function(e){return this.teamRoutes().rpc("set_permanent_delete_policy",{permanent_delete_enabled:e},{})},e.prototype.setCloudDocsPolicy=function(e,t){var n={};(n[i.CloudDocProviderIntegration.GDD_INTEGRATION.toString()]=e?i.IntegrationCreateAndEdit:i.IntegrationViewOnly,"boolean"==typeof t)&&(n[i.CloudDocProviderIntegration.PAPER_INTEGRATION.toString()]=t?i.IntegrationCreateAndEdit:i.IntegrationViewOnly);return this.cloudDocsRoutes().rpc("team_settings/set",{settings:n},this.selectAdminParams)},e.prototype.setMultipleAccountsPolicy=function(e){return this.teamRoutes().rpc("set_multiple_accounts_policy",{multiple_accounts_enabled:e},{})},e.prototype.setSecondaryEmailsPolicy=function(e){var t=e?{".tag":"enabled"}:{".tag":"disabled"};return this.teamRoutes().rpc("set_secondary_mails_policy",{secondary_mails_policy:t},{})},e.prototype.setCameraUploadsPolicy=function(e){var t=e?{".tag":"enabled"}:{".tag":"disabled"};return this.teamRoutes().rpc("set_camera_uploads_policy",{camera_uploads_policy:t},{})},e.prototype.setDesktopAppDefaults=function(e){var t=e;return this.teamRoutes().rpc("set_team_default_desktop_pathway",{pathway:t},{})},e.prototype.setFileLockingPolicy=function(e){var t=e?{".tag":"enabled"}:{".tag":"disabled"};return this.teamRoutes().rpc("set_file_locking_policy",{file_locking_policy:t},{})},e.prototype.setSmarterSmartSyncPolicy=function(e){var t=e?{".tag":"enabled"}:{".tag":"disabled"};return this.teamRoutes().rpc("set_smarter_smart_sync_policy",{smarter_smart_sync_policy:t},{})},e.prototype.updateAppActionSettings=function(e,t){return this.teamRoutes().rpc("app_actions/update_settings",{allow_actions:e,action_state_updates:t.map((function(e){return{id:e.id,is_enabled:!e.isIndividuallyDisabled}}))},{})},e.prototype.updateTeamIntegrationSettings=function(e){var t=e.find((function(e){return"zoom"===e.id}));return t&&t.teamSettings?this.teamRoutes().rpc("integrations/set_team_integration_settings",{zoom_team_settings:{meeting_recordings_disabled_by_admin:t.teamSettings.zoomMeetingRecordingsDisabledByAdmin}},{}):Promise.resolve()},e.prototype.updateCommunicationAppSettings=function(e){return this.teamRoutes().rpc("profile_services/set_service_enabled_states",{enabled_state_updates:e.map((function(e){return{service:{".tag":e.id},is_enabled:!e.isIndividuallyDisabled}}))},{})},e.prototype.updateCoordinationAppSettings=function(e){return this.teamRoutes().rpc("profile_services/set_service_enabled_states",{enabled_state_updates:e.map((function(e){return{service:{".tag":e.id},is_enabled:!e.isIndividuallyDisabled}}))},{})},e.prototype.setFileRequestPolicy=function(e){return this.teamRoutes().rpc("sharing/set_file_request_policy",{file_request_enabled:e},{})},e.prototype.setOfficeAddInPolicy=function(e){return this.teamRoutes().rpc("set_office_addin_policy",{office_addin_enabled:e},{})},e.prototype.setSharedLinkPolicy=function(e,t){var n={sharing_outside_enabled:e};return e&&(n.default_visibility=t),this.teamRoutes().rpc("sharing/set_shared_link_policy",n,{})},e.prototype.setSharedFolderSharingPolicy=function(e,t){return t?this.teamRoutes().rpc("sharing/set_shared_folder_sharing_policy",{sharing_outside_enabled:e,external_sharing_policy:{".tag":t}},{}):this.teamRoutes().rpc("sharing/set_shared_folder_sharing_policy",{sharing_outside_enabled:e},{})},e.prototype.setSharedFolderJoiningPolicy=function(e){return this.teamRoutes().rpc("sharing/set_shared_folder_joining_policy",{joining_outside_enabled:e},{})},e.prototype.setFileTransfersPolicy=function(e){return this.fileTransfersRoutes().rpc("teams/set_file_transfers_policy",{file_transfers_enabled:e},{})},e.prototype.setCommentingPolicy=function(e){return this.teamRoutes().rpc("sharing/set_commenting_policy",{commenting_enabled:e},{})},e.prototype.setPasswordStrength=function(e,t){var n="enabled"===e?t:"minimal_requirements";return this.teamRoutes().rpc("set_password_requirements",{password_strength_policy:n},{})},e.prototype.resetAllPasswords=function(){return this.teamRoutes().rpc("reset_all_passwords",void 0,{})},e.prototype.setViewerInfoSetting=function(e){return this.teamRoutes().rpc("set_viewer_info_policy",{viewer_info_policy:e},{})},e.prototype.setPaperPolicy=function(e,t,n,r){var i={paper_enabled:e,paper_deployment_mode:{paper_deployment_type:n,enabled_members_update:{users_to_add:this.make_user_selector_list(r.users_to_add),users_to_remove:this.make_user_selector_list(r.users_to_remove)}}};return t&&(i.dropbox_terms="agree"),this.teamRoutes().rpc("paper/set_paper_policy",i,{})},e.prototype.setPaperSharingPolicy=function(e,t){void 0===e&&(e=!0);var n={external_sharing_allowed:void 0===e||e,default_visibility:t};return this.teamRoutes().rpc("paper/set_paper_sharing_policy",n,{})},e.prototype.setPaperDefaultFolderPolicy=function(e){return this.teamRoutes().rpc("paper/set_paper_default_folder_policy",{default_folder_policy:e},{})},e.prototype.setPaperDesktopPolicy=function(e){return this.teamRoutes().rpc("paper/set_paper_desktop_policy",{enabled:e},{})},e.prototype.setShowcasePolicy=function(e,t,n){var r={showcase_enabled:e,external_sharing_enabled:t,download_enabled:n};return this.teamRoutes().rpc("showcase/set_showcase_policy",r,{})},e.prototype.setRequestMembershipPolicy=function(e){return this.teamRoutes().rpc("set_request_membership_policy",{request_membership:e},{})},e.prototype.setSuggestMembersPolicy=function(e){return this.teamRoutes().rpc("set_suggest_members_policy",{suggest_members_enabled:e},{})},e.prototype.setWatermarkingPolicy=function(e){return this.teamRoutes().rpc("workflows/set_watermarking_policy",{watermarking_policy:{".tag":e?"on":"off"}},{})},e.prototype.deviceManagementGetExcludedUsers=function(){return this.teamRoutes().rpc("device_management/get_excluded_users",void 0,{})},e.prototype.deviceManagementConfigureSettings=function(e){return this.teamRoutes().rpc("device_management/configure_settings",e,{})},e.mapValueToRolloutMethod=function(e){return 0===e?"unlink_all":1===e?"unlink_most_inactive":"add_member_to_exceptions"},e.prototype.deviceManagementConfigureSettingsForAcf=function(t,n,r,i,o){var s={is_enabled:!0,can_user_remove_device:n,rollout_method:{".tag":e.mapValueToRolloutMethod(o)},users_to_add:t.users_to_add,users_to_remove:t.users_to_remove,desktop_devices_limit:-1===r?{".tag":"unlimited"}:{limited:Number(r),".tag":"limited"},mobile_devices_limit:-1===i?{".tag":"unlimited"}:{limited:Number(i),".tag":"limited"}};return this.teamRoutes().rpc("device_management/configure_settings",s,{})},e.prototype.deviceManagementConfigureSettingsDisable=function(){return this.teamRoutes().rpc("device_management/configure_settings",{is_enabled:!1},{})},e.prototype.deviceManagementRemoveDevice=function(e,t,n){return this.teamRoutes().rpc("device_management/remove_device",{user_id:e,device_id:t,delete_data:n},{})},e.prototype.deviceManagementRemoveClient=function(e,t,n,r){return this.teamRoutes().rpc("device_management/remove_client",{user_id:e,device_id:t,client_unique_identifier:n,delete_data:r},{})},e.prototype.webSessionManagementConfigureSettings=function(e,t){return this.teamRoutes().rpc("web_session_management/configure_settings",{remember_session_expires:e,idle_session_timeout:t},{})},e.prototype.teamFolderArchive=function(e,t){return void 0===t&&(t=!1),this.teamRoutes().rpc("team_folder/archive",{team_folder_id:String(e),force_async_off:!t},{})},e.prototype.teamFolderUnarchive=function(e){return this.teamRoutes().rpc("team_folder/activate",{team_folder_id:String(e)},{})},e.prototype.teamFolderCreate=function(e,t){var n={name:e};return void 0!==t&&(n.sync_setting=t?{".tag":"default"}:{".tag":"not_synced"}),this.teamRoutes().rpc("team_folder/create",n,{})},e.prototype.teamFolderUpdateSyncSetting=function(e){var t=e.teamFolderId,n=e.syncSetting,r=e.fileIds,i={team_folder_id:t},o={".tag":n};return r?i.content_sync_settings=r.map((function(e){return{id:e,sync_setting:o}})):i.sync_setting=o,this.teamRoutes().rpc("team_folder/update_sync_settings",i,{})},e.prototype.teamFoldersList=function(e){return void 0===e&&(e=1e3),this.teamRoutes().rpc("team_folder/list",{limit:e},{})},e.prototype.teamFoldersListContinue=function(e){return this.teamRoutes().rpc("team_folder/list/continue",{cursor:e},{})},e.prototype.teamNamespacesList=function(){return this.teamRoutes().rpc("namespaces/list",{filter:{".tag":"eligible_for_cm_top_level_page"}},{})},e.prototype.teamFolderRename=function(e,t){return this.teamRoutes().rpc("team_folder/rename",{team_folder_id:String(e),name:t},{})},e.prototype.teamFolderPermanentlyDelete=function(e){return this.teamRoutes().rpc("team_folder/permanently_delete",{team_folder_id:String(e)},{})},e.prototype.teamIntegrationSettings=function(){return this.teamRoutes().rpc("integrations/get_team_integration_settings",void 0,{})},e.prototype.setGroupsCreationPolicy=function(e){return this.teamRoutes().rpc("groups/set_creation_policy",{group_creation:e},{})},e.prototype.setNTSBlockTrafficPolicy=function(e){return this.teamRoutes().rpc("nts/set_block_traffic_policy",{block_traffic_enabled:e},{})},e.prototype.setSyncPolicy=function(e,t){return void 0===t&&(t=void 0),this.teamRoutes().rpc("set_infinite_policy",{setting:e,admin_sync_defaults_enabled:t},{})},e.prototype.configureSsoAndGoogleLoginPolicy=function(e,t,n,r,i,o){return this.teamRoutes().rpc("configure_sso_and_google_login_policy",{sso_policy:e,sign_in_url:t,sign_out_url:n,saml_cert:r,saml_nameid_format:i,google_login_enabled:o},{})},e.prototype.configureSso=function(e,t,n,r,i){return this.teamRoutes().rpc("configure_sso",{sso_policy:e,saml_cert:t,sign_in_url:n,sign_out_url:r,nameid_format:i},{})},e.prototype.configureDirectoryRestrictions=function(e){var t={users_to_add:e.users_to_add,users_to_remove:e.users_to_remove};return this.teamRoutes().rpc("directory_restrictions/configure_settings",t,{})},e.prototype.configureGoogleLoginPolicy=function(e){return this.teamRoutes().rpc("configure_google_login_policy",{google_login_enabled:e},{})},e.prototype.setResellerSupportSetting=function(e){return this.teamRoutes().rpc("change_reseller_support",{reseller_support_enabled:e},{})},e.prototype.folderCreate=function(e,t,n){"/"!==t&&(t+="/");var r="ns:"+e+t+n;return this.filesRoutes().rpc("create_folder",{path:r},this.selectAdminParams)},e.prototype.bulkFileDelete=function(e){for(var t=[],n=null,r=0,i=e.length;re.populatedTokenData.length?this._addTokens(r,!1,null):r.length3&&(t.overflowY="auto",t.overflowX="visible"),a.div({onClick:this._handleMyClick,className:r.default(e)},a.div({className:n,ref:"tokenizer_input",style:t},a.div({className:"token-container",style:{marginLeft:-this.props.tokenSpacing,marginBottom:-this.props.tokenSpacing}},this._renderTokens(),this._renderInput())),this._renderSelector())},serializeInputData:function(){return{tokens:this.tokenData,value:s.findDOMNode(this.refs.input).value}},tokenizeAll:function(){var e=s.findDOMNode(this.refs.input),t=this.props.stringTokenizer(e.value,!0).tokens;return t.length>0&&this._addTokens(t,!1),e.value="",this.refs.selector.close()},addExternalTokens:function(e){this._addTokens(e,!1,null),this.refs.selector.close()},_getCurrentValue:function(){var e=s.findDOMNode(this.refs.input);return this.props.stringTokenizer(e.value).value},queryDataSource:function(e){var t=this,n=function(n){var r;e||(n=null);var i=function(e){return("function"==typeof e.getKey?e.getKey():void 0)||String(e)},o=c.map(t.tokenData,i);return n=null!=n?n.filter((function(e){return r=i(e),!Array.from(o).includes(r)})):null};return this.props.dataSource.query(e,(function(r){return r=n(r),t.queryResults=r,t.setState({queryResults:t.queryResults}),"function"==typeof t.props.logSearchComplete?t.props.logSearchComplete(e,(null!=r?r.length:void 0)||0,!0):void 0}),(function(r){return e===t._getCurrentValue()&&(r=n(r))&&r.length&&(t.queryResults=t.queryResults?t.queryResults.concat(r):r,t.setState({queryResults:t.queryResults})),"function"==typeof t.props.logSearchComplete?t.props.logSearchComplete(e,(null!=r?r.length:void 0)||0,!1):void 0}))},_dataUpdatedCallback:function(){if(this.isMounted()){var e=Boolean(this.state.queryResults);return t=this.refs.selector,n="reset",r=function(e){return e.reset()},null!=t&&"function"==typeof t[n]&&r(t,n),e&&s.findDOMNode(this.refs.input).focus(),this.queryDataSource(s.findDOMNode(this.refs.input).value)}var t,n,r},_addTokens:function(e,t,n){var r=this;void 0===t&&(t=!1),void 0===n&&(n=null);for(var i=function(e){return("function"==typeof e.getKey?e.getKey():void 0)||String(e)},o=c.map(this.tokenData,i),a=[],l=0,u=Array.from(e);la&&(t-=1),this.tokenData.splice(a,1),n.push(o))}var l=s.findDOMNode(this.refs.input);l.focus(),this._setSelectedToken(t),this.queryResults=null,this.setState({tokenData:this.tokenData,queryResults:this.queryResults});for(var c=0,u=Array.from(n);co;i?s++:s--)r.push(s);return r})(0,this.state.tokenData.length,!1).map((function(t){return e.refs["token"+t]})).filter((function(e){return e}))},_setSelectedToken:function(e){return null!=e?(s.findDOMNode(this.refs["token"+e]).focus(),this.refs.selector.close()):s.findDOMNode(this.refs.input).focus(),this.setState({selectedTokenIndex:e})},_resizeTokenizerInput:function(){var e=function(e){return m(s.findDOMNode(e),(function(e){return e.clientWidth}))},t=e(this._getTokenizerInput());if(null!=t){for(var n=this.props.tokenSpacing+2,r=this.props.tokenSpacing,i=0,o=this._getTokenComponents(),a=1,l=0,c=Array.from(o);lt&&(a+=1,i=0),i+=u}var d=t-i-r-2;return d<80&&(a+=1,d=t-r),d!==this.state.inputWidth&&this.setState({inputWidth:d}),a!==this.state.numLines?this.setState({numLines:a}):void 0}},_onSelect:function(e){var t=s.findDOMNode(this.refs.input);return t.focus(),this._addToken(e,!0,t.value),t.value="",this.queryResults=null,this.setState({queryResults:this.queryResults})},_handleMyClick:function(e){return"function"==typeof e.nativeEvent.stopImmediatePropagation?e.nativeEvent.stopImmediatePropagation():void 0},_handleDocumentClick:function(e){return this.refs.selector.close()},_proxyKeys:function(e){if(e.keyCode===d.KeyCode.BACKSPACE&&""===this._getCurrentValue()&&e.preventDefault(),this._shouldListenForTokenNavigation()){var t=this.state.selectedTokenIndex;switch(e.keyCode){case d.KeyCode.BACKSPACE:return void(null===t?(this._setSelectedToken(this.state.tokenData.length-1),s.findDOMNode(this.refs.input).focus()):this.removeToken(this.state.tokenData[t]));case d.KeyCode.LEFT:return void(null===t?this._setSelectedToken(this.state.tokenData.length-1):t>0&&this._setSelectedToken(t-1));case d.KeyCode.RIGHT:if(null!==t)return void(t>=this.state.tokenData.length-1?this._setSelectedToken(null):this._setSelectedToken(t+1));break;case d.KeyCode.DELETE:if(null!==t)return void this.removeToken(this.state.tokenData[t])}}if(this.refs.selector.onKeyDown(e),!e.isDefaultPrevented())return e.keyCode===d.KeyCode.TAB&&""!==s.findDOMNode(this.refs.input).value?(this.tokenizeAll(),e.preventDefault()):void 0},_shouldListenForTokenNavigation:function(){if(!this.state.tokenData.length)return!1;var e=s.findDOMNode(this.refs.input);return 0===e.selectionStart&&0===e.selectionEnd},_textUpdated:function(){var e=s.findDOMNode(this.refs.input),t=e.value,n=this.props.stringTokenizer(t),r=n.tokens,i=n.value;return"function"==typeof this.props.logSearchBegin&&this.props.logSearchBegin(i),i!==t&&(e.value=i,i||this.refs.selector.close()),r.length>0?this._addTokens(r,!1):"function"==typeof this.props.onContentsChange&&this.props.onContentsChange(this.tokenData,i),this.queryDataSource(i)},_clearResults:function(){return this.queryResults=null,this.setState({queryResults:this.queryResults})}});function m(e,t){return null!=e?t(e):void 0}t.Tokenizer=h})),define("modules/clean/typeahead",["require","exports","tslib","classnames","create-react-class","react","react-dom-factories","react-dom","prop-types","external/lodash","modules/clean/fuzzy","modules/clean/keycode"],(function(e,t,n,r,i,o,s,a,l,c,u,d){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),r=n.__importDefault(r),i=n.__importDefault(i),o=n.__importDefault(o),s=n.__importStar(s),a=n.__importStar(a),l=n.__importStar(l),c=n.__importStar(c),u=n.__importDefault(u);var p=(function(){function e(e){var t=(void 0===e?{}:e).local;this.local=t}return e.prototype.filterAndSort=function(e){return u.default.filter(e,this.local)},e.prototype.query=function(e,t){return t(c.map(this.filterAndSort(e),(function(e){return e.original})))},e})();t.DataSource=p;var _={getInitialState:function(){return{selectionIndex:0}},getOptions:function(){if(!this.props.queryOptions)return[];var e=this.props.maxVisible||this.props.queryOptions.length;return this.props.queryOptions.slice(0,e)},renderOptions:function(){for(var e=[],t=this.getOptions(),n=function(e){return("function"==typeof e.getKey?e.getKey():void 0)||String(e)},i=0;i=t&&(n-=r),this._changeSelectionIndex(n)}},_changeSelectionIndex:function(e){return e!==this.state.selectionIndex&&"function"==typeof this.onSelectionIndexChange&&this.onSelectionIndexChange(e),this.setState({selectionIndex:e})}};t.TypeaheadSelectorMixin=_;var h=(function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.state={queryResults:null,value:t.props.value,focus:!1},t._onMouseOver=function(){return t.setState({focus:!0})},t._onMouseLeave=function(){return t.setState({focus:!1})},t._onBlur=function(){if(t.props.onBlur(),!t.state.focus)return t._clearResults()},t._onFocus=function(){return t._queryDataSource(t.state.value),t.refs.selector.reset()},t._renderInput=function(){var e=t.props.renderInput();return o.default.cloneElement(e,{ref:"input",onChange:function(n){return null!=e.props.onChange&&e.props.onChange(n),t._inputChanged(n)},onKeyDown:function(n){return null!=e.props.onKeyDown&&e.props.onKeyDown(n),t._proxyKeys(n)},onBlur:function(n){return null!=e.props.onBlur&&e.props.onBlur(n),t._onBlur(n)},onFocus:function(n){return null!=e.props.onFocus&&e.props.onFocus(n),t._onFocus(n)},placeholder:t.props.placeholder,value:t.state.value,name:t.props.name,autoComplete:"off",disabled:t.props.disabled})},t._renderSelector=function(){return o.default.cloneElement(t.props.renderSelector(),{ref:"selector",queryOptions:t.state.queryResults,onSelect:t._autocomplete,onClose:t._clearResults,maxVisible:t.props.maxVisible})},t._inputChanged=function(e){var n=e.target.value;return t.setState({value:e.target.value}),t.props.onChange(n),t._queryDataSource(n),t.refs.selector.reset()},t._getCurrentValue=function(){return a.findDOMNode(t.refs.input).value},t._queryDataSource=function(e){var n=function(e){return t.queryResults=e,t.setState({queryResults:t.queryResults})};return t.props.dataSource.query(e,n,(function(r){if(e===t._getCurrentValue()&&r&&r.length){var i=t.queryResults?t.queryResults.concat(r):r;return n(i)}}))},t._proxyKeys=function(e){return t.refs.selector.onKeyDown(e)},t._autocomplete=function(e){return a.findDOMNode(t.refs.input).focus(),e=t.props.renderCompletionText(e),t.setState({value:e}),t.props.onSelect(e),t._clearResults()},t._clearResults=function(){return t.queryResults=null,t.setState({queryResults:t.queryResults})},t}return n.__extends(t,e),t.prototype.render=function(){var e={};return e[this.props.customClass]=null!=this.props.customClass,s.div({className:r.default(e),onMouseOver:this._onMouseOver,onMouseLeave:this._onMouseLeave},this._renderInput(),this._renderSelector())},t.prototype.componentWillReceiveProps=function(e){return this.setState({value:e.value})},t.displayName="Autocomplete",t.propTypes={customClass:l.string,maxVisible:l.number,dataSource:l.object.isRequired,onBlur:l.func,onSelect:l.func,onChange:l.func,placeholder:l.string,renderCompletionText:l.func.isRequired,renderInput:l.func.isRequired,renderSelector:l.func.isRequired,value:l.string,name:l.string,disabled:l.bool},t.defaultProps={value:"",maxVisible:7,onBlur:function(){},onSelect:function(e){},onChange:function(e){},renderCompletionText:function(e){return String(e)},renderInput:function(){return s.input()},renderSelector:function(){return o.default.createElement(m,null)},disabled:!1},t})(o.default.Component);t.Autocomplete=h;var m=i.default({displayName:"TypeaheadSelector",mixins:[_],propTypes:{customClass:l.string,maxVisible:l.number,onClose:l.func.isRequired,onSelect:l.func.isRequired,queryOptions:l.array,renderQueryOption:l.func.isRequired},getDefaultProps:function(){return{maxVisible:7,onClose:function(){},onSelect:function(e){},renderQueryOption:function(e){return s.li({},String(e))}}},render:function(){if(!this.getOptions().length)return s.div({});var e={"typeahead-selector":!0};return e[this.props.customClass]=null!=this.props.customClass,s.ul({className:r.default(e)},this.renderOptions())}});t.TypeaheadSelector=m})); //# sourceMappingURL=pkg-sharing-core.min.js-vflduplAu.map