/*************************************************************************
* ADOBE CONFIDENTIAL
* ___________________
*
*  Copyright 2014 Adobe Systems Incorporated
*  All Rights Reserved.
*
* NOTICE:  All information contained herein is, and remains
* the property of Adobe Systems Incorporated and its suppliers,
* if any.  The intellectual and technical concepts contained
* herein are proprietary to Adobe Systems Incorporated and its
* suppliers and are protected by all applicable intellectual property laws,
* including trade secret and or copyright laws.
* Dissemination of this information or reproduction of this material
* is strictly forbidden unless prior written permission is obtained
* from Adobe Systems Incorporated.
**************************************************************************/

/*************************************************************************
*
* ADOBE CONFIDENTIAL
* ___________________
*
*  Copyright 2014 Adobe Systems Incorporated
*  All Rights Reserved.
*
* NOTICE:  All information contained herein is, and remains
* the property of Adobe Systems Incorporated and its suppliers,
* if any.  The intellectual and technical concepts contained
* herein are proprietary to Adobe Systems Incorporated and its
* suppliers and may be covered by U.S. and Foreign Patents,
* patents in process, and are protected by trade secret or copyright law.
* Dissemination of this information or reproduction of this material
* is strictly forbidden unless prior written permission is obtained
* from Adobe Systems Incorporated.
**************************************************************************/

/*************************************************************************
 * ADOBE CONFIDENTIAL
 * ___________________
 *
 *  Copyright 2017 Adobe Systems Incorporated
 *  All Rights Reserved.
 *
 * NOTICE:  All information contained herein is, and remains
 * the property of Adobe Systems Incorporated and its suppliers,
 * if any.  The intellectual and technical concepts contained
 * herein are proprietary to Adobe Systems Incorporated and its
 * suppliers and are protected by all applicable intellectual property laws,
 * including trade secret and or copyright laws.
 * Dissemination of this information or reproduction of this material
 * is strictly forbidden unless prior written permission is obtained
 * from Adobe Systems Incorporated.
 **************************************************************************/

/*************************************************************************
*
* ADOBE CONFIDENTIAL
* ___________________
*
*  Copyright 201 Adobe Systems Incorporated
*  All Rights Reserved.
*
* NOTICE:  All information contained herein is, and remains
* the property of Adobe Systems Incorporated and its suppliers,
* if any.  The intellectual and technical concepts contained
* herein are proprietary to Adobe Systems Incorporated and its
* suppliers and may be covered by U.S. and Foreign Patents,
* patents in process, and are protected by trade secret or copyright law.
* Dissemination of this information or reproduction of this material
* is strictly forbidden unless prior written permission is obtained
* from Adobe Systems Incorporated.
**************************************************************************/

/*************************************************************************
* ADOBE CONFIDENTIAL
* ___________________
*
*  Copyright 2015 Adobe Systems Incorporated
*  All Rights Reserved.
*
* NOTICE:  All information contained herein is, and remains
* the property of Adobe Systems Incorporated and its suppliers,
* if any.  The intellectual and technical concepts contained
* herein are proprietary to Adobe Systems Incorporated and its
* suppliers and are protected by all applicable intellectual property laws,
* including trade secret and or copyright laws.
* Dissemination of this information or reproduction of this material
* is strictly forbidden unless prior written permission is obtained
* from Adobe Systems Incorporated.
**************************************************************************/

/*************************************************************************
 * ADOBE CONFIDENTIAL
 * ___________________
 *
 *  Copyright 2013 Adobe Systems Incorporated
 *  All Rights Reserved.
 *
 * NOTICE:  All information contained herein is, and remains
 * the property of Adobe Systems Incorporated and its suppliers,
 * if any.  The intellectual and technical concepts contained
 * herein are proprietary to Adobe Systems Incorporated and its
 * suppliers and are protected by all applicable intellectual property laws,
 * including trade secret and or copyright laws.
 * Dissemination of this information or reproduction of this material
 * is strictly forbidden unless prior written permission is obtained
 * from Adobe Systems Incorporated.
 **************************************************************************/

/*************************************************************************
 *
 * ADOBE CONFIDENTIAL
 * ___________________
 *
 *  Copyright 2014 Adobe Systems Incorporated
 *  All Rights Reserved.
 *
 * NOTICE:  All information contained herein is, and remains
 * the property of Adobe Systems Incorporated and its suppliers,
 * if any.  The intellectual and technical concepts contained
 * herein are proprietary to Adobe Systems Incorporated and its
 * suppliers and may be covered by U.S. and Foreign Patents,
 * patents in process, and are protected by trade secret or copyright law.
 * Dissemination of this information or reproduction of this material
 * is strictly forbidden unless prior written permission is obtained
 * from Adobe Systems Incorporated.
 **************************************************************************/

/*************************************************************************
* ADOBE CONFIDENTIAL
* ___________________
*
*  Copyright 2017 Adobe Systems Incorporated
*  All Rights Reserved.
*
* NOTICE:  All information contained herein is, and remains
* the property of Adobe Systems Incorporated and its suppliers,
* if any.  The intellectual and technical concepts contained
* herein are proprietary to Adobe Systems Incorporated and its
* suppliers and are protected by all applicable intellectual property laws,
* including trade secret and or copyright laws.
* Dissemination of this information or reproduction of this material
* is strictly forbidden unless prior written permission is obtained
* from Adobe Systems Incorporated.
**************************************************************************/

/*************************************************************************
*
* ADOBE CONFIDENTIAL
* ___________________
*
*  Copyright 2017 Adobe Systems Incorporated
*  All Rights Reserved.
*
* NOTICE:  All information contained herein is, and remains
* the property of Adobe Systems Incorporated and its suppliers,
* if any.  The intellectual and technical concepts contained
* herein are proprietary to Adobe Systems Incorporated and its
* suppliers and may be covered by U.S. and Foreign Patents,
* patents in process, and are protected by trade secret or copyright law.
* Dissemination of this information or reproduction of this material
* is strictly forbidden unless prior written permission is obtained
* from Adobe Systems Incorporated.
**************************************************************************/

/*************************************************************************
 *
 * ADOBE CONFIDENTIAL
 * ___________________
 *
 *  Copyright 2017 Adobe Systems Incorporated
 *  All Rights Reserved.
 *
 * NOTICE:  All information contained herein is, and remains
 * the property of Adobe Systems Incorporated and its suppliers,
 * if any.  The intellectual and technical concepts contained
 * herein are proprietary to Adobe Systems Incorporated and its
 * suppliers and may be covered by U.S. and Foreign Patents,
 * patents in process, and are protected by trade secret or copyright law.
 * Dissemination of this information or reproduction of this material
 * is strictly forbidden unless prior written permission is obtained
 * from Adobe Systems Incorporated.
 **************************************************************************/

/*************************************************************************
 * ADOBE CONFIDENTIAL
 * ___________________
 *
 *  Copyright 2017 Adobe Systems Incorporated
 *  All Rights Reserved.
 *
 * NOTICE:  All information contained herein is, and remains
 * the property of Adobe Systems Incorporated and its suppliers,
 * if any.  The intellectual and technical concepts contained
 * herein are proprietary to Adobe Systems Incorporated and its
 * suppliers and are protected by all applicable intellectual property
 * laws, including trade secret and copyright laws.
 * Dissemination of this information or reproduction of this material
 * is strictly forbidden unless prior written permission is obtained
 * from Adobe Systems Incorporated.
 **************************************************************************/

/*************************************************************************
* ADOBE CONFIDENTIAL
* ___________________
*
*  Copyright 2013 Adobe Systems Incorporated
*  All Rights Reserved.
*
* NOTICE:  All information contained herein is, and remains
* the property of Adobe Systems Incorporated and its suppliers,
* if any.  The intellectual and technical concepts contained
* herein are proprietary to Adobe Systems Incorporated and its
* suppliers and are protected by all applicable intellectual property laws,
* including trade secret and or copyright laws.
* Dissemination of this information or reproduction of this material
* is strictly forbidden unless prior written permission is obtained
* from Adobe Systems Incorporated.
**************************************************************************/

/*************************************************************************
 * ADOBE CONFIDENTIAL
 * ___________________
 *
 *  Copyright 2018 Adobe Systems Incorporated
 *  All Rights Reserved.
 *
 * NOTICE:  All information contained herein is, and remains
 * the property of Adobe Systems Incorporated and its suppliers,
 * if any.  The intellectual and technical concepts contained
 * herein are proprietary to Adobe Systems Incorporated and its
 * suppliers and are protected by all applicable intellectual property laws,
 * including trade secret and or copyright laws.
 * Dissemination of this information or reproduction of this material
 * is strictly forbidden unless prior written permission is obtained
 * from Adobe Systems Incorporated.
 **************************************************************************/

/*************************************************************************
 * ADOBE CONFIDENTIAL
 * ___________________
 *
 *  Copyright 2018 Adobe Systems Incorporated
 *  All Rights Reserved.
 *
 * NOTICE:  All information contained herein is, and remains
 * the property of Adobe Systems Incorporated and its suppliers,
 * if any.  The intellectual and technical concepts contained
 * herein are proprietary to Adobe Systems Incorporated and its
 * suppliers and are protected by all applicable intellectual property
 * laws, including trade secret and copyright laws.
 * Dissemination of this information or reproduction of this material
 * is strictly forbidden unless prior written permission is obtained
 * from Adobe Systems Incorporated.
 **************************************************************************/

/*************************************************************************
 * ADOBE CONFIDENTIAL
 * ___________________
 *
 *  Copyright 2020 Adobe Systems Incorporated
 *  All Rights Reserved.
 *
 * NOTICE:  All information contained herein is, and remains
 * the property of Adobe Systems Incorporated and its suppliers,
 * if any.  The intellectual and technical concepts contained
 * herein are proprietary to Adobe Systems Incorporated and its
 * suppliers and are protected by all applicable intellectual property
 * laws, including trade secret and copyright laws.
 * Dissemination of this information or reproduction of this material
 * is strictly forbidden unless prior written permission is obtained
 * from Adobe Systems Incorporated.
 **************************************************************************/

/*************************************************************************
* ADOBE CONFIDENTIAL
* ___________________
*
*  Copyright 2017 Adobe Systems Incorporated
*  All Rights Reserved.
*
* NOTICE:  All information contained herein is, and remains
* the property of Adobe Systems Incorporated and its suppliers,
* if any.  The intellectual and technical concepts contained
* herein are proprietary to Adobe Systems Incorporated and its
* suppliers and are protected by all applicable intellectual property laws,
* including trade secret and or copyright laws.
* Dissemination of this information or reproduction of this material
* is strictly forbidden unless prior written permission is obtained
* from Adobe Systems Incorporated.
**************************************************************************/

/*************************************************************************
*
* ADOBE CONFIDENTIAL
* ___________________
*
*  Copyright 2012 Adobe Systems Incorporated
*  All Rights Reserved.
*
* NOTICE:  All information contained herein is, and remains
* the property of Adobe Systems Incorporated and its suppliers,
* if any.  The intellectual and technical concepts contained
* herein are proprietary to Adobe Systems Incorporated and its
* suppliers and may be covered by U.S. and Foreign Patents,
* patents in process, and are protected by trade secret or copyright law.
* Dissemination of this information or reproduction of this material
* is strictly forbidden unless prior written permission is obtained
* from Adobe Systems Incorporated.
**************************************************************************/

/*************************************************************************
 *
 * ADOBE CONFIDENTIAL
 * ___________________
 *
 *  Copyright 2013 Adobe Systems Incorporated
 *  All Rights Reserved.
 *
 * NOTICE:  All information contained herein is, and remains
 * the property of Adobe Systems Incorporated and its suppliers,
 * if any.  The intellectual and technical concepts contained
 * herein are proprietary to Adobe Systems Incorporated and its
 * suppliers and may be covered by U.S. and Foreign Patents,
 * patents in process, and are protected by trade secret or copyright law.
 * Dissemination of this information or reproduction of this material
 * is strictly forbidden unless prior written permission is obtained
 * from Adobe Systems Incorporated.
 **************************************************************************/

/*************************************************************************
*
* ADOBE CONFIDENTIAL
* ___________________
*
*  Copyright 2013 Adobe Systems Incorporated
*  All Rights Reserved.
*
* NOTICE:  All information contained herein is, and remains
* the property of Adobe Systems Incorporated and its suppliers,
* if any.  The intellectual and technical concepts contained
* herein are proprietary to Adobe Systems Incorporated and its
* suppliers and may be covered by U.S. and Foreign Patents,
* patents in process, and are protected by trade secret or copyright law.
* Dissemination of this information or reproduction of this material
* is strictly forbidden unless prior written permission is obtained
* from Adobe Systems Incorporated.
**************************************************************************/

/*************************************************************************
 * ADOBE CONFIDENTIAL
 * ___________________
 *
 *  Copyright 2014 Adobe Systems Incorporated
 *  All Rights Reserved.
 *
 * NOTICE:  All information contained herein is, and remains
 * the property of Adobe Systems Incorporated and its suppliers,
 * if any.  The intellectual and technical concepts contained
 * herein are proprietary to Adobe Systems Incorporated and its
 * suppliers and are protected by all applicable intellectual property laws,
 * including trade secret and or copyright laws.
 * Dissemination of this information or reproduction of this material
 * is strictly forbidden unless prior written permission is obtained
 * from Adobe Systems Incorporated.
 **************************************************************************/

/*************************************************************************
* ADOBE CONFIDENTIAL
* ___________________
*
*  Copyright 2019 Adobe Systems Incorporated
*  All Rights Reserved.
*
* NOTICE:  All information contained herein is, and remains
* the property of Adobe Systems Incorporated and its suppliers,
* if any.  The intellectual and technical concepts contained
* herein are proprietary to Adobe Systems Incorporated and its
* suppliers and are protected by all applicable intellectual property laws,
* including trade secret and or copyright laws.
* Dissemination of this information or reproduction of this material
* is strictly forbidden unless prior written permission is obtained
* from Adobe Systems Incorporated.
**************************************************************************/

/*************************************************************************
*
* ADOBE CONFIDENTIAL
* ___________________
*
*  Copyright 2015 Adobe Systems Incorporated
*  All Rights Reserved.
*
* NOTICE:  All information contained herein is, and remains
* the property of Adobe Systems Incorporated and its suppliers,
* if any.  The intellectual and technical concepts contained
* herein are proprietary to Adobe Systems Incorporated and its
* suppliers and may be covered by U.S. and Foreign Patents,
* patents in process, and are protected by trade secret or copyright law.
* Dissemination of this information or reproduction of this material
* is strictly forbidden unless prior written permission is obtained
* from Adobe Systems Incorporated.
**************************************************************************/

/*************************************************************************
 *
 * ADOBE CONFIDENTIAL
 * ___________________
 *
 *  Copyright 2019 Adobe Systems Incorporated
 *  All Rights Reserved.
 *
 * NOTICE:  All information contained herein is, and remains
 * the property of Adobe Systems Incorporated and its suppliers,
 * if any.  The intellectual and technical concepts contained
 * herein are proprietary to Adobe Systems Incorporated and its
 * suppliers and may be covered by U.S. and Foreign Patents,
 * patents in process, and are protected by trade secret or copyright law.
 * Dissemination of this information or reproduction of this material
 * is strictly forbidden unless prior written permission is obtained
 * from Adobe Systems Incorporated.
 **************************************************************************/

/*************************************************************************
 * ADOBE CONFIDENTIAL
 * ___________________
 *
 *  Copyright 2015 Adobe Systems Incorporated
 *  All Rights Reserved.
 *
 * NOTICE:  All information contained herein is, and remains
 * the property of Adobe Systems Incorporated and its suppliers,
 * if any.  The intellectual and technical concepts contained
 * herein are proprietary to Adobe Systems Incorporated and its
 * suppliers and are protected by all applicable intellectual property laws,
 * including trade secret and or copyright laws.
 * Dissemination of this information or reproduction of this material
 * is strictly forbidden unless prior written permission is obtained
 * from Adobe Systems Incorporated.
 **************************************************************************/

/*************************************************************************
* ADOBE CONFIDENTIAL
* ___________________
*
*  Copyright 2018 Adobe Systems Incorporated
*  All Rights Reserved.
*
* NOTICE:  All information contained herein is, and remains
* the property of Adobe Systems Incorporated and its suppliers,
* if any.  The intellectual and technical concepts contained
* herein are proprietary to Adobe Systems Incorporated and its
* suppliers and are protected by all applicable intellectual property laws,
* including trade secret and or copyright laws.
* Dissemination of this information or reproduction of this material
* is strictly forbidden unless prior written permission is obtained
* from Adobe Systems Incorporated.
**************************************************************************/

/*************************************************************************
 *
 * ADOBE CONFIDENTIAL
 * ___________________
 *
 *  Copyright 2018 Adobe Systems Incorporated
 *  All Rights Reserved.
 *
 * NOTICE:  All information contained herein is, and remains
 * the property of Adobe Systems Incorporated and its suppliers,
 * if any.  The intellectual and technical concepts contained
 * herein are proprietary to Adobe Systems Incorporated and its
 * suppliers and may be covered by U.S. and Foreign Patents,
 * patents in process, and are protected by trade secret or copyright law.
 * Dissemination of this information or reproduction of this material
 * is strictly forbidden unless prior written permission is obtained
 * from Adobe Systems Incorporated.
 **************************************************************************/

/*************************************************************************
 * ADOBE CONFIDENTIAL
 * ___________________
 *
 *  Copyright 2019 Adobe Systems Incorporated
 *  All Rights Reserved.
 *
 * NOTICE:  All information contained herein is, and remains
 * the property of Adobe Systems Incorporated and its suppliers,
 * if any.  The intellectual and technical concepts contained
 * herein are proprietary to Adobe Systems Incorporated and its
 * suppliers and are protected by all applicable intellectual property laws,
 * including trade secret and or copyright laws.
 * Dissemination of this information or reproduction of this material
 * is strictly forbidden unless prior written permission is obtained
 * from Adobe Systems Incorporated.
 **************************************************************************/

define("pdmplugins/esign/js/ac-esign",["plugins-common/ac-plugins"],function(e){var i=e.EchoSign;return i||(i=e.EchoSign={}),i}),define("pdmplugins/esign/js/models/es-limits-model",["pdmplugins/esign/js/ac-esign","aicx/ac-aicx","aicx/models/aicx-model"],function(e,i){return e.EchoSignLimitsModel=i.AicxModel.extend({url:function(){return i.baseAicUrisModel.get("users")+"users/me/limits/esign"}}),e.EchoSignLimitsModel}),define("pdmplugins/esign/js/models/model-factory",["core/ac-core","pdmplugins/esign/js/ac-esign","core/models/model","pdmplugins/esign/js/models/es-limits-model"],function(e,i){return i.ModelFactory=e.Model.extend({create:function(e,t,s){var n=i[e];return n?new n(t,s):void LOG(0,"AcEchoSign.ModelFactory.create: Unrecognized class: "+e)}}),i.ModelFactory}),define("pdmplugins/esign/js/models/ui/es-auth-ui-model",["core/ac-core","pdmplugins/esign/js/ac-esign","core/models/ui/ui-model"],function(e,i){return i.EchoSignAuthUiModel=e.UiModel.extend({recognized:{access_token:{type:"string",optional:!0},expiration_time:{type:"number",optional:!0},expiration_check_time:{type:"number",optional:!0},auth_status:{type:"string",optional:!0},api_access_point:{type:"string",optional:!0},web_access_point:{type:"string",optional:!0},signin_profile_id:{type:"string",optional:!0},signin_profile_name:{type:"string",optional:!0},loggedin_profile_name:{type:"string",optional:!0}},defaults:{expiration_check_time:12e4,expiration_time:0,auth_status:"",access_token:"",api_access_point:"",web_access_point:"",signin_profile_id:"",signin_profile_name:"",loggedin_profile_name:""},clearLastAuthState:function(){this.set("auth_status","",{silent:!0})},resetToDefaults:function(){this.set(this.defaults,{silent:!0})}}),i.EchoSignAuthUiModel}),define("pdmplugins/esign/js/models/ui/es-doc-upload-progress-ui-model",["core/ac-core","pdmplugins/esign/js/ac-esign","core/models/ui/ui-model"],function(e,i){return i.ESDocUploadProgressUiModel=e.UiModel.extend({recognized:{upload_response:{type:"object",optional:!0},progress_status:{type:"string",optional:!0},progress_obj:{type:"object",optional:!0},bytes_uploaded:{type:"number",optional:!0},bytes_total:{type:"number",optional:!0}},defaults:{upload_response:void 0,progress_status:"",progress_obj:void 0,bytes_uploaded:0,bytes_total:0}}),i.ESDocUploadProgressUiModel}),define("pdmplugins/esign/js/models/ui/es-offline-ui-model",["core/ac-core","pdmplugins/esign/js/ac-esign","core/models/ui/ui-model"],function(e,i){return i.EchoSignOfflineUiModel=e.UiModel.extend({recognized:{is_visible:{type:"boolean",optional:!0},user_action:{type:"string",optional:!0}},defaults:{is_visible:!1,user_action:""},resetToDefaults:function(){this.set(this.defaults,{silent:!0})}}),i.EchoSignOfflineUiModel}),define("pdmplugins/esign/js/models/ui/ui-model-factory",["core/ac-core","pdmplugins/esign/js/ac-esign","core/models/model","pdmplugins/esign/js/models/ui/es-auth-ui-model","pdmplugins/esign/js/models/ui/es-doc-upload-progress-ui-model","pdmplugins/esign/js/models/ui/es-offline-ui-model"],function(e,i){return i.UiModelFactory=e.Model.extend({create:function(e,t,s){var n=i[e];return n?new n(t,s):void LOG(0,"AcEchoSign.UiModelFactory.create: Unrecognized class: "+e)}}),i.UiModelFactory}),define("pdmplugins/esign/js/ops/fetch-existing-es-auth-session-op",["pdmplugins/esign/js/ac-esign","core/ac-core","core/ops/op"],function(e,i){return e.FetchExistingESAuthSessionOp=i.Op.extend({run:function(){var e=(this.options,$.Deferred());return this.options.appApi.rnaApi.done(_.bind(function(i){i.esApi.invokeMethod({methodName:"fetchESAuthSession"}).then(function(i){e.resolve(i)},function(){e.reject()})},this)),e}}),e.FetchExistingESAuthSessionOp}),define("pdmplugins/esign/js/ops/creating-new-es-auth-session-op",["pdmplugins/esign/js/ac-esign","core/ac-core","core/utils/http-util","core/ops/op"],function(e,i,t){var s="";return s+="{",s+='"ims_client_id":"<%= imsClientId %>",',s+='"ims_access_token":"<%= imsAccessToken %>",',s+='"es_client_id":"<%= esClientId %>",',s+='"es_client_secret":"<%= esClientSecret %>"',s+="}",e.CreatingNewESAuthSessionOp=i.Op.extend({run:function(){var e=this.options,i=$.Deferred();return e.appApi.rnaApi.done(_.bind(function(t){e.appApi.sessionApi.ensureSignedIn().then(_.bind(function(){this.createNewSession(t,i)},this),_.bind(function(e){e&&"NoAccessToPdfServices"===e.errorString?this.createNewSession(t,i):i.reject()},this))},this)),i},createNewSession:function(e,i){var n,o,a,l,r,d,p,h,c,u=this.options;if(o=e.esApi.getEchoSignServiceParams(),a=o.baseURL,l=o.esClientId,r=o.esClientSecret,d=u.appApi.options.sessionUiModel.get("primary_token"),p=o.imsClientId,_.isEmpty(a)||_.isEmpty(l)||_.isEmpty(r)||_.isEmpty(d)||_.isEmpty(p))return void i.reject();var m=t.getClientIdQueryParam(),E=m.lastIndexOf("=");n=a+"/api/rest/v6/baseUris",h=_.template(s,{imsAccessToken:d,imsClientId:p,esClientId:l,esClientSecret:r}),c={Authorization:"Bearer "+d,"x-api-client-id":m.substr(E+1)},$.ajax({url:n,modal:!1,global:!1,headers:c,contentType:"application/json",type:"GET",dataType:"json",success:function(e){i.resolve(e)},error:_.bind(function(e){var t=e.responseJSON||{};"INVALID_IMS_PROFILE"===t.code&&void 0!==t.details&&t.details.signProfile.authenticatingAccount===t.details.loggedInProfile.authenticatingAccount?(u.signProfileID=t.details.signProfile.profileId,u.signProfileName=t.details.signProfile.profileName,u.loggedInProfileName=t.details.loggedInProfile.profileName,u.appApi.rnaApi.done(_.bind(function(e){e.esApi.invokeMethod({methodName:"GetEchoSignAccessTokenFromCluster",methodArgs:[t.details.signProfile.profileId,t.details.signProfile.profileName,t.details.loggedInProfile.profileName]}).then(_.bind(function(e){u.accessToken=e.accessToken;var t=(new Date).getTime()/1e3;u.expiresIn=e.expiryTime/1e3-t,c={Authorization:"Bearer "+e.accessToken,"x-api-client-id":m.substr(E+1)},$.ajax({url:n,modal:!1,global:!1,headers:c,contentType:"application/json",type:"GET",dataType:"json",success:_.bind(function(e){e.sign_profile_id=u.signProfileID,e.sign_profile_name=u.signProfileName,e.loggedin_profile_name=u.loggedInProfileName,e.access_token=u.accessToken,e.expires_in=u.expiresIn,i.resolve(e)},this),error:function(){i.reject()}})},this),function(){i.reject(t)})},this))):i.reject()},this)})}}),e.CreatingNewESAuthSessionOp}),define("pdmplugins/esign/js/ops/storing-es-auth-session-op",["pdmplugins/esign/js/ac-esign","core/ac-core","core/ops/op"],function(e,i){return e.StoringESAuthSessionOp=i.Op.extend({run:function(){var e=this.options,i=$.Deferred(),t=e.esAuthUiModel.get("access_token"),s=e.esAuthUiModel.get("expiration_time"),n=e.esAuthUiModel.get("refresh_token"),o=e.esAuthUiModel.get("api_access_point"),a=e.esAuthUiModel.get("web_access_point"),l=e.esAuthUiModel.get("signin_profile_id"),r=e.esAuthUiModel.get("signin_profile_name"),d=e.esAuthUiModel.get("loggedin_profile_name");return this.options.appApi.rnaApi.done(_.bind(function(e){e.esApi.setEchoSignApiURL(o),e.esApi.setEchoSignWebURL(a),e.esApi.invokeMethod({methodName:"storeESAuthSession",methodArgs:[n,t,s.toString(),o,a,l,r,d]}).then(function(){i.resolve()},function(){i.reject()})},this)),i}}),e.StoringESAuthSessionOp}),define("pdmplugins/esign/js/ops/upload-document-to-echosign-op",["pdmplugins/esign/js/ac-esign","core/ac-core","core/ops/op"],function(e,i){return e.UploadDocumentToEchoSignOp=i.Op.extend({UPLOAD_STATES:{STARTED:0,FINISHED:1,QUEUED:2},run:function(){var e,i=this.options,t=$.Deferred();if(_.isEmpty(i.esAccessToken)||_.isEmpty(i.esUploadEndpoint))return this._getRejectedPromise();var s="false";if("true"==i.UploadFssSign)s=i.UploadFssSign;else if(_.isEmpty(i.docToUpload)||_.isEmpty(i.mimeType))return this._getRejectedPromise();var n="";return i.apiVersion&&(n=i.apiVersion),e={file:i.docToUpload._proxy,accessToken:i.esAccessToken,uploadEndpoint:i.esUploadEndpoint,mimeType:i.mimeType,fssSignUpload:s,ApiVersion:n},this.options.appApi.rnaApi.done(_.bind(function(i){i.esApi.invokeMethod({methodName:"uploadDocument",methodArgs:e}).then(function(e){t.resolve(e)},function(e){t.reject(e)})},this)),t}}),e.UploadDocumentToEchoSignOp}),define("pdmplugins/esign/js/ops/listening-for-es-doc-upload-progress-events-op",["pdmplugins/esign/js/ac-esign","core/ac-core","core/ops/op"],function(e,i){var t=e.UploadDocumentToEchoSignOp.prototype.UPLOAD_STATES;return e.ListeningForESDocUploadProgressEventsOp=i.Op.extend({run:function(){var e=this.options,i=e.esDocUploadProgressUiModel,s=i.get("upload_response"),n=i.get("progress_obj");return n?(n._addEventListener("custom:uploadProgress",function(e,n){n.params?(s.status=t.RUNNING,i.set("bytes_uploaded",n.params.bytesWritten),i.set("bytes_total",n.params.bytesTotal),i.set("progress_status","ongoing")):(s.errorSet=!0,s.status=t.FINISHED,i.set("progress_status","finished"))}),n._addEventListener("custom:uploadFinished",function(e,n){n.params?_.isUndefined(n.params.errorCode)||0===n.params.errorCode?(s.respStatusCode=n.params.httpRespCode,_.isEmpty(n.params.respBody)||201!==s.respStatusCode||(s.respBody=JSON.parse(n.params.respBody),void 0!=n.params.clusterTokenFetched&&(s.clusterTokenFetched=JSON.parse(n.params.clusterTokenFetched)))):(s.errorSet=!0,s.errorCode=n.params.errorCode,s.respBody=n.params.respBody,s.respStatusCode=n.params.httpRespCode):s.errorSet=!0,s.status=t.FINISHED,i.set("progress_status","finished")}),this._getResolvedPromise()):(s.errorSet=!0,s.status=t.FINISHED,void i.set("progress_status","finished"))}}),e.ListeningForESDocUploadProgressEventsOp}),define("pdmplugins/esign/js/ops/fetch-es-user-subscription-info-op",["pdmplugins/esign/js/ac-esign","core/ac-core","core/ops/op"],function(e,i){return e.FetchESUserSubscriptionInfoOp=i.Op.extend({run:function(){var e=(this.options,$.Deferred());return this.options.appApi.sessionApi.ensureSignedIn().then(_.bind(function(){this.fetchESUserSubscriptionInfo(e)},this),_.bind(function(i){i&&"NoAccessToPdfServices"===i.errorString?this.fetchESUserSubscriptionInfo(e):e.reject(!1)},this)),e},fetchESUserSubscriptionInfo:function(i){var t,s,n,o=this.options,a=e.opFactory,l=o.esLimitsModel,r=["pro","global","enterprise","team"];s=a.create("GettingESLimitsOp",o),s.run().then(function(){n=l.get("esign_access").toLowerCase(),t=$.inArray(n,r)>-1,i.resolve(t)},function(){i.reject()})}}),e.FetchESUserSubscriptionInfoOp}),define("pdmplugins/esign/js/ops/refreshing-es-auth-session-op",["pdmplugins/esign/js/ac-esign","core/ac-core","core/ops/op"],function(e,i){return e.RefreshingESAuthSessionOp=i.Op.extend({run:function(){var e=this.options,i=$.Deferred(),t={};return 0!==e.esAuthUiModel.get("signin_profile_id").length&&0!==e.esAuthUiModel.get("signin_profile_name").length&&0!==e.esAuthUiModel.get("loggedin_profile_name").length?(t.access_token=e.esAuthUiModel.get("access_token"),t.expires_in=e.esAuthUiModel.get("expiration_time")/1e3):(t.access_token=e.appApi.options.sessionUiModel.get("primary_token"),t.expires_in=e.appApi.options.sessionUiModel.get("expiration_time")),t.token_type="Bearer",i.resolve(t),i}}),e.RefreshingESAuthSessionOp}),define("pdmplugins/esign/js/ops/getting-es-limits-op",["pdmplugins/esign/js/ac-esign","core/ac-core","core/ops/op"],function(e,i){return e.GettingESLimitsOp=i.Op.extend({run:function(){return this.options.esLimitsModel.fetch({modal:!1,global:!1})}}),e.GettingESLimitsOp}),define("pdmplugins/esign/js/api/es-auth-api",["core/ac-core","pdmplugins/esign/js/ac-esign","core/apis/api"],function(e,i){return i.EchoSignAuthApi=e.Api.extend({initialize:function(){e.Api.prototype.initialize.call(this),this._authSessionClients=[],this._initStateMachine(),this._initializeOperationMap()},createAuthSession:function(e){var i=_.extend({},e),t=$.Deferred(),s={promise:t};return this._authSessionClients.push(s),this._fsm.handleEvent("CreateESAuthSession",i),t},clearESAuthSession:function(){this._fsm.handleEvent("ClearESAuthSession",_.extend({},this.options))},evaluateAuthStatus:function(e){var i=_.extend({},e),t=$.Deferred(),s={promise:t};return this._authSessionClients.push(s),this._fsm.handleEvent("CheckESAuthStatus",i),t},isLoggedIn:function(){var e=this.options.esAuthUiModel,i=e.get("access_token"),t=e.get("expiration_time");return this._isESAccessTokenValid(i,t)},handleSessionSignOut:function(){this._fsm.handleEvent("IMSUserLoggedOut",_.extend({},this.options))},handleSessionSignedIn:function(){this._fsm.handleEvent("IMSUserLoggedIn",_.extend({},this.options))},handleNetworkDisconnectedEvent:function(){this._fsm.handleEvent("NetworkDisconnectedEvent",_.extend({},this.options))},_initStateMachine:function(){var e=_.extend({controller:this},this.options);this._fsm=i.fsmFactory.create("EchoSignAuthFSM",e)},_initializeOperationMap:function(){this._opMap=this._opMap||{},this._opMap.FetchESAuthSessionOp=this._fetchESAuthSession,this._opMap.CreateNewESAuthSessionOp=this._createNewESAuthSession,this._opMap.ConvertExpiryTimeToAbsoluteTimeOp=this._convertExpiryTimeToAbsoluteTime,this._opMap.CheckESAuthSessionNeedsRefreshOp=this._checkESAuthSessionNeedsRefresh,this._opMap.RefreshESAuthSessionOp=this._refreshESAuthSession,this._opMap.StoreESAuthSessionOp=this._storeESAuthSession,this._opMap.MarkESAuthSessionInProgressOp=this._markESAuthSessionInProgress,this._opMap.MarkESUserAuthenticatedOp=this._markESUserAuthenticated,this._opMap.MarkESUserNotAuthenticatedOp=this._markESUserNotAuthenticated,this._opMap.NotifyESAuthSuccessToClientsOp=this._notifyESAuthSuccessToClients,this._opMap.NotifyESAuthFailureToClientsOp=this._notifyESAuthFailureToClients,this._opMap.ClearESAuthSessionOp=this._clearESAuthSession},_invokeOperation:function(e){var i=e.opName;if(this._opMap){var t=this._opMap[i];t.call(this,e)}},_fetchESAuthSession:function(e){i.opFactory.create("FetchExistingESAuthSessionOp",this.options).run().then(_.bind(function(i){this.options.appApi.rnaApi.done(_.bind(function(t){this.options.appApi.rnaApi.accessToken=i.accessToken,e.es_access_token=i.accessToken,e.es_refresh_token=i.refreshToken,e.es_token_expiry_time=i.expiryTime,e.es_api_access_point=i.signApiUrl,e.es_web_access_point=i.signWebUrl,e.es_t2e_signIn_profile_id=i.signProfileID,e.es_t2e_signIn_profile_name=i.signProfileName,e.es_t2e_loggedin_profile_name=i.loggedinProfileName,t.esApi.setEchoSignApiURL(i.signApiUrl),t.esApi.setEchoSignWebURL(i.signWebUrl),_.isEmpty(e.es_access_token)||_.isEmpty(e.es_api_access_point)?this._fsm.handleEvent("ESAuthSessionDoesNotExists",e):this._fsm.handleEvent("ESAuthSessionExists",e)},this))},this),_.bind(function(){this._fsm.handleEvent("ESAuthSessionDoesNotExists",e)},this))},_createNewESAuthSession:function(e){i.opFactory.create("CreatingNewESAuthSessionOp",this.options).run().then(_.bind(function(i){"undefined"!=typeof i.sign_profile_id&&0!==i.sign_profile_id.length&&"undefined"!=typeof i.sign_profile_name&&0!==i.sign_profile_name.length&&"undefined"!=typeof i.loggedin_profile_name&&0!==i.loggedin_profile_name.length?(e.es_access_token=i.access_token,e.es_refresh_token="",e.es_token_expiry_time=i.expires_in,e.es_t2e_signIn_profile_id=i.sign_profile_id,e.es_t2e_signIn_profile_name=i.sign_profile_name,e.es_t2e_loggedin_profile_name=i.loggedin_profile_name):(e.es_access_token=e.appApi.options.sessionUiModel.get("primary_token"),e.es_refresh_token="",e.es_token_expiry_time=e.appApi.options.sessionUiModel.get("expiration_time"),e.es_t2e_signIn_profile_id="",e.es_t2e_signIn_profile_name="",e.es_t2e_loggedin_profile_name=""),e.es_token_type="Bearer";var t=i.apiAccessPoint,s=i.webAccessPoint;"/"==t.charAt(t.length-1)&&(t=t.slice(0,-1)),"/"==s.charAt(s.length-1)&&(s=s.slice(0,-1)),e.es_api_access_point=t,e.es_web_access_point=s,this.options.appApi.rnaApi.done(_.bind(function(e){e.esApi.setEchoSignApiURL(t),e.esApi.setEchoSignWebURL(s)},this)),e.es_error_code=i.error_code,e.es_error_msg=i.error_msg,this._fsm.handleEvent("ESAuthSessionCreateSuccess",e)},this),_.bind(function(){this._fsm.handleEvent("ESAuthSessionCreateFailure",e)},this))},_convertExpiryTimeToAbsoluteTime:function(e){var i=e.es_token_expiry_time,t=new Date;t.setTime(t.getTime()+1e3*i),e.es_token_expiry_time=t.getTime()},_checkESAuthSessionNeedsRefresh:function(e){var i=e.es_token_expiry_time;this._shouldRefreshESAccessToken(i)?this._fsm.handleEvent("ESAuthSessionNeedsRefresh",e):this._fsm.handleEvent("ESAuthSessionNeedsNoRefresh",e)},_refreshESAuthSession:function(e){var t=_.extend({},this.options,{es_refresh_token:e.es_refresh_token});i.opFactory.create("RefreshingESAuthSessionOp",t).run().then(_.bind(function(i){e.es_access_token=i.access_token,e.es_token_expiry_time=i.expires_in,e.es_token_type=i.token_type,this._fsm.handleEvent("ESAuthSessionRefreshSuccess",e)},this),_.bind(function(){this._fsm.handleEvent("ESAuthSessionRefreshFailure",e)},this))},_storeESAuthSession:function(){i.opFactory.create("StoringESAuthSessionOp",this.options).run()},_markESAuthSessionInProgress:function(){var e=this.options.esAuthUiModel;e.clearLastAuthState(),e.set("auth_status","in_progress")},_markESUserAuthenticated:function(e){var i=this.options.esAuthUiModel;i.clearLastAuthState(),i.set("access_token",e.es_access_token),i.set("expiration_time",e.es_token_expiry_time),i.set("refresh_token",e.es_refresh_token),i.set("signin_profile_id",e.es_t2e_signIn_profile_id),i.set("signin_profile_name",e.es_t2e_signIn_profile_name),i.set("loggedin_profile_name",e.es_t2e_loggedin_profile_name),i.set("api_access_point",e.es_api_access_point),i.set("web_access_point",e.es_web_access_point),i.set("auth_status","success")},_markESUserNotAuthenticated:function(){var e=this.options.esAuthUiModel;e.clearLastAuthState(),e.set("access_token",""),e.set("signin_profile_id",""),e.set("signin_profile_name",""),e.set("loggedin_profile_name",""),e.set("expiration_time",Number.NaN),e.set("auth_status","failure")},_notifyESAuthSuccessToClients:function(){_.each(this._authSessionClients,function(e){e.promise.resolve()})},_notifyESAuthFailureToClients:function(){_.each(this._authSessionClients,function(e){e.promise.reject()})},_clearESAuthSession:function(){this.options.esAuthUiModel.resetToDefaults(),this.options.appApi.rnaApi.done(_.bind(function(e){e.esApi.invokeMethod({methodName:"clearESAuthSession"})},this))},_isESAccessTokenValid:function(e,i){return _.isEmpty(e)?!1:this._getTimeDiffInESAccessTokenAndCurrentTime(i)>0},_shouldRefreshESAccessToken:function(e){var i=this._getTimeDiffInESAccessTokenAndCurrentTime(e);if(i>0){var t=this.options.esAuthUiModel,s=t.get("expiration_check_time");i-=s}return 0>=i},_getTimeDiffInESAccessTokenAndCurrentTime:function(e){var i=0,t=new Date;return 0>=e?i:i=e-t.getTime()}}),i.EchoSignAuthApi}),define("pdmplugins/esign/js/api/es-api",["core/ac-core","pdmplugins/esign/js/ac-esign","core/apis/api","pdmplugins/esign/js/api/es-auth-api"],function(e,i){return i.EchoSignApi=e.Api.extend({initialize:function(){var t=this.options;e.Api.prototype.initialize.call(this),this.authApi=new i.EchoSignAuthApi(t)}}),i.EchoSignApi}),define("pdmplugins/esign/js/ops/initializing-op",["pdmplugins/esign/js/ac-esign","core/ac-core","pdmplugins/esign/js/api/es-api","core/ops/op"],function(e,i){return e.InitializingOp=i.Op.extend({run:function(){var i=this.options,t=e.modelFactory,s=e.uiModelFactory;_.extend(i,{esLimitsModel:t.create("EchoSignLimitsModel"),esAuthUiModel:s.create("EchoSignAuthUiModel"),esOfflineUiModel:s.create("EchoSignOfflineUiModel")}),e.esApi=new e.EchoSignApi(i)}}),e.InitializingOp}),define("pdmplugins/esign/js/ops/logout-es-web-session-op",["pdmplugins/esign/js/ac-esign","core/ac-core","core/ops/op"],function(e,i){return e.LogOutESWebSessionOp=i.Op.extend({run:function(){var e,i,t,s=$.Deferred();return this.options.appApi.rnaApi.done(_.bind(function(n){return e=n.esApi.getEchoSignServiceParams(),i=e.webURL,console.log(i),_.isEmpty(i)?void s.reject():(t=i+"/public/logout",$("body").append("<div><iframe class='es-logout-frame' src='"+t+"'></iframe></div>"),void $(".es-logout-frame").load(_.bind(function(){n.esApi.invokeMethod({methodName:"unloadESLogoutWebFrame"})},this)))},this)),s}}),e.LogOutESWebSessionOp}),define("pdmplugins/esign/js/ops/cancel-upload-to-echosign-op",["pdmplugins/esign/js/ac-esign","core/ac-core","core/ops/op"],function(e,i){return e.CancelUploadToEchoSignOp=i.Op.extend({run:function(){var e=$.Deferred();return this.options.appApi.rnaApi.done(_.bind(function(i){i.esApi.invokeMethod({methodName:"cancelAllUploadWorkflows"}).then(function(){e.resolve()},function(){e.reject()})},this)),e}}),e.CancelUploadToEchoSignOp}),define("pdmplugins/esign/js/ops/op-factory",["core/ac-core","pdmplugins/esign/js/ac-esign","pdmplugins/esign/js/ops/fetch-existing-es-auth-session-op","pdmplugins/esign/js/ops/creating-new-es-auth-session-op","pdmplugins/esign/js/ops/storing-es-auth-session-op","pdmplugins/esign/js/ops/upload-document-to-echosign-op","pdmplugins/esign/js/ops/listening-for-es-doc-upload-progress-events-op","pdmplugins/esign/js/ops/fetch-es-user-subscription-info-op","pdmplugins/esign/js/ops/refreshing-es-auth-session-op","pdmplugins/esign/js/ops/getting-es-limits-op","pdmplugins/esign/js/ops/initializing-op","pdmplugins/esign/js/ops/logout-es-web-session-op","pdmplugins/esign/js/ops/cancel-upload-to-echosign-op"],function(e,i){return i.OpFactory=e.Op.extend({create:function(e,t){var s=i[e];return s?new s(t):void LOG(0,"AcEchoSign.OpFactory.create: Unrecognized class: "+e)}}),i.OpFactory}),define("pdmplugins/esign/js/fsm/fsm",["core/ac-core"],function(e){return e.FSM=Backbone.View.extend({SPECIAL_FSM_STATE:"*",initialize:function(){Backbone.View.prototype.initialize.call(this),this.cid=_.uniqueId("op"),delete this.options.viewId,delete this.$el,delete this.el,_.bindAll(this),this._stateEventTransitionTable=[],this._supportedStates=[],this._currentState=void 0,this._previousState=void 0,this._initFSM()},handleEvent:function(e,i){var t=this._getCurrentState(),s=!1;if(this._isSupportedState(t)){var n=this._getEventHandlerForState(t,e);return n?(n=_.bind(n,this),s=n(i)):s}},_initFSM:function(){},_getController:function(){return this.options.controller},_getSupportedStates:function(){return this._supportedStates},_setSupportedStates:function(e){this._supportedStates=e},_isSupportedState:function(e){var i=this._getSupportedStates(),t=_.contains(i,e);return t},_setPreviousState:function(e){this._previousState=e},_getPreviousState:function(){return this._previousState},_getCurrentState:function(){return this._currentState},_setCurrentState:function(e){this._isSupportedState(e)&&(this._setPreviousState(this._currentState),this._currentState=e)},_defineTransition:function(e,i,t){var s={state:e,eventName:i,eventHandler:t};this._stateEventTransitionTable.push(s)},_getEventHandlerForState:function(e,i){var t=_.find(this._stateEventTransitionTable,_.bind(function(t){return t.state===e&&t.eventName===i},this));return _.isEmpty(t)&&(t=_.find(this._stateEventTransitionTable,_.bind(function(e){return e.state===this.SPECIAL_FSM_STATE&&e.eventName===i},this))),t?t.eventHandler:void 0},_invokeController:function(e,i){i=i||{};var t=this._getController();if(t){var s=_.extend(i,{opName:e});t._invokeOperation(s)}}}),e.FSM}),define("pdmplugins/esign/js/fsm/es-auth-fsm",["core/ac-core","pdmplugins/esign/js/fsm/fsm","pdmplugins/esign/js/ac-esign"],function(e,i,t){var s={IDLE:0,FETCHING_EXISTING_ES_AUTH_SESSION_STATUS:1,WAITING_FOR_NEW_ES_AUTH_SESSION_TO_CREATE:2,CHECKING_ES_AUTH_SESSION_NEED_TO_REFRESH:3,WAITING_FOR_ES_AUTH_SESSION_TO_REFRESH:4};return t.EchoSignAuthFSM=i.extend({_initFSM:function(){this._setSupportedStates(_.values(s)),this._setCurrentState(s.IDLE),this._defineEventTransitions()},_defineEventTransitions:function(){this._defineTransition(s.IDLE,"CreateESAuthSession",function(e){e.creatingESAuthSession=!0,this._setCurrentState(s.FETCHING_EXISTING_ES_AUTH_SESSION_STATUS),this._invokeController("FetchESAuthSessionOp",e)}),this._defineTransition(s.IDLE,"CheckESAuthStatus",function(e){e.checkingESAuthSession=!0,this._setCurrentState(s.FETCHING_EXISTING_ES_AUTH_SESSION_STATUS),this._invokeController("FetchESAuthSessionOp",e)}),this._defineTransition(s.FETCHING_EXISTING_ES_AUTH_SESSION_STATUS,"ESAuthSessionExists",function(e){this._setCurrentState(s.CHECKING_ES_AUTH_SESSION_NEED_TO_REFRESH),this._invokeController("CheckESAuthSessionNeedsRefreshOp",e)}),this._defineTransition(s.FETCHING_EXISTING_ES_AUTH_SESSION_STATUS,"ESAuthSessionDoesNotExists",function(e){e.creatingESAuthSession?(this._setCurrentState(s.WAITING_FOR_NEW_ES_AUTH_SESSION_TO_CREATE),this._invokeController("MarkESAuthSessionInProgressOp",e),this._invokeController("CreateNewESAuthSessionOp",e)):e.checkingESAuthSession&&(this._setCurrentState(s.IDLE),this._invokeController("MarkESUserNotAuthenticatedOp",e),this._invokeController("NotifyESAuthFailureToClientsOp",e))}),this._defineTransition(s.CHECKING_ES_AUTH_SESSION_NEED_TO_REFRESH,"ESAuthSessionNeedsRefresh",function(e){e.creatingESAuthSession?(this._setCurrentState(s.WAITING_FOR_ES_AUTH_SESSION_TO_REFRESH),this._invokeController("RefreshESAuthSessionOp",e)):e.checkingESAuthSession&&(this._setCurrentState(s.IDLE),this._invokeController("MarkESUserNotAuthenticatedOp",e),this._invokeController("NotifyESAuthFailureToClientsOp",e))}),this._defineTransition(s.CHECKING_ES_AUTH_SESSION_NEED_TO_REFRESH,"ESAuthSessionNeedsNoRefresh",function(e){this._setCurrentState(s.IDLE),this._invokeController("MarkESUserAuthenticatedOp",e),this._invokeController("NotifyESAuthSuccessToClientsOp",e)}),this._defineTransition(s.WAITING_FOR_NEW_ES_AUTH_SESSION_TO_CREATE,"ESAuthSessionCreateSuccess",function(e){this._setCurrentState(s.IDLE),this._invokeController("ConvertExpiryTimeToAbsoluteTimeOp",e),this._invokeController("MarkESUserAuthenticatedOp",e),this._invokeController("StoreESAuthSessionOp",e),this._invokeController("NotifyESAuthSuccessToClientsOp",e)}),this._defineTransition(s.WAITING_FOR_NEW_ES_AUTH_SESSION_TO_CREATE,"ESAuthSessionCreateFailure",function(e){this._setCurrentState(s.IDLE),this._invokeController("MarkESUserNotAuthenticatedOp",e),this._invokeController("NotifyESAuthFailureToClientsOp",e),this._invokeController("ClearESAuthSessionOp",e)}),this._defineTransition(s.WAITING_FOR_ES_AUTH_SESSION_TO_REFRESH,"ESAuthSessionRefreshSuccess",function(e){this._setCurrentState(s.IDLE),this._invokeController("ConvertExpiryTimeToAbsoluteTimeOp",e),this._invokeController("MarkESUserAuthenticatedOp",e),this._invokeController("StoreESAuthSessionOp",e),this._invokeController("NotifyESAuthSuccessToClientsOp",e)}),this._defineTransition(s.WAITING_FOR_ES_AUTH_SESSION_TO_REFRESH,"ESAuthSessionRefreshFailure",function(e){this._setCurrentState(s.IDLE),this._invokeController("MarkESUserNotAuthenticatedOp",e),this._invokeController("NotifyESAuthFailureToClientsOp",e),this._invokeController("ClearESAuthSessionOp",e)}),this._defineTransition(s.IDLE,"ClearESAuthSession",function(e){this._setCurrentState(s.IDLE),this._invokeController("ClearESAuthSessionOp",e)}),this._defineTransition(this.SPECIAL_FSM_STATE,"SessionSignOut",function(){this._setCurrentState(s.IDLE)}),this._defineTransition(this.SPECIAL_FSM_STATE,"NetworkDisconnectedEvent",function(){this._setCurrentState(s.IDLE)})}}),t.EchoSignAuthFSM}),define("pdmplugins/esign/js/fsm/fsm-factory",["core/ac-core","pdmplugins/esign/js/ac-esign","pdmplugins/esign/js/fsm/fsm","pdmplugins/esign/js/fsm/es-auth-fsm"],function(e,i,t){return i.FSMFactory=t.extend({create:function(e,t){var s=i[e];return s?new s(t):void LOG(0,"AcEchoSign.OpFactory.create: Unrecognized class: "+e)}}),i.FSMFactory}),define("pdmplugins/esign/js/ac-esign-init",["pdmplugins/esign/js/ac-esign","pdmplugins/esign/js/models/model-factory","pdmplugins/esign/js/models/ui/ui-model-factory","pdmplugins/esign/js/ops/op-factory","pdmplugins/esign/js/fsm/fsm-factory"],function(e){return _.extend(e,{modelFactory:new e.ModelFactory,uiModelFactory:new e.UiModelFactory,opFactory:new e.OpFactory,fsmFactory:new e.FSMFactory}),e}),define("pdmplugins/unified-share/js/ac-unified-share",["plugins-common/ac-plugins","pdmplugins/esign/js/ac-esign-init"],function(e){var i=e.UnifiedShare;return i||(i=e.UnifiedShare={}),i.PLUGIN_ID||(i.PLUGIN_ID="unified_share"),i}),define("pdmplugins/unified-share/js/models/autocomplete-model",["core/ac-core","pdmplugins/unified-share/js/ac-unified-share","core/models/model"],function(e,i){return i.AutocompleteModel=e.Model.extend({idAttribute:"email",initialize:function(i,t){e.Model.prototype.initialize.call(this,i,t),this.rootUrl="",t.collection&&(this.rootUrl=t.collection.rootUrl),t.rootUrl&&(this.rootUrl=t.rootUrl)},url:function(){return this.rootUrl+"a/api/autoc/emails"}}),i.AutocompleteModel}),define("pdmplugins/unified-share/js/collections/autocomplete-collection",["pdmplugins/unified-share/js/ac-unified-share","core/utils/http-util","pdmplugins/unified-share/js/models/autocomplete-model"],function(e,i){return e.AutocompleteCollection=Backbone.Collection.extend({model:e.AutocompleteModel,initialize:function(e,i){Backbone.Collection.prototype.initialize.call(this,e,i),this.rootUrl=i.rootUrl,this.set({models:[]})},url:function(){return this.rootUrl+"/a/api/autoc/email"},fetch:function(e){return e=i.customizeOptions("GET",e),Backbone.Collection.prototype.fetch.call(this,e)},fetchNext:function(){var e={};return this.next_context&&(e.data=_.extend({},{context:this.next_context,sofar:this.length},e.data)),e.global=!1,e.remove=!1,this.fetch(e)},fetchAll:function(){this.fetchNext().then(_.bind(this.fetchComplete,this))},fetchComplete:function(){this.next_context&&this.fetchAll()},parse:function(e){e.emails;return this.next_context=e.next_context,e.emails},setRUrl:function(e){this.rootUrl=e}}),e.AutocompleteCollection}),define("pdmplugins/unified-share/js/ops/plugin/starting-plugin-op",["core/ac-core","pdmplugins/unified-share/js/ac-unified-share","pdmplugins/esign/js/ac-esign","core/ops/op","pdmplugins/unified-share/js/collections/autocomplete-collection"],function(e,i,t){i.StartingPluginOp=e.Op.extend({run:function(){var e,s=this.options,n=t.opFactory;return _.extend(s,{brandingModel:i.uiModelFactory.create("UsersMeBrandingModel",void 0,s),autoCCollection:new i.AutocompleteCollection([],{rootUrl:e})}),n.create("InitializingOp",s).run(),$.Deferred().resolve().promise()}})}),define("pdmplugins/unified-share/js/ops/plugin/starting-selector-op",["core/ac-core","pdmplugins/unified-share/js/ac-unified-share","core/utils/http-util","core/ops/op"],function(e,i,t){i.StartingSelectorOp=e.Op.extend({url:function(){return e.getBasePDMUrl()+"api/aax/selectors"},run:function(){var e,i,s=this.options;return e="GET",i=this.url(),$.ajax(i,{type:e,headers:t.getRequestHeaders(e)}).then(function(e){var i,t;t=_.clone(s.selectorUiModel.get("selectors"));for(i in e)e.hasOwnProperty(i)&&t.push(e[i].display_name);s.selectorUiModel.set("selectors",t)},function(){})}})}),define("pdmplugins/unified-share/js/ops/plugin/getting-authenticated-models-op",["core/ac-core","pdmplugins/unified-share/js/ac-unified-share","core/ops/op"],function(e,i){i.GettingAuthenticatedModelsOp=e.Op.extend({run:function(){var i=this.options,t=this.options.appApi.sessionApi.getPrimaryToken();return e.Util.isCEF()?(this.options.appApi.rnaApi.done(function(e){e.logPerformance("NwCall_ShareAFileLimits","start")}),$.when(i.limitsModel.fetch({global:!1,useProvidedAccessToken:t}).then(_.bind(function(){this.options.appApi.rnaApi.done(function(e){e.logPerformance("NwCall_ShareAFileLimits","end")})},this)))):$.when(i.limitsModel.fetch())}})}),define("pdmplugins/unified-share/js/utils/ts-utils",[],function(){var e={extractRootUrl:function(e){var i=document.createElement("a");return i.href=e,i.protocol+"//"+i.host}};return e}),define("pdmplugins/unified-share/js/ops/desktop-getting-subscription-levels-op",["core/ac-core","pdmplugins/unified-share/js/ac-unified-share","pdmplugins/unified-share/js/utils/ts-utils","core/ops/op"],function(e,i,t){i.DesktopGettingSubscriptionLevels=e.Op.extend({run:function(){return this.validateRegistry().then(_.bind(function(){return this.readFromRegistry()},this),_.bind(function(){return this.options.appApi.sessionApi.ensureSignedIn().then(_.bind(function(){return this.authenticatingFirstTime()
},this))},this))},authenticatingFirstTime:function(){return this.options.appApi.sessionApi.ensureSignedIn().then(_.bind(function(){return this.preModelFetchValues(),i.opFactory.create("GettingAuthenticatedModelsOp",this.options).run().then(_.bind(function(){return this.setModelValues(),this.writeToRegistry()},this))},this),_.bind(function(){return $.Deferred().reject().promise()},this))},setModelValues:function(){var i,t,s=e.Features.getFeature("enable_sender_survey"),n=!1,o=!1,a=this.options.appApi.usersMeApi.getUserCohorts();this._uiModel=this.options.sendFilesUiModel.set({limits_model:this.options.limitsModel}),i=this._uiModel.get("limits_model"),t=i.get("can_custom_brand"),a&&"enabled"===a["ts-sender-survey"]&&(n=!0),this._uiModel.set({customize_recipient_page:o,customize_recipient_page_enabled:t,enable_sender_survey:s&&n}),this.options.sendFilesUiModel=this._uiModel,this.options.sendFilesUiModel.initializeFromCohorts(a)},setModelValuesFromRegistry:function(){var e,i,t=this.registryResponse.Features.enableSenderSurvey,s=!1,n="true"===this.registryResponse.Branding.buttonEnabled?!0:!1,o=this.getCohortsFromRegistryResponse();this.options.limitsModel.set({can_custom_brand:this.registryResponse.Limits.canCustomBrand,can_send_to_individuals:this.registryResponse.Limits.canSendPersonalized,can_send_av:this.registryResponse.Limits.canSendAV,account_type:this.registryResponse.User.accountType}),this._uiModel=this.options.sendFilesUiModel.set({limits_model:this.options.limitsModel}),this.options.brandingModel.set({logo:this.registryResponse.Branding.logo?!0:""}),e=this._uiModel.get("limits_model"),i=e.get("can_custom_brand"),o&&"enabled"===o["ts-sender-survey"]&&(s=!0),this._uiModel.set({customize_recipient_page:n,customize_recipient_page_enabled:i,enable_sender_survey:t&&s}),this.options.sendFilesUiModel=this._uiModel,this.options.sendFilesUiModel.initializeFromCohorts(o),this.populateAutoCCollectionFromRegistry()},preModelFetchValues:function(){var e,i;e=this.options.appApi.baseFilesUrisApi.getSendApiUri(),e=t.extractRootUrl(e),i=this.options.appApi.baseFilesUrisApi.getAlternateUploadUri(),this.options.rootUrl=e,this.options.uploadUrl=i,this.options.limitsModel.setRUrl(this.options.rootUrl),this.options.brandingModel.setRUrl(this.options.rootUrl),this.options.autoCCollection.setRUrl(this.options.rootUrl)},readFromRegistry:function(){return this.options.appApi.rnaApi.then(_.bind(function(e){var i={prefName:"SendTrack"};return e.registryAPI.getRegistryContents(i).then(_.bind(function(e){return this.registryResponse=JSON.parse(e),this.setModelValuesFromRegistry(),this.options.readRegistry=!0,$.Deferred().resolve().promise()},this),_.bind(function(){return $.Deferred().reject().promise()},this))},this),_.bind(function(){return $.Deferred().reject().promise()},this))},writeToRegistry:function(){var e=this.makeRegistryHierarchy(),i=JSON.stringify(e),t={prefName:"SendTrack",data:i};return this.options.appApi.rnaApi.then(_.bind(function(e){e.registryAPI.setRegistryContents(t).then(_.bind(function(e){return e?$.Deferred().resolve().promise():$.Deferred().reject().promise()},this),_.bind(function(){return $.Deferred().reject().promise()},this))},this),_.bind(function(){return $.Deferred().reject().promise()},this))},validateRegistry:function(){return this.options.readRegistry?this.options.appApi.rnaApi.then(_.bind(function(e){var i={prefName:"SendTrack"};return e.registryAPI.checkIfRegistryExists(i).then(_.bind(function(e){return e?$.Deferred().resolve().promise():$.Deferred().reject().promise()},this),_.bind(function(){return $.Deferred().reject().promise()},this))},this),_.bind(function(){return $.Deferred().reject().promise()},this)):$.Deferred().reject().promise()},makeRegistryHierarchy:function(){var i=this.options.sendFilesUiModel,t=this.options.brandingModel,s=i.get("limits_model"),n=this.options.appApi.usersMeApi.getUserCohorts(),o={Limits:{canCustomBrand:s.get("can_custom_brand"),canSendAV:s.get("can_send_av"),canSendPersonalized:s.get("can_send_to_individuals")},Branding:{buttonEnabled:!1,logo:t.get("logo")?!0:!1},Cohorts:{respondBackOptions:_.isUndefined(n["ts-respond-back-1"])?"disabled":n["ts-respond-back-1"],chickletsEnabled:_.isUndefined(n["ts-chicklets"])?"enabled":n["ts-chicklets"]},Features:{enableSenderSurvey:e.Features.getFeature("enable_sender_survey")?!0:!1},User:{accountType:_.isUndefined(this.options.appApi.usersMeApi.getUserIdentity().account_type)?"":this.options.appApi.usersMeApi.getUserIdentity().account_type,Email:_.isUndefined(this.options.appApi.usersMeApi.getUserIdentity().email)?"":this.options.appApi.usersMeApi.getUserIdentity().email,addressList:this.getEmailAddressListString()}};return o},getEmailAddressListString:function(){var e="";return _.each(this.options.autoCCollection.models,function(i){(_.isUndefined(i.get("isLocalContact"))||i.get("isLocalContact")===!1)&&(e+=i.id,e+=";")}),!_.isUndefined(this.options.recipientsAreFinalized)&&this.options.recipientsAreFinalized&&_.each(this.options.recipients,function(i){i&&-1===e.search(i)&&(e+=i,e+=";")}),e},populateAutoCCollectionFromRegistry:function(){var e,i=this.options.autoCCollection;_.isUndefined(this.registryResponse.User)||_.isUndefined(this.registryResponse.User.addressList)||(e=this.registryResponse.User.addressList.split(";"),e.pop(),_.each(e,function(e){i.add({email:e,isLocalContact:!1})}))},getCohortsFromRegistryResponse:function(){var e=[];return _.isUndefined(this.registryResponse.Cohorts)||(e["ts-respond-back-1"]=this.registryResponse.Cohorts.respondBackOptions,e["ts-chicklets"]=this.registryResponse.Cohorts.chickletsEnabled),e}})}),define("pdmplugins/unified-share/js/nls/ui-strings",{root:!0,"ar-ae":!0,"bg-bg":!0,"ca-es":!0,"cs-cz":!0,"da-dk":!0,"de-de":!0,"en-ae":!0,"en-gb":!0,"en-il":!0,"es-es":!0,"eu-es":!0,"fi-fi":!0,"fr-fr":!0,"fr-ma":!0,"he-il":!0,"hr-hr":!0,"hu-hu":!0,"it-it":!0,"ja-jp":!0,"ko-kr":!0,"nb-no":!0,"nl-nl":!0,"pl-pl":!0,"pt-br":!0,"ro-ro":!0,"ru-ru":!0,"sk-sk":!0,"sl-si":!0,"sl-sl":!0,"sv-se":!0,"tr-tr":!0,"uk-ua":!0,"zh-cn":!0,"zh-tw":!0}),define("pdmplugins/unified-share/js/nls/root/ui-strings",{SELECTOR_LABEL:"UNIFIED_SHARE",SHARE_TAB_HEADER:"Share",CREATE_LINK_TAB_HEADER:"Create Link",ATTACH_TAB_HEADER:"Attach to Email",CLOSE:"close",SELECTED_FILES:"Selected Files",ADD_MORE_FILES:"Add Files",SHARE_NO_FILES_SELECTED:"There are currently no files selected.",SHARE_CLICK_TO_ADD_FILES:"Click the Add Files button to get started.",SHARE_REMOVE:"Remove File",SHARE_EMAIL_REMOVE:"Remove e-mail",SHARE_ADDRESS_HEADING:"Recipient Email Addresses",SHARE_ADDRESS_PROMPT:"Enter name or email...",SHARE_INDIVIDUAL_HELP:"help",SHARE_INITIAL_SUBJECT:"Subject: Shared Files",SHARE_INITIAL_SUBJECT_REVIEW:"Subject: Shared for Review",SHARE_INITIAL_SUBJECT_PREFIX:"Subject: ",SHARE_SUBJECT_MSG_HEADING:"Subject & Message",SHARE_MESSAGE_HEADING:"Message",SHARE_MESSAGE_PROMPT:"I have shared this file(s) with you. Please click on the link to view and download them.",SHARE_MESSAGE_PROMPT_REVIEW:"I have shared this file with you for review.",SHARE_MESSAGE_PROMPT_REVIEW_2:"Please click on the link and add your comments.",SHARE_MESSAGE_PROMPT_SIGN:"Please review and complete this document.",SHARE_MESSAGE_PROMPT_PLACEHOLDER:"Enter an optional personal message",SHARE_BUTTON:"Send",NEXT_BUTTON:"Next",CONTINUE_BUTTON:"Continue",SHARE_AV_ERROR:"Audio/video files are not supported for sending, and have been omitted from your selection.",SHARE_FORMS_ERROR_DESKTOP:"This file type is currently not supported and has been omitted from your selection.",SHARE_AV_FORMS_ERROR:"Audio/video and form files are not supported for sending, and have been omitted from your selection.",SHARE_AV_UPGRADE_MESSAGE:" Upgrade to be able to send audio/video files.",SHARE_UPLOAD_ERROR_TITLE:"Unable to upload some files",SHARE_UPLOAD_ERROR_MSG:"We weren’t able to upload some files to Document Cloud.",SHARE_AGAIN:"Send Another File",GO_TO_SENT_FILES:"Track Document",GO_TO_REVIEW:"Go to Review",SHARE_LOADER_UPLOAD:"Uploading to Adobe Document Cloud...",SHARE_LOADER_UPLOAD_SIGN:"Uploading to Adobe Acrobat Sign Cloud...",SHARE_LOADER_SENDING:"Sharing...",SHARE_LOADER_GENERATE_LINK:"Generating Link . . .",SHARE_LOADER_CHECKING_RESTRICTIONS:"Authorising...",DOC_SENT_HEADING:"Your document has been sent.",DOCS_SENT_HEADING:"Your documents have been sent.",DOC_SENT_SUMMARY:"You’ll be notified when someone views or downloads the file.",DOCS_SENT_SUMMARY:"You’ll be notified when someone views or downloads the files.",ADDED_MEMBERS:"ADDED MEMBERS (0)",ADDED_MEMBERS_NO_COUNT:"ADDED MEMBERS",PLACE_HOLDER_ALT:"Image Placeholder",PLACE_HOLDER_TEXT:"Send personalized invitation with detailed tracking for viewing, commenting and signing.",PLACE_HOLDER_TEXT2:"Send personalized invitation with detailed tracking for signing, viewing and commenting.",PLACE_HOLDER_TEXT3:"Send your file fast for viewing, comments, or signature — and track every action.",READER_GO_URL:"http://www.adobe.com/go/sendpluginrdr_12_0_0",ACROBAT_GO_URL:"http://www.adobe.com/go/sendpluginacro_12_0_0",GENERIC_ARIA_LABEL_STRING:"<%= prefix %>. <%= suffix %>",READER_FILESELECT_WINDOW_TITLE:"Select Files",READER_FILESELECT_CONTINUE_BUTTON:"Continue",ALL_SUPPORTED_FILES:"All supported files",SHARE_SUCCESS_CLOSE:"Close",SHARE_TOO_MANY_DLG_TITLE:"Too many email addresses",SHARE_TOO_MANU_DLG_MESSAGE:"You've entered <%=numRecipients%> email addresses, but you can only send to <%=maxRecipients%> at a time. Delete some addresses and try again.",ADD_FILES_REJECTED_TITLE:"Invalid Filename Format",ADD_FILES_REJECTED_MESSAGE:"Files must have a file name extension or be a known file type to be sent. Please ensure that your filename includes a valid file extension.",UNIFIED_SHARE_SUBJECT:"Shared Files",UNIFIED_SHARE_SUBJECT_REVIEW:"Shared for Review",UNIFIED_SHARE_MESSAGE:"I have shared some files with you. Please click on the link to view and download them.",CREATE_LINK_MESSAGE_HEADING:"SHAREABLE LINK",CREATE_LINK_MESSAGE_TEXT:"Anyone with the link can view this file.",CREATE_LINK_ALLOW_COMMENTS:"Allow Comments",CREATE_LINK_GENERATE:"Generate Link",CREATE_LINK_REMOVE:"Remove Link",CREATE_LINK_COPY:"Copy Link",CREATE_LINK_COPIED:"Link copied",CREATE_LINK_COPIED_CLIP:"Link Copied to clipboard",CREATE_LINK_POPUP_HEADING:"Share a Link",SFS_TAB_HEADING:"Request E-signatures",SFS_MESSAGE_HEADING:"Get signatures fast with Adobe Acrobat Sign",SFS_MESSAGE_TEXT:"Send your document for signing. Recipients get a link to sign online, with no purchase or sign-up required.",SFS_ADD_SIGNERS_BUTTON:"Add Signers",SFS_ICON_SENDFILE:"Add signers and send for signing",SFS_ICON_RECIPIENTS:"Recipients open a link to sign online",SFS_ICON_GETNOTIFIED:"Get notified when file is signed",SFS_LEARNMORE_GOURL:"http://www.adobe.com/go/LearnMoreShareDialogSFS",SFS_MESSAGE_TEXT_MULTIPLEFILE:"Please Note: If you intend to send more than one file for signature, additional files will need to be added on the next screen.",SEND_UPSELL_NOW:"Upgrade Now",SEND_UPSELL_LATER:"Later",SEND_UPSELL_UPGRADE_REQUIRED:"Unsupported Files",COULD_NOT_SEND:"Could not send",ENTERPRISE_USERS_ACCESS_ERROR:"You do not have access to this service. Please contact your IT Administrator to gain access, or try to sign in with an Adobe ID.",CUSTOMIZE_RECIPIENT_PAGE_DIALOG_NOT_AVAILABLE:"Continue at Adobe Document Cloud",CUSTOMIZE_RECIPIENT_PAGE_DIALOG_USE_WEB_MSG:'Edits to your Color and Logo are currently only available online at the Adobe Send web site. Click "<%= buttonName %>" to go there now.',S_T_CUSTOMIZE_RECIPIENT_PAGE_DIALOG_USE_WEB_MSG:'Edits to your logo and color are currently only available at Adobe Document Cloud. Click "<%= buttonName %>" to go there now.',CUSTOMIZE_RECIPIENT_PAGE_DIALOG_USE_WEB_OK:"Continue",CUSTOMIZE_RECIPIENT_PAGE_CLOSE:"Cancel",ENCRYPTION_KEY_DISABLED_MESSAGE:"ENCRYPTION_KEY_DISABLED_MESSAGE",CLOSE_STRING:"Close",SHARE_SEND_TAB_HEADING:"Can View",SHARE_REVIEW_TAB_HEADING:"Can Comment",SHARE_SIGN_TAB_HEADING:"Can Sign",US_CHOICE_SET_DEADLINE:"Set deadline",DUE_BY:"Due by",US_CHOICE_SET_REMINDER:"Set reminder",REMIND_BY:"Remind on",US_CHOICE_ADD_LOGO_COLOR:"Add your Logo & Color",US_CHOICE_ADD_LOGO_COLOR_EDIT:"Edit",PLACE_HOLDER_TEXT_2:"Send personalized invitation with detailed tracking for viewing, commenting and signing.",SHARE_REVIEW_TAB_TOOLTIP:"Get your documents reviewed.",SHARE_SIGN_TAB_TOOLTIP:"Get your documents signed.",TOOL_TIP_COMMON_STRING:"Recipients will receive a link to access file online. No download or install required.",DOC_SENT_HEADING_REVIEW:"Your document has been sent for review.",SHARE_NO_INTERNET_CONNECTION:"No Internet Connection",SHARE_NO_INTERNET_CONNECTION_MSG:"The feature requires Internet Connectivity. Please connect your computer to the internet and try again.",DOC_SENT_SUMMARY_REVIEW:"Recipient will receive a link by email and also be notified in-app. Anyone who uses the link will be able to access the document and add comments.",ERROR_MULTIPLE_FILES_REVIEW1:"You can only send one file at a time for review",ERROR_MULTIPLE_FILES_REVIEW2:"Please remove files and try again.",ERROR_STRING:"Error",ADVANCED_SIGN_OPTIONS:"Advanced Sign",ADVANCED_SIGN_SUBTEXT1:"Use templates, add deadline, reminders and more",ADVANCED_SIGN_SUBTEXT2:"Use templates, add deadline and more",SEND_USING:"SEND USING",ATTACH_DEFAULT_OPTION:"Default Email Application (Mail)",ATTACH_WEB_OPTION:"Use Webmail",REMEMBER_CHOICE:"Remember my choice",ATTACH_PROMOTION_HEADING:"Send And Track your Documents",ATTACH_PROMOTION_TEXT1:"Recipients can preview attachments without downloading.",ATTACH_PROMOTION_TEXT2:"Easily and quickly send large files without emailing limitations.",ATTACH_PROMOTION_TEXT3:"Track Downloads",ATTACH_PROMOTION_LINK:"Send it to People",CAN_COMMENT_TOOLTIP:"Get document reviewed quickly with all the comments in one place. Recipients receive a link to add comments online.",CAN_SIGN_TOOLTIP:"Get document signed in minutes. Recipients receive a link to sign online. No recipient account needed.",ERROR_SINGLE_SIGNER_IS_SENDER:"You cannot send a document only to yourself to sign.",CONNECTOR_FILE_ERROR_TITLE:"Unsupported File Storage",CONNECTOR_FILE_ERROR_MSG:"Sharing is currently not supported for the file storage.",SFS_MULTIPLE_WORKFLOWS_DENIED:"Another file is being sent in a different window. Finish sending the other file then try again.",SHARE_INDIVIDUAL:"Invite People",SHARE_PUBLIC:"Get Link",SHARE_ATTACH:"Send as Attachment",SHARE_VIEW:"View file",SHARE_REVIEW:"Review file",SHARE_VIEW_INFO_TOOLTIP:"Send a link and track when people view and download the file.",SHARE_REVIEW_INFO_TOOLTIP:"Invite people to review the file and track when they add comments, mention others, or finish.",GET_LINK_VIEW_INFO_TOOLTIP:"Send a link for people to view.",GET_LINK_REVIEW_INFO_TOOLTIP:"You can track when people add comments, mention others, or finish.",REVIEW_LEARN_MORE_LINK_GO_URL:"https://www.adobe.com/go/DCReviewhelp",SHARE_ACCORDIAN_SUMMARY:"People will receive a personalized link, but anyone they share it with can view the file.",SHARE_SUBTEXT:"RECIPIENTS CAN:",GET_LINK_ACCORDIAN_SUMMARY:"Anyone with access to the link can:",GET_LINK_SUBTEXT:"GET SHAREABLE LINK TO:",SHARE_REVIEW_TITLE:"You'll be notified when reviewers add comments, mention others, or finish.",SHARE_MESSAGE_PROMPT2:"Please view this document.",SHARE_MESSAGE_PROMPT_REVIEW2:"Please review this document.",MORE_OPTIONS:"More Options...",ADVANCED_BUTTON_TOOLTIP:"Send with advanced options including signer authentication, reminders and more.",SHARE_LOADER_GENERATE_LINK2:"Creating link...",SHARE_LOADER_GENERATE_REVIEW_LINK:"Generating Review Link...",SHARE_LOADER_GENERATE_REVIEW_LINK2:"Creating review link on Document Cloud...",SHARE_LOADER_UPLOAD2:"Uploading to Adobe's cloud storage...",SHARE_LOADER_UPLOAD_REVIEW:"Generating Review...",SHARE_LOADER_UPLOAD_REVIEW2:"Document sharing is in progress...",SHARE_LOADER_UPLOAD_REVIEW3:"Preparing shared file...",SHARE_LOADER_OPEN_REVIEW:"Opening review from Document Cloud...",SHARE_ICON_TITLE:"It's fast and easy to share documents from Acrobat. Send files to others and get feedback.",ADDED_RECIPIENT:"ADDED RECIPIENTS (0)",ADDED_RECIPIENT_NO_COUNT:"ADDED RECIPIENTS",CREATE_LINK:"Create Link",DEFAULT_EMAIL_APP:"Default email application",USE_WEBMAIL:"Webmail",SEND_FILE_ATTACH_EMAIL:"Send file as an email attachment",SHARE_ACCORDIAN_SUMMARY_2:"Each person will receive a unique link. Anyone with access to the link can view the file.",SENDING_REVIEW:"Sending for review...",PREPARING_REVIEW:"Preparing review.",SHARING_FILES:"Sharing File...",SENDING_FILES:"Sending file...",SENDING_FILES_MULTIPLE:"Sending files...",SHARE_LOADER_UPLOAD3:"Uploading to Adobe's cloud storage",SHARE_REVIEW_RESTRICTED:"Review Service Not Supported",SHARE_REVIEW_RESTRICTED_MSG:"Review is not supported for the file selected.",LINK_TO_VIEW_FILE:"Link to view file",LINK_CREATED:"Link created",LINK_TO_REVIEW_FILE:"Link to review file",USER_ADVISORY_MSG:"Your file will be uploaded to Adobe's cloud storage. Each person will receive a unique link. Anyone with access to the link can view the file.",GET_LINK_ADVISORY_MSG:"Your file will be uploaded to Adobe's cloud storage. Anyone with access to the link can:",GET_LINK_ADVISORY_MSG_READER:"Your file will be uploaded to Adobe's cloud storage. Anyone with access to the link can view the file.",ADDRESS_BOOK:"Address Book",SHARE_SIGN:"Fill & sign file",SHARE_SIGN2:"Get Signatures",SHARE_SIGN3:"Request E-signatures",SHARE_SIGN_INFO_TOOLTIP:"Send your document for signing. Recipients get a link to sign online, with no purchase or sign-up required.",SHARE_MESSAGE_PROMPT_SIGN2:"Please Sign this document.",MORE_OPTIONS2:"More Options",SHARE_SIGN_UPLOAD_ERROR_MSG:"We weren’t able to upload some files to Adobe Acrobat Sign.",SHARE_SIGN_ADVISORY_MSG:"Your file will be uploaded for e-signing. Anyone you share the link with can view the file.",SHARE_SIGN_UPG_MSG:"Upgrade",SHARE_SIGN_ERR_TITLE:"Something went wrong",SHARE_SIGN_ERR_MSG2:"Select another file and try again.",SHARE_SIGN_ERR_MSG3:"One or more seleced files are unsupported.",SHARE_SIGN_STR:"Begin Trial",SHARE_SIGN_STR1:"Sign In",EMAIL_CLIENT_OTHER:"unknown",EMAIL_CLIENT_EUDORA:"Eudora",EMAIL_CLIENT_LOTUS_NOTES:"Lotus Notes",EMAIL_CLIENT_NETSCAPE:"Netscape",EMAIL_CLIENT_OUTLOOK:"Microsoft Outlook",EMAIL_CLIENT_OUTLOOK_EXPRESS:"Outlook Express",EMAIL_CLIENT_ENTOURAGE:"Entourage",EMAIL_CLIENT_MAIL:"Mail",UNKNOWN:"unknown",SELECT_OPTION:"Select option...",ADD_GMAIL:"Add Gmail...",ADD_YAHOO:"Add Yahoo!...",ADD_OTHER:"Add other...",WEBMAIL_ADVISORY:"A message will be created in the designated drafts folder of the selected account.",CONTINUE:"Continue",SHARE_HEADING:"SHARE",LEARN_MORE:"Learn More",NEW_BADGE_STRING:"NEW",MULTIPLE_FILES_MESSAGE_1:"You’re sharing ",MULTIPLE_FILES_MESSAGE_2:" files. They’re listed in the share pane.",TRACK_DOCS:"Track Documents",TRACK_FILE:"Track File",TRACK_FILES:"Track Files",SUCCESSFULLY_SENT:"Successfully Sent.",DOCS_SENT_MESSAGE:"Recipient will receive a link by email and laso be notified in-app. Anyone who uses the link will be able to access the documents.",TITLE_STRING:"Title",NAME_STRING:"Name",OPEN_REVIEW_FILE:"Open Review File",INVITE_SENT:"Invitation was sent.",INVITES_SENT:"Invitations were sent.",SHARE_ERROR_SEND_LIMIT_EXCEEDED_TITLE:"Not sent",SHARE_ERROR_SEND_LIMIT_EXCEEDED:"The number of recipients you have selected exceeds your recent limit. Reduce the number of recipients, or wait until later to try again.",SHARE_ERROR_UNSUPPORTED_SHARING_MIME_TYPE:"Audio/video files aren't supported.",SHARE_ERROR_RECIPIENTS_NOT_ALLOWED:"Please upgrade to send to individuals.",SHARE_ERROR_CANNOT_CONVERT_FORM:"Files could not be sent because the form file could not be converted to pdf.",SHARE_ERROR_CANNOT_CONVERT_FORM_RESTRICTION:"Files could not be sent because the form file could not be converted to pdf.",SHARE_ERROR_CANNOT_CONVERT_FORM_TIMEOUT:"Files could not be sent because the form file conversion to PDF timed out.",FILE_CANT_BE_SENT:"File can't be sent",REVIEW_DISABLE_REASON_PORTFOLIO:"PDF portfolios can’t be sent for review.",REVIEW_DISABLE_DYNAMIC_XFA_FILE:"Files with form fields can’t be sent for review.",REVIEW_DISABLE_PROTECTED:"Protected files can’t be sent for review.",REVIEW_DISABLE_REASON_UNSUPPORTED_ANNOTS:"Your file contains annotations that aren't yet supported for review. You can invite others to view this file or send as attachment.",REVIEW_DISABLE_REASON_PDFA:"PDF/A files can’t be sent for review.",REVIEW_DISABLE_REASON_ENCRYPTED:"Encrypted PDF files can’t be sent for review.",REVIEW_DISABLE_REASON_INVALID_FILE:"This file can’t be sent for review.",REVIEW_DISABLE_REASON_LEGACY_SHARED_REVIEW:"This file is part of Legacy Shared Review.",SHARE_TOO_MANY_RECIPIENTS_DLG_TITLE:"Too many recipients",SHARE_TOO_MANY_RECIPIENTS_DLG_MSG:"You can only send files to <%=maxRecipients%> recipients at a time. Please remove recipients and try again.",SHARE_LIMIT_EXCEEDED_DLG_TITLE:"Limit Exceeded",SHARE_LIMIT_EXCEEDED_DLG_MSG:"You’ve already reached the maximum number of recipients per day.",SHARE_FREE_TOO_MANY_RECIPIENTS_MSG:"You can only send to a total of <%=maxRecipients%> recipients per day.",SHARE_COPY_LINK_ERROR_DLG_TITLE:"Unable to copy link",SHARE_COPY_LINK_ERROR_DLG_MSG:"We weren’t able to copy the link. Please try again later.",SHARE_UNKNOWN_ERROR_DLG_TITLE:"Unable to send invitations",SHARE_UNKNOWN_ERROR_DLG_MSG:"We weren’t able to send invitations. Please try again later.",SHARE_ERROR_LOADING_SEND_DLG_TITLE:"Sharing unavailable",SHARE_ERROR_LOADING_SEND_DLG_MSG:"Sharing is temporarily unavailable. We’re sorry for the inconvenience. Please try again later.",SHARE_CL_ERROR_DLG_TITLE:"Unable to create link",SHARE_CL_ERROR_DLG_MSG:"We weren’t able to create the link. Please try again later.",SHARE_ERROR_SEND_DLG_TITLE:"Unable to send file",SHARE_ERROR_UNSUPPORTED_DLG_TITLE:"Non-shareable file",SHARE_ERROR_SEND_DLG_MSG:"We weren’t able to send your file. Please try again later.",SHARE_ERROR_SEND_MUL_DLG_MSG:"We weren’t able to send your files. Please try again later.",SHARE_ERROR_UNSUPPORTED_DLG_MSG:"This file type cannot be shared by your account type. Upgrade to send more file types.",SHARE_ERROR_DATE_DLG_TITLE:"Date and time must be in future",SHARE_ERROR_DATE_DLG_MSG:"The <deadline/reminder> date and time must be in the future. Please try again.",SHARE_TOO_MANY_FILES_DLG_TITLE:"Too many files",SHARE_TOO_MANY_FILES_DLG_MSG:"You can only send <%=maxNumber%> files at a time. Please remove files and try again.",SHARE_NAME_SIZE_ERROR_DLG_TITLE:"Name is too long",SHARE_NAME_SIZE_ERROR_DLG_MSG:"The name can’t be more than <%=maxNumber%> characters.",SHARE_MSG_SIZE_ERROR_DLG_TITLE:"Message is too long",SHARE_MSG_SIZE_ERROR_DLG_MSG:"The message can’t be more than <%=maxNumber%> characters.",SHARE_REMINDER_ERROR_DLG_TITLE:"Reminder date isn’t valid",SHARE_REMINDER_ERROR_DLG_MSG:"The reminder date must be before the deadline date.",SHARE_DEADLINE_ERROR_DLG_TITLE:"Deadline date isn’t valid",SHARE_DEADLINE_ERROR_DLG_MSG:"The deadline date must be in the future.",SHARE_REMINDER_ERROR_1_DLG_MSG:"The reminder date must be in the future.",SHARE_REMINDER_TIME_DLG_TITLE:"Reminder time isn't valid",SHARE_DEADLINE_TIME_DLG_TITLE:"Deadline time isn’t valid",SHARE_REMINDER_TIME_DLG_MSG:"The reminder time must be later than the current time.",SHARE_DEADLINE_TIME_DLG_MSG:"The deadline time must be later than the current time.",SHARE_REM_AFTER_DEAD_DLG_TITLE:"Reminder is after deadline",SHARE_REM_AFTER_DEAD_DLG_MSG:"The reminder time is after the deadline.",SHARE_ERROR_ENTERPRISE_SEND_DLG_MSG:"Your file can't be sent because your organization has sharing restrictions in place.",SHARE_ERROR_ENTERPRISE_OPEN_DLG_TITLE:"Can’t access file",SHARE_ERROR_ENTERPRISE_OPEN_DLG_MSG:"You don’t have access to this file due to sharing restrictions.",SHARE_ERROR_ENTERPRISE_OPEN_DLG_MSG2:"You don’t have access to this file because it’s restricted.",CLOSE_SHARE_PANE:"Close Share Pane",INVITE_PEOPLE_TOOLTIP:"Invite People to share",CHOOSE_OPTIONS_RECIPIENTS:"Choose options for recipients",SEND_BUTTON_TOOLTIP:"Send invitations",SEND_ATTACHMENT_BUTTON_TOOLTIP:"Continue sending as attachment",SEND_MAIL_DESC_HEADER:"Share with Acrobat to collaborate better:",SEND_MAIL_DESC_HEADER_READER:"Share with Acrobat Reader to collaborate better:",SEND_MAIL_ATTACH_USING:"Attach using",SEND_LINK_AS_ATTACHMENT:"Send a link instead of an attachment",INCLUDE_LINK:"Send as a link",INCLUDE_LINK_INFO:"Upload your document to Document Cloud and insert a link into the message of your email.",INCLUDE_LINK_CANNOT_SEND_REVIEW_INFO:"The file will be uploaded to Adobe cloud storage. Anyone with the link can view it. Comments aren't allowed on this file.",INCLUDE_LINK_VIEW_INFO:"The file will be uploaded to Adobe cloud storage. Anyone with the link can view it.",INCLUDE_LINK_REVIEW_INFO:"The file will be uploaded to Adobe cloud storage. Anyone with the link can comment on it.",INCLUDE_LINK_INFO_DC:"Insert a link into the message of your email.",SEND_LARGE_FILE_AS_ATTACHMENT:"Collect feedback in one place and track responses",SEND_MAIL_REVIEWERS_CMNT:"Reviewers can see and reply to each other's comments",SEND_MAIL_TRY_NOW:"Try it Now",INVITE_PEOPLE_ACCORDIAN_LABEL:"Invite people to view or review a file by sending a link.",LEARN_MORE_LABEL:"Learn More",ADDRESS_BOOK_LABEL:"Add names or emails from your contact list",SHARE_AV_UPSELL_TITLE:"Subscription required",SHARE_AV_UPSELL_MSG:"Upgrade to send audio and video files. You can also send other files for review, set reminders, and more.",SHARE_UPSELL_MSG:"You have reached your limit of free file sends. Upgrade to send more files, including sending files for review.",SHARE_UNVERIFIED_ID_MSG:"Please verify your email address to enable sharing files from Acrobat.",REVIEW_GENERATED_MSG:"Review Generated.",REVIEW_DISABLE_INVALID_COMMENT_LENGTH:"Review initiation failed as there are comments in the PDF that exceed the limit of 1000 characters. Delete the comment or reduce the characters and retry.",REVIEW_DISABLE_COMMENT_COUNT_EXCEEDED:"Review initiation failed as there are more than 1000 comments in the PDF.",REVIEW_DISABLE_COMMENT_EXTRACTION_ERROR:"Review initiation failed as size of the comments in the PDF exceeds the limit. Please delete some comments or reduce the characters and retry.",REVIEW_DISABLE_UNKNOWN_ERROR:"We encountered an unexpected error while processing your request. Please try again after sometime.",USM_SHARE_DIALOG_HEADING:"How do you want to share your file?",USM_GET_LINK_TAB_TEXT:"Get a Link",USM_INVITE_PEOPLE_TAB_TEXT:"Invite People",USM_ATTACH_EMAIL_TAB_TEXT:"Attach to Email",USM_GET_LINK_HEADING:"Get a link to your file",USM_GET_LINK_INFO:"Share a link to your file, which will be uploaded to Document Cloud. Anyone with the link can view the file. You can also let people add comments.",USM_ALLOW_COMMENTS:"Allow comments",USM_GET_LINK_BUTTON:"Create Link",USM_CREATING_LINK:"Creating Link...",USM_LINK_COPIED:"Link copied to clipboard",USM_COPY_LINK:"Copy Link",USM_INVITE_PEOPLE_HEADIN:"Invite people by email",USM_INVITE_PEOPLE_INFO:"Invite others to view or review your file, which is uploaded to Document Cloud. Reviewers can add comments in one place online. Anyone with the link can access the file.",USM_EMAIL_BOX_PLACEHOLDER:"Enter email addresses...",USM_NAME_EMAIL_BOX_PLACEHOLDER:"Enter name or email",USM_IP_MESSAGE_BOX_PLACEHOLDER:"Enter a personal message (optional)",USM_ADD_DEADLINE:"Add Deadline",USM_ADD_REMINDER:"Add Reminder",USM_SHARING:"Sharing",USM_N_FILES:"Files",USM_SELECTED_FILES:"Selected Files",USM_UPDATE:"Update",USM_SENDING:"Sending...",USM_SUCCESSFULLY_SENT:"Your file was sent",USM_SUCCESSFULLY_SENT_MULTIPLE:"Your files were sent",USM_SUCCESS_VIEW_MESSAGE:"You will receive an email notification when the recipient accesses the file.",USM_SEND_FOR_REVIEW:"Send for Comments",USM_REVIEW_UPSELL_1:"Invite people to add comments to your file",USM_REVIEW_UPSELL_2:"See all comments in one file",USM_REVIEW_UPSELL_3:"Stay informed of file activity",USM_REVIEW_UPSELL_4:"No sign-up or purchase required for reviewers",USM_CREATE_LINK_UPSELL:"When you allow comments, recipients can add comments with no sign up or purchase required and you'll be notified when they do.",USM_UPGRADE:"Upgrade",USM_REMINDER:"Reminder",USM_REMINDER_BEFORE_DEADLINE:"The reminder date must be before the due date",USM_ONE_FILE_ERROR_REVIEW:"You can send only 1 file for comments at a time. Please remove files and try again",USM_CREATE_LINK_GENERAL_ERROR:"Error creating link. Please try again",INVITE_LEARN_MORE_GO_URL:"http://www.adobe.com/go/LearnMoreShareDialogInvite",GET_LINK_LEARN_MORE_GO_URL:"http://www.adobe.com/go/LearnMoreShareDialogGetLink",US_TAB_SWITCH_MULTI_FILE_ERROR:"You can only send one file at a time using <%=TAB_NAME %>. Please remove files and try again.",SHARE_RECIPIENTS_LIMIT_PER_DAY_REACHED:"You have reached the maximum number of recipients per day. Try <%=GET_LINK_HTML%> to generate more document links to Share.",USM_INVITE_PEOPLE_INFO_2:"Send a link to let people view and track file activity or add comments online. They won't need to sign in or have Acrobat. Anyone with the link can access the file.",SHARE_MESSAGE_PROMPT_REVIEW_3:"Please comment on this document.",SHARE_MESSAGE_PROMPT_REVIEW_4:"Please view this document. You can also comment on it.",SHARE_MESSAGE_PROMPT_REVIEW_5:"Add a message (optional)",REVIEW_DISABLE_REASON_INVALID_FILE_2:"This file doesn't support comments.",USM_SHARED:"shared",US_SHARE_SFS_CTA:"Get Started",US_SFS_TRIAL_TITLE:"Get documents signed for free",US_SFS_TRIAL_BODY:"Send up to <%=count%> documents for signature for free every 30 days*.",US_SFS_TRIAL_BODY1:"Send up to ",US_SFS_TRIAL_BODY2:" documents for signature for free every 30 days*.",US_SFS_TRIAL_CONDITION:"*Issued on a rolling basis.",EMAIL_OPENED:"Email opened in new window",REDUCE_UPSELL_MESSAGE:"This is a <%=SIZE%>MB file. Reduce file size before sending it to others.",REDUCE_UPSELL_LINK_TEXT:"Reduce File Size Now",US_EMAIL_OPENED_MESSAGE:'Your email has been opened in "<%=EMAIL_CLIENT_NAME%>". You can change your email client settings in : ',PREFERENCES:"Preferences",ATTACH_TO_EMAIL:"Attach to Email",SEND_BY_EMAIL:"Send by Email",POPUP_SHARE_INFO_TOOLTIP:"Upload your file to Document Cloud to send people a link to view or add comments online. As anyone with the link can access the file, do not share any files containing sensitive information.",POPUP_CREATE_LINK_INFO_TOOLTIP:"Upload your file to the cloud to send people a link to view or add comments online. They won't need to sign in or have Acrobat.",POP_SHARE_CREATE_LINK_INFO_TOOLTIP_LOCAL:"File will be uploaded to Adobe's cloud storage. ",POP_SHARE_CREATE_LINK_INFO_TOOLTIP_DC:"Anyone with the link can access the file. ",POP_SHARE_CREATE_LINK_INFO_TOOLTIP_COPY:"File is uploaded to Adobe's cloud storage. Anyone with the link can access the file. ",POP_SHARE_CREATE_LINK_LEARN_MORE:"Learn more",POP_SHARE_CREATE_LINK_LEARN_MORE_LINK:"https://helpx.adobe.com/document-cloud/help/sharing-pdfs.html",GET_MS_GRAPH_CONTACTS_MSG:"Sign in with your Office account to access Outlook contacts.",GET_MS_GRAPH_CONTACTS_MSG_1:"Sign in with your ",GET_MS_GRAPH_CONTACTS_MSG_2:" account to access ",GET_MS_GRAPH_CONTACTS_MSG_3:" contacts.",GET_MS_GRAPH_CONTACTS_MSG:"Sign in with your Office account to access Outlook contacts.",FILE_CANT_BE_SENT_REVIEW:"This file can't be sent to others for commenting",REVIEW_DISABLE_REASON_PORTFOLIO_MODAL:"PDF portfolios can’t be sent for comments.",REVIEW_DISABLE_PROTECTED_MODAL:"Protected files can’t be sent for comments.",REVIEW_DISABLE_REASON_UNSUPPORTED_ANNOTS_MODAL:"Remove any attachments in the Comments panel to share the file or turn off commenting to share with the attachments.",REVIEW_DISABLE_REASON_PDFA_MODAL:"PDF/A files can’t be sent for comments.",REVIEW_DISABLE_REASON_ENCRYPTED_MODAL:"Encrypted PDF files can’t be sent for comments.",REVIEW_DISABLE_REASON_INVALID_FILE_MODAL:"This file can’t be sent for comments.",REVIEW_DISABLE_REASON_LEGACY_SHARED_REVIEW_MODAL:"This file is already part of a private network-based shared review and can’t be sent for comments using Adobe Document Cloud. Use the Acrobat Tracker to add reviewers.",REVIEW_DISABLE_INVALID_COMMENT_LENGTH_MODAL:"This file can’t be sent for comments due to comments in the PDF that exceed the character limit. Please delete or shorten these comments and retry.",REVIEW_DISABLE_COMMENT_COUNT_EXCEEDED_MODAL:"This file can’t be sent for comments because there are more than 1000 comments in the PDF. Please reduce the number of comments and retry.",ERROR_MULTIPLE_FILES_REVIEW1_MODAL:"You can send only one file for comments at a time",SHARE_AGAIN_BUTTON_TEXT:"Share Again",SEND_AGAIN:"Send Again",LINK_TO_DOCUMENT:"Link to document:",ATTACH_LINK_SUBJECT_MSG:'"<%= FILENAME %>" was shared with you',ATTACH_LINK_VIEW_FILE_MSG:'<%= DISPLAYNAME %> shared "<%= FILENAME %>" with you: ',ATTACH_LINK_REVIEW_FILE_MSG:'<%= DISPLAYNAME %> shared "<%= FILENAME %>" with you. Add your comments and collaborate with others in real time. ',ATTACH_LINK_INFO_MSG:"Sent with Adobe cloud storage. You don’t need to download Acrobat or sign up to access the file.",SEND_MAIL_PUBLIC_LINK_ERROR:"There was an error creating the link. Click Next to continue as an email attachment this time.",COULD_NOT_COMPLETE_REQUEST:"Could not complete your request",COULD_NOT_COMPLETE_REQUEST_MSG:"Could not complete your request. An error occurred while connecting to the service. Please try again later.",GENERATING_LINK_MSG:"Generating link and loading file",START_COMMENTING:"Start Commenting",USM_CREATE_LINK_LABEL:"Create a Link",USM_SHARE_LINK_LABEL:"Share a Link",SHARE_WITH_OTHERS:"Share with Others",US_SIGN_PROMOTION_TITLE:"Do you need this file signed?",US_SIGN_PROMOTION_LI_1:"Send this file to others for fast e-signing.",US_SIGN_PROMOTION_LI_2:"Recipients sign online for free with no sign-up needed.",US_SIGN_PROMOTION_LI_3:"Get notifications and track responses in real time.",SIGN_IN_REQUIRED:"Sign in required.",SEND_BY_EMAIL_NV:"Send by email",SEND_BY_EMAIL_NV_DEFAULT_EMAIL_APP:"Default email",SEND_BY_EMAIL_NV_WEBMAIL:"Webmail",SEND_BY_EMAIL_NV_ATTACH_LINK_INFO:"Upload your file to Adobe's cloud storage and insert a link in email.",GET_SIGNATURES_NV:"Get e-signatures faster than email",NEXT_BUTTON_NV:"Next",REQUEST_SIGNATURES_INFO_NV:"Send a document to others for easy, trusted signing online.",AV2_REQUEST_SIGNATURES_INFO_NV:"Recipients receive an email link to sign online for free without printing or downloading Acrobat.",ADD_SIGNERS_HEADING:"Add signers to sign this document",ADD_SIGNERS_PLACEHOLDER:"Add name or email",ADD_SIGNERS_MESSAGE_PLACEHOLDER:"Please review and sign this document.",ADD_SIGNERS_MORE_OPTIONS:"More options",SPECIFY_WHERE_TO_SIGN_CTA:"Specify where to sign",ADD_SIGNERS_BACK_CTA:"Back",ADD_SIGNERS_SIGNER_ROLE:"Signer",ADD_SIGNERS_APPROVER_ROLE:"Approver",ADD_SIGNERS_SUBJECT_PLACEHOLDER:"Agreement Name",ADD_SIGNERS_NO_EMAIL_ERROR:"Please add at least one recipient.",ADD_SIGNERS_ERR_OFFLINE:"To continue, please connect to the internet and try again.",ADD_SIGNERS_UPLOAD_TEXT:"Uploading as an agreement",GET_SIGNATURES_NV_V2:"Get this file signed fast",REQUEST_SIGNATURES_INFO_NV_V2:"Send a document to others for easy, trusted signing online.",AV2_REQUEST_SIGNATURES_INFO_NV_V2:"Recipients add trusted e-signatures online for free with Acrobat."}),define("pdmplugins/unified-share/js/models/ui/notification-ui-model",["core/ac-core","pdmplugins/unified-share/js/ac-unified-share","core/models/ui/ui-model"],function(e,i){i.NotificationUiModel=e.UiModel.extend({recognized:{progress:{type:"number",optional:!1},combinedSize:{type:"number",optional:!1},asset_id:{type:"string",optional:!1},notification:{type:"object",optional:!1},uploadedSize:{type:"number",optional:!1},arrayOfFileSizes:{type:"array",optional:!1},totalFiles:{type:"number",optional:!1}},defaults:{asset_id:"",progress:0,combinedSize:0,uploadedSize:0,arrayOfFileSizes:[],totalFiles:0},updateUploadedValue:function(e,i){var t=this._getUpdatedUploadArray(e,i);
this.set({arrayOfFileSizes:t}),this._calculateUploadedSize()},_getUpdatedUploadArray:function(e,i){var t=[],s=0;for(s=0;s<this.get("totalFiles");s++)t[s]=s===i?parseInt(e,10):parseInt(this.get("arrayOfFileSizes")[s],10);return t},_calculateUploadedSize:function(){var e=0,i=0;for(e=0;e<this.get("totalFiles");e++)isNaN(this.get("arrayOfFileSizes")[e])||(i=parseInt(i,10)+parseInt(this.get("arrayOfFileSizes")[e],10));this.set({uploadedSize:parseInt(i,10)})}})}),define("pdmplugins/unified-share/js/ops/begin-desktop-upload-op",["core/ac-core","pdmplugins/unified-share/js/ac-unified-share","i18n!pdmplugins/unified-share/js/nls/ui-strings","pdmplugins/unified-share/js/models/ui/notification-ui-model"],function(e,i,t){var s=0;i.BeginDesktopUploadOp=e.Op.extend({run:function(){if(this.options.localFiles.length>0){var e,s,n,o,a,l=0,r=[],d=0,p=0,h=$.Deferred(),c={localFiles:this.options.localFiles};for(o=0,a=c.localFiles.length;a>o;o+=1)l+=c.localFiles[o].get("size"),p++;for(e=new i.NotificationUiModel({progress:0,asset_id:"",notification:{},combinedSize:l,totalFiles:p}),this.options=_.extend(this.options,{notificationUiModel:e}),n=p>1?p+" "+t.FILES:c.localFiles[0].name||c.localFiles[0].get("name"),this.options.notificationUiModel.on("change:progress",_.bind(function(){var e=this.options.notificationUiModel,i=e.get("notification");i&&i.invoke&&i.invoke("setProperty",{progress:this.options.notificationUiModel.get("progress")})},this)),o=0,a=c.localFiles.length;a>o;o+=1){this.options.file=c.localFiles[o],d=o,this.options=_.extend(this.options,{fileNo:d}),s=i.opFactory.create("DesktopDoUploadOp",this.options);var u=s.run();u.then(_.bind(function(e){this._setAssetIdValue(e,this.options)},this)),r.push(u)}return $.when.apply($,r).then(_.bind(function(){this.options.appApi.rnaApi.done(_.bind(function(e){e.stApi.setSendTrackWorkflowInProgress(!1)},this)),h.resolve()},this),_.bind(function(){this.options.appApi.rnaApi.done(_.bind(function(e){e.stApi.setSendTrackWorkflowInProgress(!1)},this)),h.reject()},this)),this._clearAssetIdValue(),h}return this._getResolvedPromise()},_setAssetIdValue:function(e,i){if(i.assetIdarray[s]=e.sc_id,void 0===e.sc_id){var t=e.uri.split("/");t.length&&(i.assetIdarray[s]=t[t.length-1])}s++},_clearAssetIdValue:function(){s=0},_setUpNotificationProcess:function(e){this.userData={customMessage:e,notificationHeading:t.UPLOADING_TO_SEND},this.options.appApi.rnaApi.done(_.bind(function(e){e.stApi.setSendTrackWorkflowInProgress(!0)},this))}})}),define("pdmplugins/unified-share/js/ops/desktop-do-upload-op",["core/ac-core","core/utils/file-types","pdmplugins/unified-share/js/ac-unified-share"],function(e,i,t){t.DesktopDoUploadOp=e.Op.extend({run:function(){function i(e,i,t){this.notificationUiModel.updateUploadedValue(e,t);var s=this.notificationUiModel.get("combinedSize"),n=this.notificationUiModel.get("uploadedSize");this.notificationUiModel.set({progress:parseInt(n/s*100,10)})}var t={localFile:this.options.file};this._fileNo=this.options.fileNo;var s="",n="unmanaged";if(_.isUndefined(this.options.persistence)||"permanent"!=this.options.persistence)if(this.options.sendFilesUiModel.get("isOriginalShareEnabled"))n="managed";else{var o=this.options.sendFilesUiModel.get("limits_model");!_.isUndefined(o)&&o.get("original_sharing_enabled")&&(n="managed")}else n="managed",s=this.options.parentId;var a=t.localFile,l="auto_rename",r=this._fileNo,d=_.extend(this.options,{rnaFile:a._proxy,uploadType:n,onDuplicateName:l,ignoreContentType:!0,fileNo:r,parentID:s,progressCB:_.bind(i,this.options),showBezel:!1,doNotUpdateRFL:!0}),p=e.opFactory.create("UploadingFileOp",d);return p.run()}})}),define("pdmplugins/unified-share/js/ops/finding-upload-folder-op",["core/ac-core","pdmplugins/unified-share/js/ac-unified-share","core/utils/http-util","core/ops/op"],function(e,i,t){i.FindingUploadFolderOp=e.Op.extend({run:function(){{var i,s,n,o;this.options}return i=e.baseFilesUrisModel.getSendApiUri()+"find_upload_folder",s="POST",n=t.getRequestHeaders(s),n["Content-Type"]="application/json",o=$.ajax(i,{modal:!1,type:s,headers:n,success:this._successHandler,failure:this._errorHandler})},_successHandler:function(e){this.id=e.id||$.parseJSON(e).id,this.persistence=e.persistence||$.parseJSON(e).persistence},_errorHandler:function(e,t,s){LOG.error("/find_upload_folder failed, called from FindingUploadFolderOp, textStatus="+t+", errorThrown="+s,{logServer:!0,plugin:i.PLUGIN_ID})}})}),define("pdmplugins/unified-share/js/ops/desktop-fetching-autocomplete-list-op",["core/ac-core","pdmplugins/unified-share/js/ac-unified-share","pdmplugins/unified-share/js/utils/ts-utils","core/ops/op"],function(e,i,t){i.DesktopFetchingAutocompleteListOp=e.Op.extend({run:function(){var e,i=this.options.sendFilesUiModel.get("enable_autocomplete");return i?this.options.appApi.sessionApi.ensureSignedIn().then(_.bind(function(){return e=this.options.appApi.baseFilesUrisApi.getSendApiUri(),e=t.extractRootUrl(e),this.options.rootUrl=e,this.options.autoCCollection.setRUrl(this.options.rootUrl),this._getResolvedPromise()},this)):void 0}})}),define("pdmplugins/unified-share/js/utils/sc-constants",["plugins-common/ac-plugins"],function(e){e.AcUnifiedShare||(e.AcUnifiedShare={});var i=e.AcUnifiedShare;return i.ScConstants={ACTION:"Action",ACTIONS:"Actions",ADD_FILES_TO_SHARE:"AddFilesToShare",ADDRESS_BOOK:"AddressBook",ATTEMPTED_TO_SHARE_FORM:"AttemptedToShareForm",AUTOCOMPLETE:"Autocomplete",AVOIDED:"Avoided",BROWSER_CLOSE:"BrowserClosed",BRANDING:"Branding",CANCEL:"Cancel",CHECKED:"Checked",CHICKLET_ADDED:"ChickletAdded",CLICKED:"Clicked",CLICK_BRANDING:"ClickBranding",CLICK_BRANDING_IN_READER:"ClickBrandingInReader",CLICK_BRANDING_IN_ACROBAT:"ClickBrandingInAcrobat",CLOSE:"Close",COLOR_INPUT:"ColorInput",COLOR_MENU_BUTTON:"ColorMenuButton",COLOR_WELL:"ColorWell",CONTINUE:"Continue",DATE_VIEWED:"DateViewed",DEFAULT:"Default",DIALOG:"Dialog",DISABLED:"Disabled",DISALLOWED:"Disallowed",DISCOVER:"Discover",DOWNLOAD:"Download",DOWNLOAD_ALL:"DownloadAll",DOWNLOAD_ONE:"DownloadOne",DRAG_FILES:"DragFiles",DURATION:"Duration",EDIT_BRANDING_ONLINE:"ContinueOnline",EMAIL:"Email",EMAIL_LINK:"EmailLink",ENABLED:"Enabled",ENTERED:"Entered",EUREKA_SHARE:"Eureka:Share",EVENTUAL_CLICK:"EventualClick",FILE:"File",FILE_LIST:"FileList",FILE_NAME:"FileName",FILES_SHARED_DLG:"FilesSharedDlg",FORWARD:"Forward",FULL_ACTIVITY:"FullActivity",HIDDEN:"Hidden",IMMEDIATE_CLICK:"ImmediateClick",INCLUDE_MESSAGE_TEXT:"IncludeMessageText",INCLUDE_REPLY_TO:"IncludeReplyTo",IPM:"IPM",LATER:"Later",LOGO_BUTTON:"LogoButton",LOGO_CANCEL:"LogoCancel",LOGO_SAVE:"LogoSave",MESSAGE:"Message",MULTI:"Multi",NO_PARCELS:"NoParcels",NOTIFY_WHEN_VIEWED:"NotifyWhenViewed",NUM_FILES_CHECKED:"NumFilesChecked",PERSONAL:"Personal",PERSONAL_AND_PUBLIC:"PersonalANDPublic",PREVIEW:"Preview",PUBLIC:"Public",PUBLIC_LINK:"PublicLink",RECVIEW:"RecView",REPLY:"Reply",REMOVE:"Remove",REPORT_ABUSE:"ReportAbuse",REVIEW_NOT_PERMITTED:"ReviewNotPermitted",RHP:"RHP",SCROLL:"Scroll",SAVE_AS:"SaveAs",SELECT_ALL:"SelectAll",SELECT_FILES:"SelectFiles",SEND_FOR_REVIEW:"Send for Review",SENT_FILES:"SentFiles",SHARE:"Share",SHARE_MODAL:"ShareModal",SHARE_BUTTON:"ShareButton",SHARE_FILE_BUTTON:"ShareFileButton",SHARE_ICON:"ShareIcon",SHARE_WITH:"ShareWith",SHARED:"Shared",SHOWN:"Shown",SINGLE:"Single",SORT:"Sort",SUBJECT:"Subject",SUCCESS:"Success",SURVEY:"Survey",SURVEY_CANCEL:"SurveyCancel",SURVEY_FIELD_FOCUS:"SurveyFieldFocus",SURVEY_LINK:"SurveyLink",SURVEY_SEND:"SurveySend",TOOLS:"Tools",TRACK:"Track",TRASH:"Trash",TURN_OFF_BRANDING:"TurnOffBranding",TURN_ON_BRANDING:"TurnOnBranding",UNCHECKED:"Unchecked",UNSHARE:"Unshare",UPGRADE:"Upgrade",URL_HIGHLIGHT:"UrlHighlight",URL_KEY_COPY:"UrlKeyCopy",USE:"Use",VIEW:"View",VIEW_ALL_SHARED_FILES:"ViewAllSharedFiles",VIEW_FULL_ACTIVITY:"ViewFullActivity",WARNED_BEFORE_CLOSING:"WarnB4Close",WARNING:"Warning",WITH_REPLY:"wReply",NO_CONNECTIVITY:"NoConnectivity",ERROR_UPLOAD:"ErrorUpload",UNKNOWN_SERVICE_ERROR:"UnknownServiceError",API_SUBPATH_NEW:"/api/rest/v6",API_SUBPATH_OLD:"/api/rest/v3",API_VERSION_V6:"v6",1:"1","2_TO_5":"2to5","6_TO_10":"6to10","11_OR_MORE":"11orMore","11_TO_20":"11to20","21_TO_40":"21to40","41_TO_120":"41to120","121_OR_MORE":"121orMore",FSS:"FSS",FORM:"Form",OUTPUT:"Output",SAVE_TO_PDF:"SaveToPDF","1_STARTED":"1-Started","2_COMPLETED":"2-Completed",ERROR:"Error",SEND_TAB:"SendTab",COMPLETED:"Completed",SUPPORTED_EXTNS_SIGN:["pdf","doc","docx","rtf","xls","xlsx","ppt","pptx","txt","html","htm","tiff","tif","bmp","gif","jpg","jpeg","png"],SUPPORTED_EXTNS_REVIEW:["pdf"],BASICMAIL:0,GMAIL:1,CONFIGURED:2,FILE_LIST_ERROR:"file_list_error",CREATE_LINK_ERROR:"create_link_error",INVITE_PEOPLE_ERROR:"invite_people_error",UNSUPPORTED_FILE_ERROR:"unsupported_file_error",DEADLINE_ERROR:"deadline_error",REMINDER_ERROR:"reminder_error",UNSUPPORTED_FILES:"NonPDFOrMultipleFiles",GET_SIG:"USGetSig",GET_STARTED_CLICKED:"GetStartedClicked",SIGNED_IN:"SignedIn",MORE_OPTIONS:"MoreOptions",SIGN_TOOL_SHOWN:"Adobesigntoolshown",SIGN_TOOL_NOT_SHOWN:"Adobesigntoolnotshown",SHARE_POPUP:"SharePopup",TRACK_BUTTON:"TrackButton",SHARE_AGAIN_BUTTON:"ShareAgainButton",INFO_TOOLTIP:"InfoTooltip",SHARE_UPSELL_DIALOG:"ShareUpsellDialog",CREATE_LINK_UPSELL_DIALOG:"CreateLinkUpsellDialog",OPEN:"Open",LEARN_MORE:"LearnMore",GET_STARTED:"GetStarted",ALLOW_COMMENTS:"AllowComments",ALLOW_COMMENTS_TOGGLED:"AllowCommentsToggledTo",ALLOW_COMMENTS_DEFAULT:"AllowCommentsDefaultMode",CREATE_LINK_MODE:"CreateLinkMode",INVITE_MODE:"InviteMode",SEND_MAIL_MODE:"SendMailMode",INSTANT_LINK:"InstantLink",INSTANT_LINK_DEFAULT:"InstantLinkDefault",INSTANT_LINK_TOGGLED:"InstantLinkToggledTo",ERROR_BUBBLE_SHOWN:"ErrorBubbleShown",OPEN_REVIEW:"OpenReview",START_COMMENTING:"StartCommenting",SEND_MAIL_LINK:"SendMailWithLink",SEND_MAIL_FILE:"SendMailWithFile",BUTTON_NEXT:"ButtonNext",DEFAULT_EMAIL_APPLICATION:"DefaultEmailApplication",WEBMAIL_APPLICATION:"WebmailApplication",COPY_LINK:"CopyLink",MS_OUTLOOK:"MSOutlook"},i.ScConstants}),define("pdmplugins/unified-share/js/ops/close-app-op",["core/ac-core","pdmplugins/unified-share/js/ac-unified-share","pdmplugins/unified-share/js/utils/sc-constants"],function(e,i,t){i.CloseAppOp=e.Op.extend({run:function(){var e=this.options.sendFilesUiModel.get("ShareVariant"),i=t.USE,s="Close Share Panel";this.options.appApi.siteCatalystApi.logScEvent([e,i,s]),"true"===this.options.sendFilesUiModel.get("isModalView")?this.options.appApi.rnaApi.then(_.bind(function(e){e.stApi.closeModalShareView()},this),_.bind(function(){return $.Deferred().reject().promise()},this)):this.options.appApi.rnaApi.done(_.bind(function(e){e.invokeMethod({methodName:"executeAppUICommand",methodArgs:""})},this))}})}),define("pdmplugins/unified-share/js/utils/us-error-codes",{PDFIsPortfolio:0,PDFIsPasswordProtected:1,PDFIsCertificateProtected:2,PDFIsPolicyProtected:3,PDFIsDynamicXFA:4,PDFIsOfInvalidType:5,InvalidFileExtn:6,GeneralWorkflowError:7,LargeFileSize:8,SendPageSessionTimeOut:9,EnterpriseServiceAccessDenied:10,PrepareFormsMultipleFilesSelect:11,ESAutoLoginDenied:12,MultipleWorkflowsRunning:13,CombineFilesFailed:14}),define("pdmplugins/unified-share/js/ops/can-sign-file-validator",["core/ac-core","pdmplugins/unified-share/js/ac-unified-share","pdmplugins/unified-share/js/utils/us-error-codes","pdmplugins/unified-share/js/utils/sc-constants"],function(e,i,t,s){var n=["",t.PDFIsPortfolio,t.PDFIsPasswordProtected,t.PDFIsCertificateProtected,t.PDFIsPolicyProtected,t.PDFIsDynamicXFA,t.PDFIsOfInvalidType];return i.SignFilesValidatorOp=e.Op.extend({run:function(){var e,i,o,a,l=this.options,r=$.Deferred(),d=l.inputFiles,p=[],h=[],c=[];return _.each(d,_.bind(function(i){return _.isEmpty(i)?void h.push(i):!_.isEmpty(i.get("assetId"))||(e=i.get("ext"),!_.isEmpty(e)&&_.some(s.SUPPORTED_EXTNS_SIGN,function(i){return i.toLowerCase()===e.toLowerCase()})||i.get("isTemp")&&i.get("name").toLowerCase().endsWith(".pdf"))?_.isEmpty(i.get("assetId"))||(e=i.get("ext"),_.isEmpty(e)||_.some(s.SUPPORTED_EXTNS_SIGN,function(i){return i.toLowerCase()===e.toLowerCase()}))?void p.push(i):void h.push({file:i,errorCode:t.InvalidFileExtn}):void h.push({file:i,errorCode:SFSErrorCodes.InvalidFileExtn})},this)),_.isEmpty(p)?(r.resolve(p,h),r):(a=_.map(p,function(e){return e._proxy}),i={methodName:"canSendForSign",methodArgs:a},l.appApi.rnaApi.done(_.bind(function(e){e.servicesApi(i).then(_.bind(function(e){_.each(p,_.bind(function(i,t){e[t].errorSet?(o=e[t].errorCode,h.push({file:i,errorCode:n[o]})):c.push(i)},this)),r.resolve(c,h)},this),function(){r.reject()})},this)),r)}}),i.SignFilesValidatorOp}),define("pdmplugins/unified-share/js/ops/upload-and-run-sfs-op",["core/ac-core","pdmplugins/unified-share/js/ac-unified-share","pdmplugins/esign/js/ac-esign","pdmplugins/unified-share/js/utils/sc-constants","core/utils/file-types","pdmplugins/unified-share/js/ops/can-sign-file-validator"],function(e,i,t,s,n){var o=t.UploadDocumentToEchoSignOp.prototype.UPLOAD_STATES;i.UploadAndRunSFSOp=e.Op.extend({run:function(){var e=_.extend({},this.options);return this.promise=$.Deferred(),this.options.canSignUiModel.set("can_sign_state","init"),this.options.canSignUiModel.set("can_sign_state","authorising"),this._createESAuthSession(e),this.promise},_createESAuthSession:function(e){var i=t.esApi.authApi,s=i.createAuthSession(e);s.then(_.bind(function(){this.options.canSignUiModel.set("can_sign_state","authorised"),this._createUploadRequestsQueue(e)},this),_.bind(function(){this.promise.reject("AuthorisationFailed"),this.options.canSignUiModel.set("can_sign_state","failed")},this))},_createUploadRequestsQueue:function(e){var t,s,n,o,a,l=this.options.canSignUiModel;s=this.options.sendFilesUiModel.get("local_file_objects"),n=[],o=this.options.sendFilesUiModel.get("metadata_collection");for(var r=0;r<o.length;r++)a=o.models[r],n.push(a.get("fileAttr"));t=_.union(s,n),i.opFactory.create("SignFilesValidatorOp",_.extend({inputFiles:t},this.options)).run().then(_.bind(function(i,s){s.length>0&&(this.promise.reject("fileValidationFailed"),l.set("can_sign_state","failed")),t=_.map(i,_.bind(function(e,i){return{file:e,fileIdx:i,responseObj:{},progressObj:{},bytesUploaded:0,bytesTotal:0,uploadStatus:""}},this)),s.length<=0&&(this.options.canSignUiModel.set("upload_req_queue",t),this._startUploadRequestForAllFiles(e))},this),_.bind(function(){this.promise.reject("fileValidationFailed"),l.set("can_sign_state","failed")},this))},_startUploadRequestForAllFiles:function(e){var i=this.options.canSignUiModel,t=i.get("upload_req_queue");this.options.canSignUiModel.set("can_sign_state","uploading"),_.each(t,_.bind(function(i){e.currentFileUploadReq=i,this._uploadFileToEchoSign(e)},this))},_cancelUpload:function(){t.opFactory.create("CancelUploadToEchoSignOp",this.options).run()},_resetSendMailPopupView:function(){this.options.appApi.rnaApiObj.esApi.invokeMethod({methodName:"ResetSendMailPopupView"})},_uploadFileToEchoSign:function(e){var a,l=e.currentFileUploadReq,r=l.file;a=s.API_SUBPATH_NEW,this.options.appApi.rnaApi.done(_.bind(function(d){var p=d.esApi.getEchoSignServiceParams(),h=p.apiURL,c=this.options.esAuthUiModel,u=c.get("access_token"),m=r.get("ext").toLowerCase();r.get("isTemp")&&r.get("name").toLowerCase().endsWith(".pdf")&&(m="pdf");var E=n.getFileMimeType(m),g=_.extend({docToUpload:r,esAccessToken:u,esUploadEndpoint:h+a+"/transientDocuments",mimeType:E,apiVersion:s.API_VERSION_V6},this.options);t.opFactory.create("UploadDocumentToEchoSignOp",g).run().then(_.bind(function(t){l.responseObj=t,l.progressObj=t.progressObj,e.currentFileUploadReq=l;var s=t.status;s===o.STARTED?(console.log("UploadStarted"),this._listenForUploadProgressEvents(e)):s===o.FINISHED?(console.log("UploadFinished"),this._processUploadFinishedResult(e),!i.QueryParams||"SharePopup_RequestSignatures"!==i.QueryParams.shareVariant&&"SharePopup_RequestSignatures_Disclosed"!==i.QueryParams.shareVariant||"attachToEmail"!==i.QueryParams.launchApp||this._resetSendMailPopupView()):s===o.QUEUED&&(console.log("UploadQueued"),this._listenForUploadProgressEvents(e))},this),_.bind(function(i){l.responseObj=i,e.currentFileUploadReq=l,this.promise.reject(l.errorSet),this.options.canSignUiModel.set("can_sign_state","failed")},this))},this))},_listenForUploadProgressEvents:function(e){var i,s,n=e.currentFileUploadReq,o=n.responseObj,a=n.progressObj;i=t.uiModelFactory.create("ESDocUploadProgressUiModel",this.options),i.set("upload_response",o),i.set("progress_obj",a),i.on("all",_.bind(function(t){if("change"!==t)switch(s=i.get("progress_status"),e.currentFileUploadReq=n,s){case"ongoing":n.bytesUploaded=i.get("bytes_uploaded"),n.bytesTotal=i.get("bytes_total"),console.log("uploading ...");break;case"finished":n.responseObj=i.get("upload_response"),console.log("_listenForUploadProgressEvents : finished !"),this._processUploadFinishedResult(e)}},this)),t.opFactory.create("ListeningForESDocUploadProgressEventsOp",_.extend({esDocUploadProgressUiModel:i},this.options)).run()},_processUploadFinishedResult:function(e){var i,t=this.options.canSignUiModel,s=t.get("upload_req_queue"),n=e.currentFileUploadReq;return n.responseObj.errorSet?(this.promise.reject(n.errorSet),this.options.canSignUiModel.set("can_sign_state","failed"),this.promise):(console.log("upload and run sfs op : transient ID : "+String(n.responseObj.respBody.transientDocumentId)),t.get("transient_Doc_Ids").push(n.responseObj.respBody.transientDocumentId),n.uploadStatus="success",i=_.every(s,_.bind(function(e){return"success"===e.uploadStatus},this)),void(i&&(this.options.canSignUiModel.set("can_sign_state","uploaded"),this.promise.resolve("upload Success"))))}})}),define("pdmplugins/unified-share/js/ops/can-send-for-review-op",["core/ac-core","pdmplugins/unified-share/js/ac-unified-share","i18n!pdmplugins/unified-share/js/nls/ui-strings","pdmplugins/unified-share/js/utils/sc-constants"],function(e,i,t,s){return i.CanSendForReviewOp=e.Op.extend({run:function(){var e,i,n,o,a,l,r,d,p,h=this.options,c=h.sendFilesUiModel,u=[],m=[],E=$.Deferred(),g="true"===c.get("isModalView")?!0:!1,S="true"===c.get("isPopupView")?!0:!1;o=c.get("local_file_objects"),i=[],n=c.get("metadata_collection");for(var f=0;f<n.length;f++)a=n.models[f],_.isUndefined(a.get("fileAttr"))||i.push(a.get("fileAttr"));e=_.union(o,i);var A={1:t.REVIEW_DISABLE_REASON_PORTFOLIO,2:t.REVIEW_DISABLE_PROTECTED,3:t.REVIEW_DISABLE_PROTECTED,4:t.REVIEW_DISABLE_PROTECTED,5:t.REVIEW_DISABLE_PROTECTED,6:t.REVIEW_DISABLE_DYNAMIC_XFA_FILE,7:t.REVIEW_DISABLE_REASON_INVALID_FILE,9:t.REVIEW_DISABLE_REASON_UNSUPPORTED_ANNOTS,10:t.REVIEW_DISABLE_REASON_LEGACY_SHARED_REVIEW,11:t.REVIEW_DISABLE_REASON_PDFA,12:t.REVIEW_DISABLE_PROTECTED},v={1:t.REVIEW_DISABLE_REASON_PORTFOLIO_MODAL,2:t.REVIEW_DISABLE_PROTECTED_MODAL,3:t.REVIEW_DISABLE_PROTECTED_MODAL,4:t.REVIEW_DISABLE_PROTECTED_MODAL,5:t.REVIEW_DISABLE_PROTECTED_MODAL,6:t.REVIEW_DISABLE_DYNAMIC_XFA_FILE,7:t.REVIEW_DISABLE_REASON_INVALID_FILE_MODAL,9:t.REVIEW_DISABLE_REASON_UNSUPPORTED_ANNOTS_MODAL,10:t.REVIEW_DISABLE_REASON_LEGACY_SHARED_REVIEW_MODAL,11:t.REVIEW_DISABLE_REASON_PDFA_MODAL,12:t.REVIEW_DISABLE_PROTECTED_MODAL},R={1:"kDisabledReasonPortfolio",2:"kDisabledReasonPasswordProtected",3:"kDisabledReasonCertificateProtected",4:"kDisabledReasonPolicyProtected",5:"kDisabledReasonUnknownProtected",6:"kDisabledDynamicXFAFile",7:"kDisabledReasonInvalidFileObject",8:"kDisabledReasonScannedDoc",9:"kDisabledReasonUnsupportedAnnots",10:"kDisabledReasonLegacySharedReview",11:"kDisabledReasonPDFAFile",12:"kDisabledReasonMIPFile"};return _.each(e,_.bind(function(e){if(_.isEmpty(e)){m.push({file:e,errorCode:7});var i={code:7,msg:g||S?v[7]:A[7],analyticsEvent:R[7]};return void E.reject(i)}if(!_.isUndefined(e.get("path"))&&("\\\\www.adobe.com\\go\\homeacrordrunified18_2018"===e.get("path")||"http://www.adobe.com/go/homeacrordrunified18_2018"===e.get("path")))return void E.resolve();if(!_.isEmpty(e.get("assetId"))&&_.isUndefined(e._proxy))return void E.resolve();if(_.isEmpty(e.get("assetId"))&&(r=e.get("ext"),d=e.get("isTemp"),_.isEmpty(r)||!_.some(s.SUPPORTED_EXTNS_REVIEW,function(e){return e.toLowerCase()===r.toLowerCase()})&&!d)){m.push({file:e,errorCode:7});var i={code:7,msg:g||S?v[7]:A[7],analyticsEvent:R[7]};return void E.reject(i)}u.push(e)},this)),0==u.length?E:(l=_.map(u,function(e){return e._proxy}),console.log("Files length:"+l.length),p={methodName:"canSendForReview",methodArgs:l},h.appApi.rnaApi.done(_.bind(function(e){e.servicesApi(p).then(_.bind(function(e){var i=e;if(i.errorSet)E.resolve();else{var t={code:i.errorCode,msg:g||S?v[i.errorCode]:A[i.errorCode],analyticsEvent:R[i.errorCode]};E.reject(t)}},this),_.bind(function(e){e=7;var i={code:e,msg:g||S?v[e]:A[e],analyticsEvent:R[e]};E.reject(i)},this))},this)),E)}}),i.CanSendForReviewOp}),define("pdmplugins/unified-share/js/ops/get-from-addressbook-op",["core/ac-core","pdmplugins/unified-share/js/ac-unified-share"],function(e,i){return i.GetFromAddressbookOp=e.Op.extend({run:function(){var e=$.Deferred();return this.options.appApi.rnaApi.done(_.bind(function(i){i.stApi.resolveAddressBookApi().then(_.bind(function(i){i._addEventListener("custom:onAddressesAdded",_.bind(function(i,t){var s=t.params;s.length?e.resolve(s):e.reject()},this))},this),_.bind(function(){e.reject()},this))},this)),e.promise()}}),i.GetFromAddressbookOp}),define("pdmplugins/unified-share/js/ops/create-instant-link-op",["core/ac-core","i18n!core/nls/ui-strings","i18n!pdmplugins/unified-share/js/nls/ui-strings","pdmplugins/unified-share/js/ac-unified-share","core/utils/http-util","pdmplugins/unified-share/js/utils/sc-constants"],function(e,i,t,s,n){s.CreateInstantLinkOp=e.Op.extend({run:function(){{var e,i,t,s,o,a,l,r,d=this.options;d.appApi.dialogApi}s=d.shareFiles.map(function(e){var i={id:e.id||e.get("id"),name:e.get("name"),content_type:e.content_type||e.get("content_type"),size:e.get("size")};return i}),e=d.rootUrl+"/a/api/invitation/publicLink",i="POST",l=this.options.sendFilesUiModel.get("filename"),r=this.options.sendFilesUiModel.get("openedFileAssetId");var t;return t=""===r?{content_types:["application/pdf"],is_review:d.is_review,asset_name:l}:{content_types:["application/pdf"],is_review:d.is_review,asset_name:l,asset_id:r},o=JSON.stringify(t),a=n.getRequestHeaders(i),a["Content-Type"]="application/json",this.options.instantLinkCreationPromise=$.Deferred(),this.options.appApi.rnaApi.done(_.bind(function(e){e.logPerformance("NwCall_CreateLink","start")},this)),$.ajax(e,{data:o,dataType:"json",success:_.bind(function(e,i,t){this.options.appApi.rnaApi.done(_.bind(function(e){e.logPerformance("NwCall_CreateLink","end")},this));this.options;e.public_link&&l==e.asset_name?this.options.instantLinkCreationPromise.resolve(e):this.options.instantLinkCreationPromise.reject(t)},this),complete:_.bind(function(){},this),error:_.bind(function(e){this._logData(void 0,this.options,"Error",e),423==e.status&&this.options.appApi.rnaApi.done(_.bind(function(e){e.invokeMethod({methodName:"triggerMigrationInProgressError",methodArgs:{}})},this)),this.options.instantLinkCreationPromise.reject(e)},this),global:!1,headers:a,type:i}),this.options.instantLinkCreationPromise},_logData:function(e,i,t,s){var n={};n.Status=t,"Success"===t?(_.isUndefined(e)||(n.parcelid=e),n.CountFileAdded=this.options.fileCount,n.CountUserAdded=i.is_individual?i.sendFilesUiModel.getRecipientsArray().length+"":"NA"):(n.ErrorCode=s.status+"",n.ErrorMessage=s.responseText),n.SharingType=this._computeSharingType(i.is_review,i.is_individual),i.sendFilesUiModel.get("ShareVariant")&&(n.ShareVariant=i.sendFilesUiModel.get("ShareVariant")),this.options.appApi.rnaApi.done(_.bind(function(e){var i={methodName:"logUnifiedShareCreateInstantLink",methodArgs:[n]};e.stApi.invokeMethod(i)},this))},_computeSharingType:function(e,i){var t="";return t+=i?"Personalized":"Public",t+=" - ",t+=e?"Can Comment":"Can View Only"}})}),define("pdmplugins/unified-share/js/ops/fetch-mail-profiles-op",["core/ac-core","pdmplugins/unified-share/js/ac-unified-share","core/ops/op"],function(e,i){i.FetchMailProfilesOp=e.Op.extend({run:function(){this.options.appApi.rnaApi.done(_.bind(function(e){e.stApi.getAllWebmailProfiles().then(_.bind(this._updateProfilesInUiModel,this))},this))},_updateProfilesInUiModel:function(e){var i={};for(var t in e){var s=e[t].EmailAddress;i[s]=t}_.isEmpty(i)!==!0&&this.options.SendMailUiModel.set("email_addresses",i)}})}),define("pdmplugins/unified-share/js/ops/fetch-last-used-mail-prefs-op",["core/ac-core","pdmplugins/unified-share/js/ac-unified-share","core/ops/op"],function(e,i){i.FetchLastUsedMailPrefs=e.Op.extend({run:function(){this.options.appApi.rnaApi.done(_.bind(function(e){e.stApi.getLastUsedPreferences().then(_.bind(this._updateLastUsedChoices,this))},this))},_updateLastUsedChoices:function(e){var i,t,s,n=this.options.SendMailUiModel;e&&(n.set("default_mail_set",e.defaultSet),i=e.useWebmail,e.webmailDisabled&&(n.set("send_mail_mode","sm_default_mail"),i=!1),i?(n.set("send_mail_mode","sm_webmail"),t=e.selectedProfile,s=this._convertEncodedToSimpleProfile(t),n.set("selected_profile",s)):n.set("send_mail_mode","sm_default_mail"))},_convertEncodedToSimpleProfile:function(e){var i=this.options.SendMailUiModel,t=i.get("email_addresses");for(var s in t)if(t[s]===e)return s;return""}})}),define("pdmplugins/unified-share/js/ops/ensure-signin-and-get-subscription-level-op",["core/ac-core","pdmplugins/unified-share/js/ac-unified-share","pdmplugins/unified-share/js/utils/ts-utils","core/ops/op"],function(e,i,t){i.EnsureSignInAndGetSubscriptionLevelOp=e.Op.extend({run:function(){var e=$.Deferred();return this.options.appApi.sessionApi.ensureSignedIn().then(_.bind(function(){this.options=_.extend(this.options,this._getPostSignInOptions()),this.options.readRegistry=!1,i.opFactory.create("DesktopGettingSubscriptionLevels",this.options).run().then(_.bind(function(){e.resolve()},this),_.bind(function(){e.reject()},this))},this),_.bind(function(){e.reject()},this)),e.promise()},_getPostSignInOptions:function(){var e,i,s;return s=this.options.appApi.baseFilesUrisApi.getAlternateUploadUri(),i=this.options.appApi.baseFilesUrisApi.getSendApiUri(),i=t.extractRootUrl(i),e={rootUrl:i,uploadUrl:s}}})}),define("pdmplugins/unified-share/js/ops/create-instant-link-for-mail-op",["core/ac-core","pdmplugins/unified-share/js/ac-unified-share","core/ops/op"],function(e,i){i.CreateInstantLinkForMailOp=e.Op.extend({run:function(){return this._instantLinkRetrieved=$.Deferred(),this.options.appApi.rnaApi.done(_.bind(function(e){this._rnaApi=e,this._checkRestrictionsAndCreateLink()},this)),this._instantLinkRetrieved.promise()},_checkRestrictionsAndCreateLink:function(){var e,t=this.options.sendFilesUiModel,s=t.get("metadata_collection"),n=t.get("local_file_objects"),o=t.get("allow_comments"),a=s.length+n.length;return 1!=a?void this._instantLinkRetrieved.reject():(e={uiModel:t,files:s,localFiles:n,recipients:[],recipientsAreFinalized:!0,is_public:!1,is_individual:!1,can_make_comments:o,is_review:o,assetIdarray:[]},this.options=_.extend({},this.options,e),void i.opFactory.create("EnsureSignInAndGetSubscriptionLevelOp",this.options).run().then(_.bind(function(){var e=!1;e=this._rnaApi.isFeatRunning()?this._rnaApi.stApi.isSendTrackRestrictionsEnabled():this.options.limitsModel.get("restrictions"),e?this._instantLinkRetrieved.reject():this._createInstantLink()},this),_.bind(function(){this._instantLinkRetrieved.reject()},this)))},_createInstantLink:function(){var e,t,s=this.options.sendFilesUiModel.get("share_collection"),n=this.options.sendFilesUiModel.get("metadata_collection");s.reset(),n.each(function(e){var t=new i.FileMetadataModel;t.set(_.clone(e.attributes)),s.add(t)}),t=_.extend({shareFiles:s},this.options),e=i.opFactory.create("CreateInstantLinkOp",t).run().then(_.bind(function(e){var i=this.options.sendFilesUiModel;i.set("instant_link_mapped",!1),i.set("instant_link",e.public_link),i.set("instant_link_token",e.public_link_token),i.set("instant_link_expiry",e.expiry_time),this._rnaApi.rnaUnifiedSharePopupAPI.storeInstantLinkInfo(i.get("instant_link"),i.get("instant_link_token"),i.get("instant_link_expiry"),"#send-mode",e.asset_id),this._instantLinkRetrieved.resolve()},this),_.bind(function(){this._instantLinkRetrieved.reject()},this))}})}),define("pdmplugins/unified-share/js/ops/send-mail-with-link-op",["core/ac-core","pdmplugins/unified-share/js/ac-unified-share","i18n!pdmplugins/unified-share/js/nls/ui-strings","core/utils/util","core/ops/op"],function(e,i,t,s){i.SendMailWithLinkOp=e.Op.extend({run:function(){this.options.appApi.rnaApi.done(_.bind(function(e){this._rnaApi=e,this._sendMailWithLinkOp()},this))},_sendMailWithLinkOp:function(){var e=this.options.sendFilesUiModel,i=e.get("instant_link");if(i){var t=this._createMailBody(i);e.get("instant_link_mapped")!==!0&&(e.set("instant_link_mapped",!0),this._rnaApi.rnaUnifiedSharePopupAPI.mapInstantLink());var s={useWebmail:this.options.useWebmail,profile:this.options.profile,message:t,instantLink:!0};this._rnaApi.stApi.sendMailWithoutFLD(s)}},_createMailBody:function(e){if(e){var i,n=this.options.sendFilesUiModel,o=this.options.SendMailUiModel,a="\r\n";return i=a,i+=_.template(t.ATTACH_LINK_VIEW_FILE_MSG,{FILENAME:n.get("filename")}),i+=a+e+a,s.isMac()&&"sm_default_mail"===o.get("send_mail_mode")&&o.get("default_email_client")===t.EMAIL_CLIENT_OUTLOOK||(i+=a+"________________"+a+t.ATTACH_LINK_INFO_MSG),i}return""}})}),define("pdmplugins/unified-share/js/ops/op-factory",["core/ac-core","pdmplugins/unified-share/js/ac-unified-share","pdmplugins/unified-share/js/ops/plugin/starting-plugin-op","pdmplugins/unified-share/js/ops/plugin/starting-selector-op","pdmplugins/unified-share/js/ops/plugin/getting-authenticated-models-op","pdmplugins/unified-share/js/ops/desktop-getting-subscription-levels-op","pdmplugins/unified-share/js/ops/begin-desktop-upload-op","pdmplugins/unified-share/js/ops/desktop-do-upload-op","pdmplugins/unified-share/js/ops/finding-upload-folder-op","pdmplugins/unified-share/js/ops/desktop-fetching-autocomplete-list-op","pdmplugins/unified-share/js/ops/close-app-op","pdmplugins/unified-share/js/ops/upload-and-run-sfs-op","pdmplugins/unified-share/js/ops/can-sign-file-validator","pdmplugins/unified-share/js/ops/can-send-for-review-op","pdmplugins/unified-share/js/ops/get-from-addressbook-op","pdmplugins/unified-share/js/ops/create-instant-link-op","pdmplugins/unified-share/js/ops/fetch-mail-profiles-op","pdmplugins/unified-share/js/ops/fetch-last-used-mail-prefs-op","pdmplugins/unified-share/js/ops/ensure-signin-and-get-subscription-level-op","pdmplugins/unified-share/js/ops/create-instant-link-for-mail-op","pdmplugins/unified-share/js/ops/send-mail-with-link-op"],function(e,i){return i.OpFactory=e.Op.extend({create:function(e,t){var s=i[e];return s?new s(t):void LOG(0,"AcUnifiedShare.OpFactory.create: Unrecognized class: "+e)}}),i.OpFactory}),define("pdmplugins/unified-share/js/templates/us-content-template",[],function(){return'<div id="unified-share-container" class ="ui-theme theme-share-container"><div id="unified-share-rhp-view" class ="ui-theme theme-share-container"></div><div id="unified-share-modal-view" class ="ui-theme theme-share-container"></div><div id="unified-share-popup-view" class ="ui-theme theme-share-container"></div></div>'}),define("pdmplugins/unified-share/js/models/limits-model",["core/ac-core","pdmplugins/unified-share/js/ac-unified-share","i18n!pdmplugins/unified-share/js/nls/ui-strings","core/models/model"],function(e,i,t){i.LimitsModel=e.Model.extend({initialize:function(i,t){e.Model.prototype.initialize.call(this,i,t),this.rootUrl="",t.rootUrl&&(this.rootUrl=t.rootUrl),t.usersMeApi&&(this.usersMeApi=t.usersMeApi)},url:function(){return this.rootUrl+"/a/api/users/me/limits"},setRUrl:function(e){this.rootUrl=e},resetValues:function(){var i;e.Util.isCEF()?e.Util.isReader()?i=t.READER_GO_URL:e.Util.isAcrobat()&&(i=t.ACROBAT_GO_URL):i="https://www.acrobat.com/adobesend/en/pricing.html?promoid=KQMMS",this.set({can_send_to_individuals:!1,can_send_av:!1,can_custom_brand:!1,av_mimetypes:["application/mxf","application/ogg","application/vnd.rn-realmedia"],av_extensions:["aac","aic","aif","aiff","asf","asx","au","avi","avs","dif","divx","dv","flv","f4v","lsf","lsx","mkv","m3u","m4a","m4p","m4v","mov","movie","mp2","mp3","mp4","mpe","mpeg","mpg","mpga","mxu","ogg","qt","ra","ram","rm","snd","vob","wav","wma","wmv"],max_files:50,max_recipients:250,max_subject_length:1e3,max_message_length:1e3,upgrade_url:i},{rootUrl:void 0,usersMeApi:void 0})
},parse:function(i){return i.hasOwnProperty("account_type")||(i.account_type=e.Util.isCEF()?this.usersMeApi.getUserIdentity().account_type:"adobeid"),i}})}),define("pdmplugins/unified-share/js/models/disallowed-file-model",["core/ac-core","pdmplugins/unified-share/js/ac-unified-share","core/models/model"],function(e,i){i.DisallowedFileModel=e.Model.extend({})}),define("pdmplugins/unified-share/js/models/file-metadata-model",["core/ac-core","pdmplugins/unified-share/js/ac-unified-share","core/models/model"],function(e,i){i.FileMetadataModel=e.Model.extend({url:function(){return Ac.baseFilesUrisModel.getApiUri()+"assets/"+encodeURIComponent(this.get("id"))+"/metadata"}})}),define("pdmplugins/unified-share/js/collections/file-metadata-collection",["pdmplugins/unified-share/js/ac-unified-share","pdmplugins/unified-share/js/models/file-metadata-model"],function(e){e.FileMetadataCollection=Backbone.Collection.extend({model:e.FileMetadataModel})}),define("pdmplugins/unified-share/js/models/email-addr-model",["core/ac-core","pdmplugins/unified-share/js/ac-unified-share","core/models/model"],function(e,i){i.EmailAddrModel=e.Model.extend({})}),define("pdmplugins/unified-share/js/collections/email-addr-collection",["pdmplugins/unified-share/js/ac-unified-share","pdmplugins/unified-share/js/models/email-addr-model"],function(e){return e.EmailAddrCollection=Backbone.Collection.extend({model:e.EmailAddrModel}),e.EmailAddrCollection}),define("pdmplugins/unified-share/js/models/ui/send-files-ui-model",["core/ac-core","pdmplugins/unified-share/js/ac-unified-share","core/utils/action-ids","i18n!pdmplugins/unified-share/js/nls/ui-strings","moment","core/models/ui/ui-model","pdmplugins/unified-share/js/models/disallowed-file-model","pdmplugins/unified-share/js/collections/file-metadata-collection","pdmplugins/unified-share/js/collections/email-addr-collection"],function(e,i,t,s,n){i.SendFilesUiModel=e.UiModel.extend({closeTheBrowserUrl:"https://acrobatoauth.adobe.com/?acro_reader=acro_close",audioVideoMimetypes:["application/mxf","application/ogg","application/vnd.rn-realmedia"],audioVideoExtensions:["aac","aic","aif","aiff","asf","asx","au","avi","avs","dif","dv","lsf","lsx","m3u","m4a","m4p","m4v","mov","movie","mp2","mp3","mp4","mpe","mpeg","mpg","mpga","mxu","ogg","qt","ra","ram","rm","snd","wav","wma","wmv"],recognized:{active:{type:"boolean",optional:!1},cl_active_view:{type:"string",optional:!1,choices:["welcome","working","complete"]},active_view:{type:"string",optional:!1,choices:["welcome","workflow","success"]},disallowed_files:{type:"array",optional:!0},display_individual_ipm:{type:"boolean",optional:!0},display_individual_help:{type:"boolean",optional:!0},email_addr_collection:{type:"object",optional:!0},local_file_objects:{type:"array",optional:!0},connector_file_objects:{type:"array",optional:!0},ccloud_file_objects:{type:"array",options:!0},metadata_collection:{type:"object",optional:!0},share_collection:{type:"object",optional:!0},parcel:{type:"object",optional:!0},is_public:{type:"boolean",optional:!1},is_individual:{type:"boolean",optional:!1},US_tab_open:{type:"string",optional:!1,choices:["share","createLink","attachToEmail","sendForSignature","promoteSign"]},allow_comments_enabled:{type:"boolean",optional:!0},allow_comments:{type:"boolean",optional:!0},customize_recipient_page_enabled:{type:"boolean",optional:!1},customize_recipient_page:{type:"boolean",optional:!0},enable_add_files:{type:"boolean",optional:!0},enable_autocomplete:{type:"boolean",optional:!1},enable_autoc_arrows:{type:"boolean",optional:!1},enable_sender_survey:{type:"boolean",optional:!0},initial_subject:{type:"string",optional:!0},initial_message:{type:"string",optional:!0},limits_model:{type:"object",optional:!1},view_mode:{type:"string",optional:!1,choices:["web","jts","cef"]},user_action_id:{type:"string",optional:!0},user_action_name:{type:"string",optional:!0},local_branding_file:{type:"array",optional:!0},enable_form_send:{type:"boolean",optional:!1},direct_to_workflow:{type:"string",optional:!1},respond_back_options_enabled:{type:"boolean",optional:!1},reader_mailto_enabled:{type:"boolean",optional:!1},include_message:{type:"boolean",optional:!0},respond_back:{type:"boolean",optional:!0},show_mailto_in_jts:{type:"boolean",optional:!1},connectors_api:{type:"object",optional:!1},show_address_book:{type:"boolean",optional:!1},autocomplete_scroll:{type:"boolean",optional:!1},autocomplete_eventual_click:{type:"boolean",optional:!1},autocomplete_immediate_click:{type:"boolean",optional:!1},autocomplete_avoided:{type:"boolean",optional:!1},autocomplete_local_contacts_imported:{type:"boolean",optional:!1},autocomplete_cloud_contacts_imported:{type:"boolean",optional:!1},autocomplete_msgraph_contacts_imported:{type:"boolean",optional:!1},us_share_state:{type:"string",optional:!0},us_mode:{type:"string",optional:!0},cl_mode:{type:"string",optional:!0},launchpad:{type:"string",optional:!0},us_subject_text:{type:"string",optional:!0},us_message_text:{type:"string",optional:!0},cl_subject_text:{type:"string",optional:!0},cl_message_text:{type:"string",optional:!0},is_subject_user_input:{type:"boolean",optional:!0},is_message_user_input:{type:"boolean",optional:!0},sign_default_sub:{type:"string",optional:!0},share_loader_text:{type:"string",optional:!0},set_deadline:{type:"boolean",optional:!0},set_reminder:{type:"boolean",optional:!0},deadline:{type:"string",optional:!0},reminder:{type:"string",optional:!0},ShareVariant:{type:"string",optional:!0},default_modal_view_tab:{type:"string",optional:!0},checkForSave:{type:"boolean",optional:!0},default_email_client:{type:"string",optional:!0},send_parcel:{type:"object",optional:!0},review_parcel:{type:"object",optional:!0},instant_link:{type:"string",optional:!0},instant_link_token:{type:"string",optional:!0},instant_link_expiry:{type:"string",optional:!0},reset_model:{type:"integer",optional:"true"},filename:{type:"string",optional:!0},promoteSign:{type:"boolean",optional:!0},isShareViewSyncEnabled:{type:"boolean",optional:!0},isOriginalShareEnabled:{type:"boolean",optional:!0}},defaults:{active_view:"welcome",cl_active_view:"welcome",active:!1,disallowed_files:[],enable_add_files:!0,enable_autocomplete:!0,enable_autoc_arrows:!0,local_file_objects:[],connector_file_objects:[],ccloud_file_objects:[],is_public:!0,is_individual:!1,US_tab_open:"share",view_mode:"web",allow_comments_enabled:!0,allow_comments:!1,customize_recipient_page_enabled:!1,enable_form_send:!0,direct_to_workflow:"original",respond_back_options_enabled:!1,include_message:!1,respond_back:!1,reader_mailto_enabled:!1,show_mailto_in_jts:!1,show_address_book:!1,autocomplete_scroll:!1,autocomplete_eventual_click:!1,autocomplete_immediate_click:!1,autocomplete_avoided:!1,autocomplete_local_contacts_imported:!1,autocomplete_cloud_contacts_imported:!1,autocomplete_msgraph_contacts_imported:!1,us_share_state:"preShare",us_mode:"#send-mode",cl_mode:"#send-mode",launchpad:"shareButton",us_subject_text:"",us_message_text:"",cl_subject_text:s.SHARE_INITIAL_SUBJECT,cl_message_text:s.SHARE_MESSAGE_PROMPT_REVIEW,is_subject_user_input:!1,is_message_user_input:!1,sign_default_sub:"",share_loader_text:"",set_deadline:!1,set_reminder:!1,deadline:"",reminder:"",ShareVariant:"Share",default_modal_view_tab:"createLink",checkForSave:!0,default_email_client:s.EMAIL_CLIENT_OUTLOOK,send_parcel:null,review_parcel:null,reset_model:0,filename:"",promoteSign:!1,isShareViewSyncEnabled:!1,isOriginalShareEnabled:!1},initialize:function(){var t,s,n;e.UiModel.prototype.initialize.call(this),t=new i.FileMetadataCollection,n=new i.FileMetadataCollection,s=new i.EmailAddrCollection,this.set({metadata_collection:t,email_addr_collection:s,share_collection:n})},initializeFromCohorts:function(e){e&&(e["ts-direct-to-workflow-view"]&&this.set({direct_to_workflow:e["ts-direct-to-workflow-view"]}),e["ts-respond-back-1"]&&this.set({respond_back_options_enabled:"enabled"===e["ts-respond-back-1"]}),e["ts-reader-mailto"]&&this.set({reader_mailto_enabled:"enabled"===e["ts-reader-mailto"]}),e["ts-a12-ui"]&&"enabled"===e["ts-a12-ui"]&&this.set({view_mode:"cef"}),e["ts-address-book"]&&this.set({show_address_book:"enabled"===e["ts-address-book"]}),e["ts-autocomplete"]&&this.set({enable_autocomplete:"enabled"===e["ts-autocomplete"]}),e["ts-autoc-arrows"]&&this.set({enable_autoc_arrows:"enabled"===e["ts-autoc-arrows"]}))},resetTodefaults:function(){this._resetModelElementsToDefaults(),this.resetEmailCollection(),this.resetFileListModel(),this.resetAutocomplete()},resetUITodefault:function(){this._resetModelElementsToDefaults(),this.resetEmailCollection(),this.resetAutocomplete(),this.set("reset_model",this.get("reset_model")+1)},resetFileListModel:function(){this.get("metadata_collection").reset(),this.get("share_collection").reset(),this.set("disallowed_files",[],{silent:!0}),this.set("local_file_objects",[],{silent:!0}),this.set("connector_file_objects",[],{silent:!0}),this.set("ccloud_file_objects",[],{silent:!0})},resetEmailCollection:function(){this.get("email_addr_collection").reset()},_resetModelElementsToDefaults:function(){this.set({active:!0,active_view:"welcome",cl_active_view:"welcome",is_public:!0,is_individual:!1,US_tab_open:"share",enable_add_files:!0,allow_comments_enabled:!0,customize_recipient_page_enabled:!1,success_dlg_version:"original",url_to_clipboard:"original",direct_to_workflow:"original",respond_back_options_enabled:!1,reader_mailto_enabled:!1,enable_form_send:!0,show_address_book:!1,autocomplete_local_contacts_imported:!1,autocomplete_cloud_contacts_imported:!1,autocomplete_msgraph_contacts_imported:!1,us_share_state:"preShare",us_mode:"#send-mode",cl_mode:"#send-mode",launchpad:"shareButton",cl_subject_text:s.SHARE_INITIAL_SUBJECT,cl_message_text:s.SHARE_MESSAGE_PROMPT_REVIEW,us_message_text:"",sign_default_sub:"",share_loader_text:"",set_deadline:!1,set_reminder:!1,deadline:"",reminder:"",default_modal_view_tab:"createLink",is_message_user_input:!1})},resetAutocomplete:function(){this.set({autocomplete_avoided:!1,autocomplete_scroll:!1,autocomplete_immediate_click:!1,autocomplete_eventual_click:!1})},resetClSubAndMsg:function(){this.set({cl_subject_text:s.SHARE_INITIAL_SUBJECT,cl_message_text:s.SHARE_MESSAGE_PROMPT_REVIEW})},close:function(){this.set({active:!0,active_view:"welcome",is_public:!0,is_individual:!1,US_tab_open:"share"}),this.get("metadata_collection").reset(),this.get("share_collection").reset(),this.get("email_addr_collection").reset(),this.set("disallowed_files",[],{silent:!0}),this.set("local_file_objects",[],{silent:!0}),this.set("connector_file_objects",[],{silent:!0}),this.set("ccloud_file_objects",[],{silent:!0})},setShareState:function(e){this.set("us_share_state",e)},setUSMode:function(e){this.set("us_mode",e)},setCLMode:function(e){this.set("cl_mode",e)},setLaunchpad:function(e){this.set("launchpad",e)},setSubjectText:function(e){this.set("us_subject_text",e)},setMessageText:function(e){this.set("us_message_text",e)},addFilesToCollection:function(e,s,n,o,a){var l,r,d,p=n?n:this.get("metadata_collection"),h=[],c=this.get("limits_model"),u=c.get("can_send_av"),m=this.get("local_file_objects").length+p.length,E=c.get("max_files"),g=[],S=this.get("enable_form_send");return!a&&e.length+m>E?(d=E-m,l=e.slice(0,d),r=e.slice(d,e.length),_.each(r,function(e){var t=new i.DisallowedFileModel({name:e,reason:"over-limit"});g.push(t)})):l=e,_.each(l,function(e){var n,o=s?s[e]:void 0,a=new i.FileMetadataModel({id:e,fileAttr:o,global:!1}),l=this.get("connectors_api");n=a.fetch({global:!1}),p.add(a),n.then(_.bind(function(e){var s,n;!S&&this.isFormType(e.get("content_type"))?n="form":!u&&this.isAudioVideoType(e.get("content_type"))?n="audio-video":l.isActionRestrictedOnItems(e,t.SEND)&&(n="non-native"),n&&(p.remove(e),s=new i.DisallowedFileModel({name:e.get("name"),source:e.get("source"),reason:n}),g.push(s))},this,a)),n.fail(_.bind(function(e,i,t){404===t.status&&e.remove(i)},this,p,a)),h.push(n)},this),$.when.apply(null,h).done(_.bind(function(){g=g.concat(this.get("disallowed_files")),this.set("disallowed_files",g,{silent:o})},this)),h},updateOpenedFile:function(e){var i=this.get("local_file_objects");i.shift(),i.unshift(e),this.set("local_file_objects",i),this.trigger("change:local_file_objects")},addFileObjects:function(e){var i=this.get("local_file_objects"),t=i.concat(e);this.set("local_file_objects",t),this.trigger("change:local_file_objects")},addConnectorFileObjects:function(e){var i=this.get("connector_file_objects"),t=i.concat(e);this.set("connector_file_objects",t)},addCCloudFileObjects:function(e){var i=this.get("ccloud_file_objects"),t=i.concat(e);this.set("ccloud_file_objects",t)},setBrandingFileObjects:function(e){this.set("local_branding_file",e)},removeFileObjects:function(e,i){var t,s,n,o,a,l,r,d,p=i,h=[];for(a=0,l=p.length;l>a;a+=1){for(t=p[a],o=!1,r=0,d=e.length;d>r;r+=1)if(s=e[r],n=Object.prototype.toString.call(s),"[object File]"===n){if(t.name===s.name){o=!0;break}}else if(t.cid===s.cid){o=!0;break}o||h.push(t)}return h},removeLocalFile:function(e){var i,t,s,n,o,a,l,r,d=this.get("local_file_objects"),p=[];for(o=0,a=d.length;a>o;o+=1){for(i=d[o],n=!1,l=0,r=e.length;r>l;l+=1)if(t=e[l],s=Object.prototype.toString.call(t),i&&i===t){n=!0;break}n||p.push(i)}this.set("local_file_objects",p),this.trigger("change:local_file_objects")},isMultipleFilesSelected:function(){var e=this.get("local_file_objects"),i=this.get("metadata_collection");return e.length+i.length>1},isAudioVideoType:function(e){return e&&("audio/"===e.substring(0,6)||"video/"===e.substring(0,6)||_.contains(this.audioVideoMimetypes,e))},isFormType:function(e){return e&&"application/vnd.adobe.form.fillsign"===e},hasAudioVideoExt:function(e){var i=e.split(".").pop();return _.contains(this.audioVideoExtensions,i)},parseEmailArray:function(e,t){var s=/^\S+@\S+\.\S+$/,n=/[\]\)\"\'\}]$/,o=/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,a=_.reduce(e,function(e,a){var l,r,d,p=a,h=a.match(/\s*<(\S+)>/),c=t?t:"";return(a=$.trim(a))?(h?(p=h[1],r=a.substring(0,h.index),r=r.replace(/^\s+/,"")):p=$.trim(p),d=p.match(s)?!0:!1,d&&(d=p.match(n)?!1:!0,d=d?o.test(p):!1),l=new i.EmailAddrModel({email:p,friendly:r,valid:d,name:c}),e.push(l),e):e},[]);return a},addRecipientsToCollection:function(e){var i=this.get("email_addr_collection");i.add(e,{silent:!0}),i.trigger("set",{})},setRecipientsCollection:function(e,i){var t=this.get("email_addr_collection");t.set(e,{silent:!0}),t.trigger("set",i)},getRecipientsArray:function(){var e=this.get("email_addr_collection"),i=e.map(function(e){return e.get("friendly")?e.get("friendly")+" <"+e.get("email")+">":e.get("email")});return i},isSenderOnlyRecipient:function(e){for(var i=this.getRecipientsArray(),t=0;t<i.length;++t)if(i[t]!==e)return!1;return!0},isEmailBoxEmpty:function(){var e=this.getRecipientsArray();return _.isUndefined(e)||0===e.length?!0:!1},isInstantLinkValid:function(){var e=!0;if(this.get("instant_link_expiry")){var i=n.utc(this.get("instant_link_expiry"));i-Date.now()<0&&(e=!1)}return e},isValidInstantLinkPresent:function(){return this.get("instant_link")&&this.isInstantLinkValid()},isAVSharingPermitted:function(){var e=!0;return _.each(this.get("local_file_objects"),function(i){!this.get("limits_model").get("can_send_av")&&this.hasAudioVideoExt(i.get("ext"))&&(e=!1)},this),e}})}),define("pdmplugins/unified-share/js/models/ui/can-sign-ui-model",["core/ac-core","pdmplugins/unified-share/js/ac-unified-share","i18n!pdmplugins/unified-share/js/nls/ui-strings","core/models/ui/ui-model"],function(e,i){i.CanSignUiModel=e.UiModel.extend({recognized:{can_sign_state:{type:"string",optional:!0,choices:["init","authorising","authorised","uploading","uploaded","finish","failed"]},transient_Doc_Ids:{type:"array",optional:!0},access_token:{type:"string",optional:!0},upload_req_queue:{type:"array",optional:!0},advancedSignClick:{type:"boolean",optional:!0}},defaults:{can_sign_state:"init",transient_Doc_Ids:[],access_token:"",upload_req_queue:[],advancedSignClick:!1},initialize:function(){},resetTodefaults:function(){this.set({can_sign_state:"init",transient_Doc_Ids:[],access_token:"",upload_req_queue:[],advancedSignClick:!1})},close:function(){this.resetTodefaults()}})}),define("pdmplugins/unified-share/js/ops/desktop-add-files-op",["core/ac-core","core/utils/file-types","pdmplugins/unified-share/js/ac-unified-share","i18n!pdmplugins/unified-share/js/nls/ui-strings","pdmplugins/unified-share/js/models/disallowed-file-model"],function(e,i,t,s){t.DesktopAddFilesOp=e.Op.extend({run:function(){this.fileFormats=[],this.mimeTypes=[],this.promises=[];var e={windowTitle:s.READER_FILESELECT_WINDOW_TITLE,actionButton:s.READER_FILESELECT_CONTINUE_BUTTON,filterDesc:s.ALL_SUPPORTED_FILES,allowMultiple:!0,chooseFolder:!1,allowNewFolder:!1,allowBHSelection:!0,extnList:this.fileFormats,mimeTypes:this.mimeTypes,showCustomOpenDialog:!0},i=$.Deferred();return this.options.appApi.rnaApi.then(_.bind(function(s){return s.selectFiles(e).then(_.bind(function(e,s){var n,o,a=this.options.uiModel,l=e.localFiles,r=[],d=_.map(e.localFileInputs,function(e){return e[0]}),p=[],h=[],c=[],u=[],m=e.uploadedFileAttrs,E=e.uploadedFileIds,g=(a.get("limits_model"),a.get("metadata_collection").length+a.get("local_file_objects").length),S=g,f=99999;a.set("disallowed_files",[],{silent:!0}),m&&(E=_.keys(m)),E.length>0?(this.options.appApi.sessionApi.ensureSignedIn().then(_.bind(function(){t.opFactory.create("DesktopGettingSubscriptionLevels",this.options).run().always(_.bind(function(){a.addFilesToCollection(E,m)},this))},this)),S+=E.length):a.addFilesToCollection(E),l.length>0?_.each(l,_.bind(function(e){var i;f>g?(_.isUndefined(e.get("path"))||"\\\\www.adobe.com\\go\\homeacrordrunified18_2018"!==e.get("path")&&"http://www.adobe.com/go/homeacrordrunified18_2018"!==e.get("path"))&&_.isEmpty(e.get("ext"))?this.showError():(g+=1,r.push(e)):(i=new t.DisallowedFileModel({name:e.name,reason:"over-limit"}),h.push(i))},this)):d.length>0&&_.each(d,_.bind(function(e){var i;f>g?_.isEmpty(e.get("ext"))?this.showError():(g+=1,r.push(e)):i=new t.DisallowedFileModel({name:e.value,reason:"over-limit"}),i&&h.push(i)},this)),r&&_.each(r,_.bind(function(e){n=e.invoke("determineFileSource"),n.then(_.bind(function(i){if("root"===i||"unsupported"===i||"local"===i||"desktop_sharepoint"===i||"native"===i||"native_v2"===i)p.push(e);else if("box"===i||"dropbox"===i||"onedrive"===i||"onedrivebusiness"===i||"googleDrive"===i)p.push(e),c.push(e);else{var s;s=new t.DisallowedFileModel({name:e.get("name"),source:i,reason:"non-native"}),h.push(s)}},this),_.bind(function(){p.push(e)},this)),this.promises.push(n)},this)),m&&_.each(m,_.bind(function(e){o=e.invoke("determineFileSource"),o.then(_.bind(function(i){"ccloud"===i&&(p.push(e),u.push(e))},this)),this.promises.push(o)},this)),$.when.apply($,this.promises).always(_.bind(function(){a.addFileObjects(p),a.addConnectorFileObjects(c),a.addCCloudFileObjects(u),(l.length>0||d.length>0)&&(h=h.concat(a.get("disallowed_files")),a.set("disallowed_files",h)),g>0||S>0?i.resolve(s):i.reject()},this))},this),_.bind(function(){return i.reject().promise()},this))},this),_.bind(function(){return i.reject().promise()},this)),i.promise()},showError:function(){var e=this.options.appApi.dialogApi;e.displayTextAlert(e.SEVERITY_ERROR,s.ADD_FILES_REJECTED_TITLE,s.ADD_FILES_REJECTED_MESSAGE)}})}),define("pdmplugins/unified-share/js/templates/us-rhp-content-template",[],function(){return'<div id="us-close" class ="ui-theme theme-share-container"><div id="share-text" class= "ui-theme theme-text"><%= SHARE %></div><button class="share-close core-remove-x" aria-label ="<%= CLOSE %>" title="<%= CLOSE %>"></button></div><div id="unified-share-rhp-container" class ="ui-theme theme-share-container"><div id="us-success-view" class ="ui-theme theme-share-container"></div><div id="us-modal-view" tabindex = "-1" class ="ui-theme theme-share-container"></div><div id="us-cl-working-view" class ="ui-theme theme-share-container"></div><div id="us-cl-success-view" class ="ui-theme theme-share-container"></div><div class="share-loader"><div class="loader"></div><div id="mode-text" class= "ui-theme theme-text"></div><div id="uploading-text" class= "ui-theme theme-text"></div></div><div id="us-share-welcome-view" class ="ui-theme theme-share-container"><div id="us-file-list-container" class ="ui-theme theme-share-container"></div><div id="us-accordians-view-container" class ="ui-theme theme-share-container"></div></div></div>'}),define("pdmplugins/unified-share/js/templates/us-file-list-template",[],function(){return'<div id="share-files-list-box" class ="share-files-list-box ui-theme theme-share-container theme-share-border"><div class="share-tool-frame ui-theme theme-share-container">   <button class= "share-add-more-files addfile ui-theme theme-share-add-files theme-share-container" tabindex="0"                    aria-label ="<%= ADD_MORE_FILES %>" title="<%= ADD_MORE_FILES %>"><%= ADD_MORE_FILES %></button>   <ul class="us-share-files-list ui-theme theme-share-container" role="grid">   </ul></div></div>'}),define("pdmplugins/unified-share/js/templates/us-file-list-item-template",[],function(){return'<li class="us-share-file-list-item  ui-theme" title="<%= name %>" role="row">        <div class="us-share-file-list-name theme-text"              id="us-share-file-list-name-<%= asset_id %>" tabindex="-1">            <%= name %></div>        <button class="us-share-file-list-close core-remove-x"                data-asset-id="<%= asset_id %>"                data-list-index="<%= list_index %>"                title="<%= remove %>" tabindex="0"                aria-label="<%= ariaRemoveLabel %>"></button></li>'}),define("acplugins/my-recent-files/js/ac-my-recent-files",["plugins-common/ac-plugins"],function(e){var i=e.MyRecentFiles;return i||(i=e.MyRecentFiles={}),i}),define("acplugins/my-recent-files/js/ops/listening/listening-for-view-events-op",["core/ac-core","files/ac-files","acplugins/my-recent-files/js/ac-my-recent-files","core/ops/op","core/views/view-events","files/views/view-events"],function(e,i,t){t.ListeningForViewEventsOp=e.Op.extend({initialize:function(){e.Op.prototype.initialize.call(this),this._initEventMap(),this.options.appApi.sessionApi.addSignedInChangeCallback(this._onSignedInChange)},_onSignedInChange:function(e,i){i?this.options.rootView.off("all",this._onViewEvent):this.options.rootView.on("all",this._onViewEvent)},run:function(){var e=$.Deferred();return this.options.appApi.sessionApi.isSignedInReader()&&this.options.appApi.networkConnectivityApi.isOnline()?this.options.rootView.off("all",this._onViewEvent):this.options.rootView.on("all",this._onViewEvent),this._deferred=e,e.promise()},_onViewEvent:function(i,t){var s,n;return i===e.ViewEvents.SELECTION_COMMIT?void this.options.selectionUiModel.commitSelection():(s=this._eventMap[i],s&&(n=s[0].create(s[1],t)),void(n&&n.run(i,t).then(function(){return void 0},function(){return void 0})))},_mapEvent:function(e,i,t,s,n){e[i]=[t,s,n]},_initEventMap:function(){var t,s,n,o,a,l;t=this._eventMap={},s=this._mapEvent,n=i.ViewEvents,a=i.opFactory,l=e.opFactory,o=e.ViewEvents,s(t,o.SELECTION_ACTION_ITEM_CLICK,l,"SelectingSelectionActionItemOp"),s(t,o.SELECT_ITEM,l,"SelectingCollectionItemOp"),s(t,o.CLEAR_SELECTION,l,"ClearingSelectionOp"),s(t,o.OPEN_COLLECTION_ITEM,a,"OpeningCollectionItemOp"),s(t,o.OPEN_SELECTED_COLLECTION_ITEMS,a,"OpeningSelectedCollectionItemsOp"),s(t,o.CONTEXT_BOARD_PRIMARY_TOOLS_CLICK,l,"ContextBoardPrimaryToolsClickAppOp"),s(t,o.CONTEXT_BOARD_PRIMARY_TOOLS_CLICK_REDUCEDMODE,l,"ContextBoardPrimaryToolsClickReducedModeAppOp"),s(t,o.F6_KEY_PRESSED,l,"F6KeyPressHandlerOp")}})}),define("acplugins/my-recent-files/js/ops/plugin/starting-plugin-op",["core/ac-core","acplugins/my-recent-files/js/ac-my-recent-files","core/utils/date-util","core/ops/op"],function(e,i,t){i.StartingPluginOp=e.Op.extend({run:function(){var i=this.options,s=e.SearchUiModel,n=i.searchUiModel,o=e.SortUiModel,a=i.sortUiModel;return n.set("pagesize",50),i.noUrlUpdate||n.set("route","recent"),n.addFieldQuery({field:s.FIELD_DATE_LAST_ACCESS,value:t.ALL_TIME,commitQueryBox:!1,queryBoxVisible:!1,removable:!1,id:"my-recent-files-base"},{silent:!0}),a.setOrder(o.ORDER_BY_DATE_LAST_ACCESS,o.ORDER_DESCENDING),a.set("is_locked",!0),this._getResolvedPromise()}})}),define("acplugins/my-recent-files/js/ops/plugin/fetching-rna-recent-files-op",["core/ac-core","acplugins/my-recent-files/js/ac-my-recent-files","core/ops/op"],function(e,i){i.FetchingRNARecentFileList=e.Op.extend({run:function(){var t=$.Deferred();return this.options.appApi.rnaApi.done(_.bind(function(s){s.rnaRecentFilesAPI.fetchRecentFileListApi().done(_.bind(function(s){!_.isUndefined(s)&&s.length?(this._items=e.collectionFactory.create("Collection",void 0,{model:i.LocalItemModel}),this._parseFiles(s),this.options.folderModel.set({items:this._items})):this.options.noFilesInRecents=!0,t.resolve()},this))},this)),t},_parseFiles:function(e){var i={members:[]},t=this._items,s=t?t.model:null;if(s){var n,o=0;_.each(e,function(e){n=e,o=e.recentIndex,i.members.push(new s({index:o},{_proxy:n}))})}this._parse(i)},_parse:function(e){var i=this._items,t=e.members;return i.set(t,{silent:!0,fromODM:!0}),i.trigger("add"),e}})}),define("acplugins/my-recent-files/js/ops/op-factory",["core/ac-core","acplugins/my-recent-files/js/ac-my-recent-files","acplugins/my-recent-files/js/ops/listening/listening-for-view-events-op","acplugins/my-recent-files/js/ops/plugin/starting-plugin-op","acplugins/my-recent-files/js/ops/plugin/fetching-rna-recent-files-op"],function(e,i){i.OpFactory=e.Op.extend({create:function(e,t){var s=i[e];return s?new s(t):void LOG(0,"AcMyRecentFiles.OpFactory.create: Unrecognized class: "+e)}})}),define("acplugins/my-recent-files/js/models/recent-local-item-model",["core/ac-core","acplugins/my-recent-files/js/ac-my-recent-files","core/utils/util","core/utils/file-types","core/collections/rna/rna-collection","core/models/rna/rna-model"],function(e,i,t,s){return i.LocalItemModel=e.RNAModel.extend({initialize:function(i,n){this.models={list:e.RNACollection};var o=e.RNAModel.prototype.initialize.call(this,i,n),a=t.getExtension(this.get("name"))||"",l=s.getFileMimeType(a.toLowerCase());return l=l||null,this.set("content_type",l,{localAttr:!0}),this.set("object_type","file",{localAttr:!0}),this.set("last_access",this.get("modified"),{localAttr:!0}),this.set("fileURI",null,{localAttr:!0}),this.set("source","native",{localAttr:!0}),this.id=this.get("assetId"),this.isRecentFileItem=!0,""===this.id&&(this.id=this.get("path")),this.set("_proxy",this._proxy,{localAttr:!0}),o},get:function(i){if("items"===i)i="list";else if("id"===i)return this.id;return"fileURI"===i?void 0:e.RNAModel.prototype.get.call(this,i)},isSharedFile:function(){return"file"===this.get("object_type")&&this.get("is_shared")===!0},isCCFile:function(){return!1},isFolder:function(){return"folder"===this.get("object_type")},isRoot:function(){return"root"===this.get("object_type")},isFile:function(){return"file"===this.get("object_type")},getFolderItemsCount:function(){var e=this.get("items");return e?e.length:0},getSharingURL:function(){return""},getRenditionUrl:function(){return this._renditionUrl},setImageBlob:function(e){this.set("imgBlob",e,{localAttr:!0})},getRenameUrl:function(){return""},setRenditionUrl:function(e){this._renditionUrl=e},getPublicUrl:function(){return""},getPathUrl:function(){return void 0},isPublic:function(){return!1},isForm:function(){return!1},isNative:function(){var e=this.get("source");return"native"===e||"native_v2"===e},isPDF:function(){var e=this.get("content_type");return this.isFile()&&"application/pdf"===e}}),i.LocalItemModel}),define("pdmplugins/unified-share/js/ops/us-fetch-tool-center-selected-files",["core/ac-core","core/utils/file-types","pdmplugins/unified-share/js/ac-unified-share","i18n!pdmplugins/unified-share/js/nls/ui-strings","pdmplugins/unified-share/js/models/disallowed-file-model"],function(e,i,t,s){t.FetchToolCentreSelectedFiles=e.Op.extend({run:function(){this.fileFormats=[],this.mimeTypes=[],this.promises=[];var e=$.Deferred();return this.options.appApi.rnaApi.then(_.bind(function(i){return i.stApi.getUnifiedShareToolCenterPickedFileIdsAPI().then(_.bind(function(i,s){var n,o,a=this.options.sendFilesUiModel,l=i.localFiles,r=[],d=_.map(i.localFileInputs,function(e){return e[0]}),p=[],h=[],c=[],u=[],m=i.uploadedFileAttrs,E=(i.uploadedFileIds,a.get("limits_model"),a.get("metadata_collection").length+a.get("local_file_objects").length),g=E,S=99999;a.set("disallowed_files",[],{silent:!0}),_.each(m,_.bind(function(e){var i=new t.FileMetadataModel({assetId:e.get("assetId"),global:!1,name:e.get("name"),ext:"pdf"});a.addFileObjects(i),E+=1},this)),l.length>0?_.each(l,_.bind(function(e){var i;S>E?(_.isUndefined(e.get("path"))||"\\\\www.adobe.com\\go\\homeacrordrunified18_2018"!==e.get("path")&&"http://www.adobe.com/go/homeacrordrunified18_2018"!==e.get("path"))&&_.isEmpty(e.get("ext"))?this.showError():(E+=1,r.push(e)):(i=new t.DisallowedFileModel({name:e.name,reason:"over-limit"}),h.push(i))},this)):d.length>0&&_.each(d,_.bind(function(e){var i;S>E?_.isEmpty(e.get("ext"))?this.showError():(E+=1,r.push(e)):i=new t.DisallowedFileModel({name:e.value,reason:"over-limit"}),i&&h.push(i)},this)),r&&_.each(r,_.bind(function(e){n=e.invoke("determineFileSource"),n.then(_.bind(function(i){if("root"===i||"unsupported"===i||"local"===i||"desktop_sharepoint"===i||"native"===i||"native_v2"===i)p.push(e);else if("box"===i||"dropbox"===i||"onedrive"===i||"onedrivebusiness"===i||"googleDrive"===i)p.push(e),c.push(e);else{var s;s=new t.DisallowedFileModel({name:e.get("name"),source:i,reason:"non-native"}),h.push(s)}},this),_.bind(function(){p.push(e)},this)),this.promises.push(n)},this)),m&&_.each(m,_.bind(function(e){o=e.invoke("determineFileSource"),o.then(_.bind(function(i){"ccloud"===i&&u.push(e)},this)),this.promises.push(o)},this)),$.when.apply($,this.promises).always(_.bind(function(){a.addFileObjects(p),a.addConnectorFileObjects(c),a.addCCloudFileObjects(u),(l.length>0||d.length>0)&&(h=h.concat(a.get("disallowed_files")),a.set("disallowed_files",h)),E>0||g>0?e.resolve(s):e.reject()},this))},this),_.bind(function(){return e.reject().promise()},this))},this),_.bind(function(){return e.reject().promise()},this)),e.promise()},showError:function(){var e=this.options.appApi.dialogApi;e.displayTextAlert(e.SEVERITY_ERROR,s.ADD_FILES_REJECTED_TITLE,s.ADD_FILES_REJECTED_MESSAGE)}})}),define("pdmplugins/unified-share/js/views/us-file-list-view",["core/ac-core","files/ac-files","pdmplugins/unified-share/js/ac-unified-share","pdmplugins/unified-share/js/templates/us-file-list-template","pdmplugins/unified-share/js/templates/us-file-list-item-template","i18n!pdmplugins/unified-share/js/nls/ui-strings","pdmplugins/unified-share/js/utils/sc-constants","core/utils/file-types","core/utils/truncate","core/utils/crypto-util","acplugins/my-recent-files/js/ac-my-recent-files","acplugins/my-recent-files/js/ops/op-factory","acplugins/my-recent-files/js/models/recent-local-item-model","core/views/plugin-content-view","pdmplugins/unified-share/js/ops/desktop-add-files-op","pdmplugins/unified-share/js/ops/close-app-op","pdmplugins/unified-share/js/ops/us-fetch-tool-center-selected-files"],function(e,i,t,s,n,o,a,l,r,d,p){return t.UniShareFileListView=e.View.extend({events:{"click .share-add-more-files":"_onAddMoreClick","click .us-share-file-list-close":"_onRemoveAssetClick"},initialize:function(){e.View.prototype.initialize.call(this),_.bind(this.render,this),this._template=_.template(s),this._itemTemplate=_.template(n),this._initView()},render:function(){this.$el,this.options.sendFilesUiModel;e.View.prototype.render.call(this),console.log("inside render of uniShareFileListView"),0===this.$el.children().length&&(this.$el.append(this._template({SELECTED_FILES:o.SELECTED_FILES,ADD_MORE_FILES:o.ADD_MORE_FILES,SHARE_NO_FILES_SELECTED:o.SHARE_NO_FILES_SELECTED,SHARE_CLICK_TO_ADD_FILES:o.SHARE_CLICK_TO_ADD_FILES})),this._initWrappers(),this._fetchDocument()),e.Util.isCEF()&&this.$(".share-tool-frame").addClass("unselectable"),!t.QueryParams||"SharePopup_RequestSignatures"!==t.QueryParams.shareVariant&&"SharePopup_RequestSignatures_Disclosed"!==t.QueryParams.shareVariant||"attachToEmail"!==t.QueryParams.launchApp||"attachToEmail"!==this.options.sendFilesUiModel.get("US_tab_open")||(this.$(".us-share-file-list-name").css("margin-left","0px"),this.$(".us-share-file-list-item").css("line-height","0px"),this.$(".share-add-more-files").css("display","none")),this._renderChildViews()
},_initView:function(){this._addUiModelEventListeners();var e=this.options.sendFilesUiModel.get("ShareVariant"),i=a.DISCOVER,t="Open Share Panel";this.options.appApi.siteCatalystApi.logScEvent([e,i,t])},_fetchDocument:function(){console.log("inside fetch document");var i,t,s,n=this.options;return this._uiModel=n.sendFilesUiModel,i=this._startPlugin(),e.Util.isCEF()?(this._activeView=void 0,this.options.readRegistry=!0,t=this._fetchActiveDocument(),this._uiModel.set("fetchDocPromise",t),console.log("Setting fetchDocPromise to"+this._uiModel.get("fetchDocPromise"))):(this._activeView=this._uiModel.get("active_view"),t=$.Deferred().resolve().promise()),t.then(_.bind(function(){return s=this._activeView,i.then(_.bind(function(){var i=e.Features.getFeature("enable_sender_survey"),t=this._uiModel.get("limits_model"),s=t.get("can_custom_brand"),n=this.options.brandingModel.get("enabled"),o=!1,a=this.options.appApi.usersMeApi.getUserCohorts();a&&"enabled"===a["ts-sender-survey"]&&(o=!0),e.Util.isCEF()&&(n=!1),this._uiModel.set({active:!0,user_action_id:d.getRandomString(),user_action_name:"Share:ShareButton",customize_recipient_page:n,customize_recipient_page_enabled:s,enable_sender_survey:i&&o})},this))},this))},_fetchActiveDocument:function(){console.log("fetch active document");var i,s,n,o,a,l,r,d,h,c,u=(t.selector.routerArgs,$.Deferred()),m=this.options.recentFolderModel;return this.options.appApi.rnaApi.then(_.bind(function(E){if(i=E.stApi.getSendTrackAppLauncherWithParcel(),d=E.stApi.getSendTrackAppLauncherWithAssets(),h=E.stApi.getSendTrackAppLauncherWithModels(),d)this.options.appApi.displayApi.showSpinner(!0),r=JSON.parse(d),l=$.map(r,function(e){return e}),this._activeView="workflow",this.options.appApi.sessionApi.ensureSignedIn().then(_.bind(function(){t.opFactory.create("DesktopGettingSubscriptionLevels",this.options).run().always(_.bind(function(){this._uiModel.addFilesToCollection(l),this.options.appApi.displayApi.showSpinner(!1),u.resolve().promise()},this))},this),_.bind(function(){this.options.appApi.displayApi.showSpinner(!1)},this));else if(h)this.options.appApi.displayApi.showSpinner(!0),this._activeView="workflow",h.length>0&&(_.each(h,function(i){c=new e.LocalItemModel(void 0,{_proxy:i._proxy}),b.push(c)}),this._uiModel.addFileObjects(b),u.resolve().promise()),this.options.appApi.displayApi.showSpinner(!1);else if(i)this.options.appApi.displayApi.showSpinner(!0),this._activeView="workflow",this.options.appApi.sessionApi.ensureSignedIn().then(_.bind(function(){s=this.options.appApi.baseFilesUrisApi.getSendApiUri(),s=tsUtils.extractRootUrl(s),this.options.rootUrl=s,this.options.appApi.displayApi.showSpinner(!1),this._gettingAuthenticatedModelsPromise.then(_.bind(function(){o=this.options.rootUrl,a=new t.AddParcelOp({uiModel:this._uiModel,parcelId:i,rootUrl:o}),t.opFactory.create("DesktopGettingSubscriptionLevels",this.options).run().always(_.bind(function(){a.run()},this)),u.resolve().promise()},this))},this),_.bind(function(){this.options.appApi.displayApi.showSpinner(!1)},this));else if(console.log(" launching app :  "+this._uiModel.get("launchpad")),"shareButton"===this._uiModel.get("launchpad")||"HomeRecent"===this._uiModel.get("launchpad")&&"onlyRHP"===this._uiModel.get("layout"))n=E.getOpenedFile(),_.isEmpty(n)?(this._activeView="welcome",u.resolve().promise()):(this._activeView="workflow",this.options.appApi.rnaApi.done(_.bind(function(e){n.invoke("determineFileSource").then(_.bind(function(e){if("root"===e||"unsupported"===e||"local"===e||"desktop_sharepoint"===e||"native"===e||"native_v2"===e)console.log("add file objects"),this._uiModel.addFileObjects(n);else if("box"===e||"dropbox"===e||"onedrive"===e||"onedrivebusiness"===e||"googleDrive"===e)this._uiModel.addFileObjects(n),this._uiModel.addConnectorFileObjects(n);else if("ccloud"==e)this._uiModel.addFileObjects(n),this._uiModel.addCCloudFileObjects(n);else{var i,s=[];i=new t.DisallowedFileModel({name:n.get("name"),source:e,reason:"non-native"}),s.push(i),this._uiModel.set("disallowed_files",s,{silent:!1})}},this),_.bind(function(){this._uiModel.addFileObjects(n)},this)),this.options.sendFilesUiModel.set("openedFileAssetId",n.get("assetId")),this._isDirty(n,e).then(_.bind(function(){this.options.sendFilesUiModel.set("bHFileIsDirty",!1),u.resolve().promise()},this),_.bind(function(){this.options.sendFilesUiModel.set("bHFileIsDirty",!0),u.resolve().promise()},this)),n.on("change:name",_.bind(function(e,i){var t=i;this.options.sendFilesUiModel.updateOpenedFile(e),this.options.sendFilesUiModel.get("is_subject_user_input")||this._setOpenedDocNameAsSubject(t,!0)},this))},this)));else if("HomeRecent"===this._uiModel.get("launchpad")&&"contentPlusRHP"===this._uiModel.get("layout")){var g=E.stApi.getSelectedFileIndicesAPI(),S=g.split(",").map(Number),f=(new p.OpFactory).create("FetchingRNARecentFileList",_.extend(this.options,{folderModel:m}));f.run().then(_.bind(function(){for(var e,i=0;i<S.length;i++)e=this.options.folderModel.get("items").models[S[i]-1],this._uiModel.addFileObjects(e),e.invoke("determineFileSource").then(_.bind(function(i){"box"===i||"dropbox"===i||"onedrive"===i||"onedrivebusiness"===i||"googleDrive"===i?this._uiModel.addConnectorFileObjects(e):"ccloud"===i&&this._uiModel.addCCloudFileObjects(e)},this)),u.resolve().promise()},this))}else if("HomeDC"===this._uiModel.get("launchpad")){var A=this._uiModel;this.options.appApi.rnaApi.done(_.bind(function(e){e.stApi.readUnifiedShareLaunchingInfoAPI().then(_.bind(function(e){for(var i=0;i<e.length;i++){var s=new t.FileMetadataModel({assetId:e[i].id,global:!1,name:e[i].name,ext:"pdf"});A.addFileObjects(s)}u.resolve().promise()},this),_.bind(function(){return $.Deferred().reject().promise()},this))},this))}else if("HomeConnector"===this._uiModel.get("launchpad")){var v,R,b=[];this.options.appApi.rnaApi.done(_.bind(function(i){v=i.stApi.UnifiedShareLauncherSelectedProxyIds(),v.length>0&&(_.each(v.models,_.bind(function(i){R=new e.LocalItemModel(void 0,{_proxy:i._proxy}),b.push(R),R.invoke("determineFileSource").then(_.bind(function(e){("box"===e||"dropbox"===e||"onedrive"===e||"onedrivebusiness"===e||"googleDrive"===e)&&this._uiModel.addConnectorFileObjects(R)},this))},this)),this._uiModel.addFileObjects(b),u.resolve().promise())},this))}else if("toolCentre"===this._uiModel.get("launchpad")){var I=new t.FetchToolCentreSelectedFiles(this.options);I.run().then(_.bind(function(){u.resolve().promise();var e=this.$(".us-share-file-list-item").last().offset().top;this.$filesList.scrollTop(e)},this))}},this)),u.promise()},_isDirty:function(e,i){return i.rnaServicesAPI.isDirtyApi(e._proxy).then(_.bind(function(e){return e?$.Deferred().reject().promise():$.Deferred().resolve().promise()},this),_.bind(function(){return $.Deferred().reject().promise()},this))},_startPlugin:function(){var i=this.options,s=this._gettingAuthenticatedModelsPromise;return s||(s=this._gettingAuthenticatedModelsPromise=!e.Util.isCEF()&&i.appApi.sessionApi.isSignedIn()?t.opFactory.create("GettingAuthenticatedModelsOp",i).run():this._getResolvedPromise()),s},_addUiModelEventListeners:function(){var e=this.options.sendFilesUiModel;e.on("change:local_file_objects",this._onFilesChange),e.get("metadata_collection").on("all",this._onFilesChange),e.on("change:resetFileList",this._onResetFilesList),e.on("change:enable_add_files",this._setAddFilesState),e.on("change:US_tab_open",this._onUsTabChanged),e.on("change:cl_active_view",this._handleFileListCrossVisibility),e.on("change:ccloud_file_objects",this._onCCloudFilesChange)},_onFilesChange:function(){var e=this.options.sendFilesUiModel,i=e.get("US_tab_open"),t=e.get("cl_active_view"),s=e.get("local_file_objects").length+e.get("metadata_collection").length;"createLink"!==i&&"complete"===t&&(this.options.sendFilesUiModel.resetClSubAndMsg(),e.set("cl_active_view","welcome")),this.render(),"contentPlusRHP"===e.get("layout")&&this.options.appApi.rnaApi.then(_.bind(function(e){e.stApi.updateSelectedFileCount(s)},this))},_onUsTabChanged:function(){this._handleFileListCrossVisibility()},_handleFileListCrossVisibility:function(){var e=this.options.sendFilesUiModel,i=e.get("US_tab_open"),t=e.get("cl_active_view");"createLink"===i&&"complete"===t?this.$(".us-share-file-list-close").hide():this.$(".us-share-file-list-close").show()},_onCCloudFilesChange:function(){var e=this.options.sendFilesUiModel,i=e.get("ccloud_file_objects").length;i&&this._showCCloudFileError()},_showCCloudFileError:function(){return this.options.appApi.dialogApi.displayTextAlert(this.options.appApi.dialogApi.SEVERITY_ERROR,o.CONNECTOR_FILE_ERROR_TITLE,o.CONNECTOR_FILE_ERROR_MSG)},_onResetFilesList:function(){this.options.sendFilesUiModel.get("resetFileList")&&(this.options.sendFilesUiModel.set("resetFileList",!1,{silent:!0}),this.options.sendFilesUiModel.resetFileListModel(),this._fetchDocument(),this._onFilesChange())},_initWrappers:function(){console.log("initWrappers"),this.$body=$("body"),this.$shareToolFrame=this.$(".share-tool-frame"),this.$filesList=this.$(".us-share-files-list"),this.$emptyFilesList=this.$(".share-files-list-empty"),this.$addMoreFilesBtn=this.$(".share-add-more-files"),this.$addressHeading=this.$(".share-address-heading"),this.$addressList=this.$(".us-share-address-input"),this.$subjectHeading=this.$(".share-subject-heading"),this.$sendToHeading=this.$(".share-send-to-heading"),this.$subjectInput=this.$(".us-share-subject-input"),this.$messageHeading=this.$(".share-message-heading"),this.$messageInput=this.$(".us-share-message-input"),this.$shareButton=this.$(".share-files-button"),this.$cancelButton=this.$(".share-cancel"),this.$shareFileListClose=this.$(".us-share-file-list-close")},_onListItemMouseEnter:function(){console.log(" height is : "+this.$(".us-share-file-list-name").css("width")),this.$(".us-share-file-list-close").css("display","inline-block")},_onListItemMouseLeave:function(){this.$(".us-share-file-list-close").css("display","none")},_renderChildViews:function(){this._renderFileList()},_onRemoveAssetClick:function(e){var i,t,s,n=$(e.target),o=this.options.sendFilesUiModel,a=o.get("metadata_collection"),l=_.clone(o.get("local_file_objects")),r=_.clone(o.get("connector_file_objects")),d=_.clone(o.get("ccloud_file_objects"));i=n.data("asset-id"),i?(s=a.get(i),a.remove(s)):(t=n.data("list-index"),s=l.splice(t,1),r=o.removeFileObjects(s,r),d=o.removeFileObjects(s,d),o.set("connector_file_objects",r),o.set("ccloud_file_objects",d),o.set("local_file_objects",l))},_setAddFilesState:function(){var e=this.options.sendFilesUiModel,i=!e.get("enable_add_files");i?this.$addMoreFilesBtn.hide():this.$addMoreFilesBtn.show(),this.$addMoreFilesBtn.prop("disabled",i),"attachToEmail"===e.get("US_tab_open")?this.$addMoreFilesBtn.attr("title",""):this.$addMoreFilesBtn.attr("title",i?o.ERROR_MULTIPLE_FILES_REVIEW1:o.ADD_MORE_FILES)},_onAddMoreClick:function(){var i,s,n=this.options.appApi.selectionApi,o=this.options.sendFilesUiModel,l=this.options.appApi,r=this.options.sendFilesUiModel.get("ShareVariant"),d=a.USE,p="Add Files";this.options.appApi.siteCatalystApi.logScEvent([r,d,p]),i=_.extend({},this.options,{uiModel:o,selectionApi:n,appApi:l}),e.Util.isCEF()&&(s=new t.DesktopAddFilesOp(i)),s.run().then(_.bind(function(){var e=this.$(".us-share-file-list-item").last().offset().top;this.$filesList.scrollTop(e)},this))},_renderFileList:function(){var i,t,s=this.$filesList,n=(this.$emptyFilesList,this.options.sendFilesUiModel),a=n.get("local_file_objects"),d=n.get("metadata_collection"),p=n.get("enable_form_send"),h=(n.get("direct_to_workflow"),n.get("view_mode"),!0),c=this._computeMaxAvailWidth();s.empty(),n.set("us_subject_text",""),_.each(a,function(i,t){var n,a,l,r,d,p=Object.prototype.toString.call(i);"[object File]"===p?(n=i.name,l=this._getFileObjIconClass(i)):e.Util.isCEF()&&"[object Object]"===p?(n=i.get("name"),l=this._getFileObjIconClass(i),r=this._getFileObjIconDesc(i)):(n=i.value.replace(/^.*(\\|\/|\:)/,""),l=this._getFileInputIconClass(n),r=this._getFileInputIconDesc(n)),n&&(a=n,n=_.escape(n)),d=this._itemTemplate({icon_class:l,icon_desc:r,name:n,asset_id:"",list_index:t,remove:o.SHARE_REMOVE,ariaRemoveLabel:this._getRemoveAriaLabel(n)}),n&&(s.append(d),this._setOpenedDocNameAsSubject(a,!1))},this),d.each(_.bind(function(e){var i=e.get("name");p&&l.isFormMimeType(e.get("content_type"))&&(i=i.substring(0,i.length-5)+".pdf");var t=this._itemTemplate({icon_class:this._getIconClass(e),icon_desc:this._getIconDesc(e),name:i,asset_id:e.get("id"),list_index:"",remove:o.SHARE_REMOVE,ariaRemoveLabel:this._getRemoveAriaLabel(i)});e.get("name")&&(s.append(t),this._setOpenedDocNameAsSubject(i,!1))},this)),("onlyRHP"===n.get("layout")||d.length+a.length==1)&&(this.$(".us-share-file-list-item").first().children("button").remove(),h=!1),_.each(this.$(".us-share-file-list-name"),function(e){i=$(e),r.truncateElementText(i,c)}),t=h?c-this.$addMoreFilesBtn.width()-10:c-this.$addMoreFilesBtn.width(),r.truncateElementText(this.$(".us-share-file-list-name").first(),t),this.$(".us-share-file-list-name").first().removeAttr("title")},_setOpenedDocNameAsSubject:function(e,i){var t=this.options.sendFilesUiModel;if(i||!t.get("us_subject_text")){var s=e.substring(0,e.lastIndexOf("."));s=s?s:e,t.set("us_subject_text",s),t.set("cl_subject_text",s)}},_removeExtn:function(e){var i=e.text();i.replace(/pdf/gi,""),e.text(i)},_getRemoveAriaLabel:function(e){return _.template(o.GENERIC_ARIA_LABEL_STRING,{prefix:e,suffix:o.SHARE_REMOVE})},_getIconDesc:function(e){var i,t=l.getFileInfo(e.get("content_type"),e.get("name"));return i=t.desc||""},_getIconClass:function(i){var t,s,n;return t=e.Util.isCEF()?l.getFileMimeType(e.Util.getExtension(i.get("name"))):i.get("content_type"),n=l.getFileInfo(t,i.get("name")),s=n.iconCls||""},_getFileObjIconClass:function(i){var t,s,n,o;return e.Util.isCEF()?(t=l.getFileMimeType(e.Util.getExtension(i.get("name"))),s=i.get("name")):(t=i.type,s=i.name),o=l.getFileInfo(t,s),n=o.iconCls||""},_getFileObjIconDesc:function(i){var t,s,n,o;return e.Util.isCEF()?(t=l.getFileMimeType(e.Util.getExtension(i.get("name"))),s=i.get("name")):(t=i.type,s=i.name),o=l.getFileInfo(t,s),n=o.desc||""},_getFileInputIconClass:function(e){var i,t=l.getFileInfo("",e);return i=t.iconCls||""},_getFileInputIconDesc:function(e){var i,t=l.getFileInfo("",e);return i=t.desc||""},_computeMaxAvailWidth:function(){var e=this.$(".us-share-file-list-item").width(),i=this.$(".us-share-file-list-name").outerWidth(!0)-this.$(".us-share-file-list-name").outerWidth();return e-3.5*i}}),t.UniShareFileListView}),define("pdmplugins/unified-share/js/models/ui/selector-ui-model",["core/ac-core","pdmplugins/unified-share/js/ac-unified-share","core/models/ui/ui-model"],function(e,i){i.SelectorUiModel=e.UiModel.extend({recognized:{selectors:{type:"array",optional:!1},selected_selector_id:{type:"number",optional:!1}},defaults:{selectors:[],selected_selector_id:-1}})}),define("pdmplugins/unified-share/js/templates/us-tab-container-template",[],function(){return'<button class="us-tab theme-text" id="share-tab" aria-label="<%= share_tab_head %>"><%= share_tab_head %></button><button class="us-tab theme-text" id="create-link-tab" aria-label="<%= create_link_tab_head %>"><%= create_link_tab_head %></button>'}),define("pdmplugins/unified-share/js/templates/us-share-tab-view-template",[],function(){return'<div id = "us-share-tab-view-container">   <div id= "email-address-template-container" class ="ui-theme theme-share-container"></div>   <div id= "image-placeholder-box" class ="ui-theme theme-share-container">       <button id="place-holder-img-send" tabindex="-1"/>       <button id="place-holder-img-review" tabindex="-1"/>       <button id="place-holder-img-sign" tabindex="-1"/>       <div id= "place-holder-text" class="ui-theme theme-text" aria-label = "<%= PLACE_HOLDER_TEXT %>"><%= PLACE_HOLDER_TEXT %></div>    </div>   <div class="share-button-bar ui-theme theme-share-container">       <button class= "share-more-options ui-theme theme-share-add-files theme-share-container hidden" tabindex="0"                    aria-label ="<%= MORE_OPTIONS_TOOLTIP %>" title="<%= MORE_OPTIONS_TOOLTIP %>"><%= MORE_OPTIONS %></button>       <button class="share-files-button control-button theme-button theme-button-label"            aria-describedby="share-files-button" aria-label="<%= SEND_INVITATIONS %>"><%= SHARE_BUTTON %></button>       <button class = "ui-theme theme-text" id= "close-share-button"><%= SHARE_CLOSE %></button>   </div></div>'}),define("pdmplugins/unified-share/js/ops/update-dirty-doc-state-op",["core/ac-core","pdmplugins/unified-share/js/ac-unified-share"],function(e,i){i.UpdateDirtyDocState=e.Op.extend({run:function(){var e,i=$.Deferred(),t=this.options.sendFilesUiModel;return this.options.appApi.rnaApi.then(_.bind(function(s){"shareButton"===t.get("launchpad")||"HomeRecent"===t.get("launchpad")&&"onlyRHP"===t.get("layout")?(e=s.getOpenedFile(),this._isDirty(e,s).then(_.bind(function(){t.set("bHFileIsDirty",!1),i.resolve().promise()},this),_.bind(function(){t.set("bHFileIsDirty",!0),i.resolve().promise()},this))):(t.set("bHFileIsDirty",!1),i.resolve().promise())},this)),i},_isDirty:function(e,i){return i.rnaServicesAPI.isDirtyApi(e._proxy).then(_.bind(function(e){return e?$.Deferred().reject().promise():$.Deferred().resolve().promise()},this),_.bind(function(){return $.Deferred().reject().promise()},this))}})}),define("pdmplugins/unified-share/js/templates/us-email-addr-view-template",[],function(){return'<div class="us-share-address-box ui-theme theme-share-input-container theme-share-border theme-share-input-text"></div><div class="us-share-autocomplete-box-parent ui-theme theme-share-container"><div class="us-share-autocomplete-box ui-theme theme-share-border theme-share-container theme-text"></div></div><div id="share-user-advisory-message" class="ui-theme theme-text"><%= USER_ADVISORY_MSG %></div><div class = "theme-share-container" id="added-members-list-container">    <div class = "share-tool-frame theme-share-container">       <ul class="share-email-list" role="grid" aria-labelledby="share-heading"></ul>    </div></div><div id="us-mode-selector" class ="ui-theme theme-share-container mode-selector"></div><div><div id="us-share-subject-title" class="ui-theme theme-text"><%= SUBJECT_TITLE %></div><input type="text" maxlength="1000" class="us-share-subject-input ui-theme theme-share-container theme-share-input-text theme-share-border" aria-label = "<%= SHARE_INITIAL_SUBJECT_ARIA_LABEL %>" id="us-share-subject-input"/><div id="us-share-message-title" class="ui-theme theme-text"><%= MESSAGE_TITLE %></div><textarea autoresize type="text" maxlength="1000" class="us-share-message-input ui-theme theme-share-container theme-share-input-text theme-share-border" id="us-share-message-input" aria-label="<%= SHARE_MESSAGE_HEADING_ARIA_LABEL %>"placeholder = "<%= SHARE_MESSAGE_PROMPT_PLACEHOLDER %>"><%= SHARE_MESSAGE_PROMPT %></textarea></div><div id="deadline-selector-container" class ="ui-theme theme-share-container"></div>'}),define("pdmplugins/unified-share/js/templates/us-email-list-item-template",[],function(){return' <li class="share-email-list-item-container ui-theme theme-share-container">   <div class="share-email-list-item  theme-hoverable ui-theme theme-share-container" title="<%= email %>">       <div class="share-email-list-name theme-text" tabindex="-1"><%= name %></div>       <div           aria-labelledby="share-email-list-name">           <button class="share-email-list-close core-remove-x"                title="<%= remove %>" tabindex="0"                 data-asset-id="<%= asset_id %>"                aria-label="<%= ariaRemoveLabel %>"></button>       </div>   </div></li> '}),define("pdmplugins/unified-share/js/templates/us-chicklet-edit-template",[],function(){return' <div class="us-share-address-input-container">    <button id="search-email-img" tabindex="-1"/>    <input type="text" class="us-share-address-input ui-theme theme-share-input-container theme-share-input-text"           placeholder="<%= SHARE_ADDRESS_PROMPT %>"           id="us-share-address-input"           aria-autocomplete="list"           aria-label="<%= SHARE_ADDRESS_PROMPT %>"           aria-owns="us-share-auto-c-list" autocomplete="false" />   <button class="us-share-address-book" aria-label ="<%= ADDRESS_BOOK_LABEL %>" title="<%= ADDRESS_BOOK %>"        aria-describedby="us-share-address-book" id="address-book-img"/></div> '}),define("pdmplugins/unified-share/js/views/us-chicklet-edit-control",["core/ac-core","core/utils/view-util","pdmplugins/unified-share/js/ac-unified-share","pdmplugins/unified-share/js/templates/us-chicklet-edit-template","i18n!pdmplugins/unified-share/js/nls/ui-strings","pdmplugins/unified-share/js/ops/get-from-addressbook-op","pdmplugins/unified-share/js/utils/sc-constants","core/views/input-placeholder-view"],function(e,i,t,s,n,o,a){return t.ChickletEditControl=e.View.extend({events:{"focus .us-share-address-input":"_onInputFocus","blur .us-share-address-input":"_onInputBlur","click .us-share-address-book":"_onAddressBookClick"},initialize:function(){e.View.prototype.initialize.call(this),this._template=_.template(s)},render:function(){e.View.prototype.render.call(this),0===this.$el.children().length&&(this.$el.html(this._template({SHARE_ADDRESS_PROMPT:n.SHARE_ADDRESS_PROMPT,SHARE_INDIVIDUAL_HELP:n.SHARE_INDIVIDUAL_HELP,ADDRESS_BOOK:n.ADDRESS_BOOK,ADDRESS_BOOK_LABEL:n.ADDRESS_BOOK_LABEL})),this._initWrappers()),this._renderChildViews()},val:function(){return this.$input.val()||""},hasText:function(){return this._input.hasText()},setValue:function(e){this.$input.val(e)},enable:function(e){e?(this.$input.removeAttr("disabled"),this.$inputMask.hide()):(this.$input.attr({disabled:"disabled"}),this.$inputMask.show())},focus:function(e){var t=this.$input.is(":disabled");t&&(e=!1),i.descendantHasFocus(".share-individual:checked,.share-email-chicklet,.us-share-address-input,.share-address-help-msg-close")||(e=!1),this._isFocus=e,this.$input.focus()},clear:function(){this.$input.val("")},processRecipients:function(e){var i,t;this.markChickletsToRemove(i),this.removeMarkedChicklets(i),this.focus(!0),this._input.enablePrompt(!0).render(),t=e.findWhere({valid:!1})},markChickletsToRemove:function(e){_.each(e,_.bind(function(e){e.options.toRemove=!0},this))},removeMarkedChicklets:function(e){_.each(e,_.bind(function(e){e.options.toRemove&&this.removeChildView(e)},this))},_initWrappers:function(){this.$inputContainer=this.$(".us-share-address-input-container"),this.$input=this.$(".us-share-address-input"),this.$inputMask=this.$(".share-address-input-mask")},_renderChildViews:function(){this._renderChildView("_input",e.InputPlaceholderView,this.$input)},_onInputFocus:function(){this.$el.addClass("focus")},_onInputBlur:function(){this.$el.removeClass("focus")},_onAddressBookClick:function(){var e,i,t,s=this.options.sendFilesUiModel.get("ShareVariant"),n=a.USE,l="Select Address Book";this.options.appApi.siteCatalystApi.logScEvent([s,n,l]),t=_.extend({},this.options),i=new o(t),e=i.run(),e.then(_.bind(function(e){this.options.emailView._setRecipientsFromText(e)},this),_.bind(function(){},this))}}),t.ChickletEditControl}),define("pdmplugins/unified-share/js/templates/us-autocomplete-template",[],function(){return' <div class="us-share-auto-c-list"     role="listbox" id="us-share-auto-c-list"></div><div class="us-ms-graph-get-contacts-banner ui-theme theme-list-item theme-share-container">   <button id="us-get-ms-graph-contacts-message" class= "ui-theme theme-share-add-files" tabindex="0" aria-label ="<%= GET_MS_GRAPH_CONTACTS_MSG %>" title="<%= GET_MS_GRAPH_CONTACTS_MSG %>"><%= GET_MS_GRAPH_CONTACTS_MSG %></button></div>'}),define("pdmplugins/unified-share/js/templates/us-autocomplete-item-template",[],function(){return'<div class="us-share-auto-address <%=specialClass%> ui-theme theme-list-item" aria-label = "<%-email %>" role="option" tabindex="-1" title="<%-email %>" name="<%-name%>"><div id="email-list-name" class= "ui-theme theme-text" title="<%-email %>" name="<%-name%>"><%-name%></div><div id="email-list-email" class= "ui-theme theme-text" title="<%-email %>" name="<%-name%>"><%-email%></div></div>'}),define("pdmplugins/unified-share/js/views/us-autocomplete-view",["core/ac-core","pdmplugins/unified-share/js/ac-unified-share","pdmplugins/unified-share/js/templates/us-autocomplete-template","pdmplugins/unified-share/js/templates/us-autocomplete-item-template","pdmplugins/unified-share/js/utils/sc-constants","i18n!pdmplugins/unified-share/js/nls/ui-strings"],function(e,i,t,s,n,o){return i.AutocompleteView=e.View.extend({events:{"mousedown .us-share-auto-address":"_onAddressClick","mousedown .us-ms-graph-get-contacts-banner":"_onGetMSGraphContactsClick"},initialize:function(){var i,n=this.options,o=n.autoCCollection;e.View.prototype.initialize.call(this),this._template=_.template(t),this._localAddressTemplate=_.template(s),this._addressTemplate=_.template("<div class='us-share-auto-address <%=specialClass%> ui-theme theme-list-item theme-hoverable'title='<%-email %>' role='option' tabindex='-1' aria-label ='<%-email %>' name='<%-name%>'><div id='email-list-email-only' class= 'ui-theme theme-text' title='<%-email %>' name='<%-name%>'><span title='<%-email %>'><%-email%></span></div></div>"),this._editControl=n.editControl,this.isMSGraphBannerInFocus=!1,i=new Backbone.Collection,this.filteredCollection=i,i.on("all",_.debounce(_.bind(this._onFilteredCChange,this),50)),o.on("all",_.debounce(_.bind(this._onCollectionChange,this),300))},render:function(){return e.View.prototype.render.call(this),0===this.$el.children().length&&(this.$el.html(this._template({GET_MS_GRAPH_CONTACTS_MSG:o.GET_MS_GRAPH_CONTACTS_MSG_1+"Office"+o.GET_MS_GRAPH_CONTACTS_MSG_2+"Outlook"+o.GET_MS_GRAPH_CONTACTS_MSG_3})),this._initWrappers(),this.$autoCList.on("scroll",this._onAddressScroll),this.$getMSGraphContacts.hide(),e.Util.isCEF()&&this.$autoCList.css("overflow","auto")),this._renderAddressList(),this},setFilter:function(e){e&&(e=$.trim(e.toLowerCase()),e.length<1&&(e=void 0)),e||(this.selectedID=void 0),this.fragment=e,this._updateFilteredCollection()},makeChoice:function(e){console.log("make choice");{var i,t,s;this.options,this.options.sendFilesUiModel}return this.isMSGraphBannerInFocus?this._onGetMSGraphContactsClick():(e?this.selectedID&&(i=this.filteredCollection.get(this.selectedID)):i=this.selectedID?this.filteredCollection.get(this.selectedID):this.filteredCollection.at(0),i&&(t=i.get("email"),s=i.get("name"),this._insertEmail(t,s),this._editControl.clear())),i},selectDown:function(){var i,t,s,n=this.filteredCollection,o=this.selectedID,a=this.$autoCList.scrollTop(),l=$(".us-share-auto-address").outerHeight(),r=6,d=6;e.Util.isCEF&&(r=n.length),s=this.options.sendFilesUiModel.get("enable_autoc_arrows"),s&&(o?(r>n.length&&(r=n.length),t=n.get(o),i=n.indexOf(t),-1===i?o=void 0:(r>i&&(i+=1,r>d&&this._keyboardScrollTo(a+l)),i>=r?(o=void 0,this.$getMSGraphContacts.is(":visible")&&!this.isMSGraphBannerInFocus&&(this.isMSGraphBannerInFocus=!0)):(t=n.at(i),o=t?t.id:void 0))):this.isMSGraphBannerInFocus?this.isMSGraphBannerInFocus=!1:(t=n.at(0),t?(o=t.id,this._keyboardScrollTo(0)):o=void 0),this.selectedID=o,this._renderAddressList())},selectUp:function(){var i,t,s,n=this.filteredCollection,o=this.selectedID,a=this.$autoCList.scrollTop(),l=6,r=6,d=$(".us-share-auto-address").outerHeight();e.Util.isCEF&&(l=n.length),s=this.options.sendFilesUiModel.get("enable_autoc_arrows"),s&&(o?(t=n.get(o),i=n.indexOf(t),-1===i?o=void 0:(i>=0&&(i-=1,l>r&&this._keyboardScrollTo(a-d)),0>i?o=void 0:(t=n.at(i),o=t?t.id:void 0))):this.$getMSGraphContacts.is(":visible")&&!this.isMSGraphBannerInFocus?(o=void 0,this.isMSGraphBannerInFocus=!0):(this.isMSGraphBannerInFocus=!1,l>n.length&&(l=n.length),l-=1,t=n.at(l),t?(o=t.id,l>=r&&this._keyboardScrollTo(l*d)):o=void 0),this.selectedID=o,this._renderAddressList())},_keyboardScrollTo:function(i){e.Util.isCEF()&&(this.$autoCList.stop(!0,!0),this.$autoCList.animate({scrollTop:i},1))},_initWrappers:function(){this.$autoCList=this.$(".us-share-auto-c-list"),this.$getMSGraphContacts=this.$(".us-ms-graph-get-contacts-banner")},_renderAddressList:function(){var e,i,t=this.filteredCollection,s=this.$autoCList,n=this.selectedID;e=this._localAddressTemplate,i=this._addressTemplate,t.length&&this.$el.show(),s.empty(),t.each(function(t){var o,a="";t.id===n&&(a="selected"),o=_.isUndefined(t.get("name"))||""===t.get("name")?i({email:t.get("email"),specialClass:a,id:_.uniqueId("us-share-auto-address-"),ariaSelected:""===a?"false":"true"}):e({name:t.get("name"),email:t.get("email"),specialClass:a,id:_.uniqueId("us-share-auto-address-"),ariaSelected:""===a?"false":"true"}),s.append(o)}),this._renderGetMSGraphBanner(),t.length||this.$el.hide()},_renderGetMSGraphBanner:function(){this.options.appApi.rnaApi.done(_.bind(function(e){e.rnaMicrosoftGraphAPI.isMicrosoftGraphEnabled().then(_.bind(function(){this.options.appApi.sessionApi.isSignedInReader()&&e.rnaMicrosoftGraphAPI.isSignedInMicrosoftGraph().then(_.bind(function(e){e?this.$getMSGraphContacts.hide():(this.$getMSGraphContacts.show(),this.isMSGraphBannerInFocus?this.$getMSGraphContacts.addClass("selected"):this.$getMSGraphContacts.removeClass("selected"))},this),_.bind(function(){this.$getMSGraphContacts.hide()},this))},this),_.bind(function(){this.$getMSGraphContacts.hide()},this))},this))},_updateFilteredCollection:function(){var e,i=this.options.autoCCollection,t=this.filteredCollection,s=[],n="",o="",a=!1,l=this.options.sendFilesUiModel.get("pgcSuggestionsCollection");return l&&i.add(l.toJSON(),{merge:!0}),e=this.fragment,e&&e.length&&(s=i.filter(function(i){if(o=i.get("email"),a=0===o.indexOf(e),a===!1&&(n=i.get("name"),void 0!==n&&(n=n.toLowerCase(),a=0===n.indexOf(e.toLowerCase()),a===!1)))for(var t=n.split(" "),s=0;s<t.length&&(a=0===t[s].indexOf(e.toLowerCase()),a!==!0);++s);return a})),t.set(s),s},_onFilteredCChange:function(){if(this.filteredCollection.length>0){var e=this.filteredCollection.at(0);this.selectedID=e.id,this.isMSGraphBannerInFocus=!1}this._renderAddressList()},_onCollectionChange:function(){this._renderAddressList()},_onAddressClick:function(e){var i,t,s=$(e.target),o=this.options,a=this.options.sendFilesUiModel;i=s.attr("title"),t=s.attr("name"),this._insertEmail(i,t),this._editControl.clear(),a.get("autocomplete_eventual_click")||(o.appApi.siteCatalystApi.logScEvent([n.TOOLS,this.options.sendFilesUiModel.get("ShareVariant"),n.EMAIL,n.AUTOCOMPLETE,n.EVENTUAL_CLICK]),a.set("autocomplete_eventual_click",!0),a.set("autocomplete_avoided",!0)),a.get("autocomplete_immediate_click")||(o.appApi.siteCatalystApi.logScEvent([n.TOOLS,this.options.sendFilesUiModel.get("ShareVariant"),n.EMAIL,n.AUTOCOMPLETE,n.IMMEDIATE_CLICK]),a.set("autocomplete_immediate_click",!0))},_onGetMSGraphContactsClick:function(){this.options.appApi.rnaApi.done(_.bind(function(i){var t=this.options.sendFilesUiModel.get("ShareVariant"),s=n.USE,o="Sign In to MSGraph";this.options.appApi.siteCatalystApi.logScEvent([t,s,o]),i.rnaMicrosoftGraphAPI.loginToMicrosoftGraph().then(_.bind(function(){var i=e.opFactory.create("MicrosoftGraphOutlookContactsOp",this.options),t=this.options.sendFilesUiModel.get("ShareVariant"),s=n.USE,o="Get MSGraph Contacts After Sign In";this.options.appApi.siteCatalystApi.logScEvent([t,s,o]),i.run().then(_.bind(function(e){var i=this.options.autoCCollection;i.add(e.toJSON(),{merge:!0}),this._renderGetMSGraphBanner()},this),_.bind(function(){},this))},this),_.bind(function(){this.isMSGraphBannerInFocus=!1},this))},this))},_onAddressScroll:function(){var e=this.options,i=this.options.sendFilesUiModel;i.get("autocomplete_scroll")||(e.appApi.siteCatalystApi.logScEvent([n.TOOLS,this.options.sendFilesUiModel.get("ShareVariant"),n.EMAIL,n.AUTOCOMPLETE,n.SCROLL]),i.set("autocomplete_scroll",!0),i.set("autocomplete_immediate_click",!0),i.set("autocomplete_avoided",!0))},_insertEmail:function(e,i){this.options.emailView.abortPGCRequest(),this.options.emailView._setRecipientsFromText(e,i),this.setFilter(void 0),_.delay(_.bind(function(){this._editControl.focus(!0)
},this),10)}}),i.AutocompleteView}),define("pdmplugins/unified-share/js/templates/us-service-selector-view-template",[],function(){return'<div><div id="ip-service-selector-header" class="ui-theme theme-text"><%= RECIPIENTS_CAN %></div><table class="us-table"><tr class="us-row" id="share_view_row"><td class="us-radio-cell"><input class = "service-selector ip-service-selector" type="radio" id="share_send_file" name = "share_mode" aria-label ="<%= RECIPIENTS_CAN %> <%= SHARE_VIEW_TITLE %> <%= USER_ADVISORY_MSG %> "></td><td><label for="share_send_file" class=" share_send_file_label service-selector-label ui-theme theme-text"><%= SHARE_VIEW %></label></td><td class="us-icon-cell"><div id="invite-view-info" class="info-icon-img us-tooltip" role = "button" aria-label ="<%= SHARE_VIEW_TITLE %> <%= LEARN_MORE_LABEL %>"><span class="ui-theme theme-tooltip us-tooltip-text"><span class="ui-theme theme-tooltip-text"><%= SHARE_VIEW_TITLE %></span></span></div></td></tr><tr class="us-row" id="share_review_row"><td class="us-radio-cell"><input class = "service-selector ip-service-selector" type="radio" id="share_review" name = "share_mode" aria-label ="<%= RECIPIENTS_CAN %> <%= SHARE_REVIEW_TITLE %> <%= USER_ADVISORY_MSG %> "></td><td><label for="share_review" class="share_review_label service-selector-label ui-theme theme-text"><%= SHARE_REVIEW %></label></td><td class="us-icon-cell"><div id="invite-review-info" class="info-icon-img us-tooltip" role = "button" aria-label ="<%= SHARE_REVIEW_TITLE %> <%= LEARN_MORE_LABEL %>"><span class="ui-theme theme-tooltip us-tooltip-text"><div class="ui-theme theme-tooltip-text"><%= SHARE_REVIEW_TITLE %></div></span></div></td></tr><tr class="us-row" id="share_sign_row"><td class="us-radio-cell"><input class = "service-selector ip-service-selector" type="radio" id="share_sign" name = "share_mode" aria-label ="<%= RECIPIENTS_CAN %> <%= SHARE_SIGN_TITLE %> <%= SHARE_SIGN_ADVISORY_MSG %> "></td><td><label for="share_sign" class="share_sign_label service-selector-label ui-theme theme-text"><%= SHARE_SIGN %></label><td class="us-icon-cell"><div id="invite-sign-info" class="info-icon-img us-tooltip" role = "button" aria-label ="<%= SHARE_SIGN_TITLE %> <%= LEARN_MORE_LABEL %>"><span class="ui-theme theme-tooltip us-tooltip-text"><span class="ui-theme theme-tooltip-text"><%= SHARE_SIGN_TITLE %></span></span></div></td></tr></table></div>'}),define("pdmplugins/unified-share/js/views/us-service-selector-view",["core/ac-core","pdmplugins/unified-share/js/ac-unified-share","pdmplugins/unified-share/js/templates/us-service-selector-view-template","i18n!pdmplugins/unified-share/js/nls/ui-strings","pdmplugins/unified-share/js/utils/sc-constants"],function(e,i,t,s,n){return i.USServiceSelectorView=e.View.extend({events:{"click .service-selector":"_selectService","click .ip-learn-more":"_launchLearnMoreReview"},initialize:function(){e.View.prototype.initialize.call(this),this.mouseUp=!1},render:function(){this.$el;e.View.prototype.render.call(this),this._template=_.template(t),0===this.$el.children().length&&(this.$el.html(this._template({SHARE_VIEW:s.SHARE_VIEW,SHARE_REVIEW:s.SHARE_REVIEW,SHARE_REVIEW_TITLE:s.SHARE_REVIEW_INFO_TOOLTIP,SHARE_VIEW_TITLE:s.GET_LINK_VIEW_INFO_TOOLTIP,RECIPIENTS_CAN:s.SHARE_SUBTEXT,LEARN_MORE_LINK:s.LEARN_MORE,LEARN_MORE_LABEL:s.LEARN_MORE_LABEL,USER_ADVISORY_MSG:s.USER_ADVISORY_MSG,SHARE_SIGN_ADVISORY_MSG:s.SHARE_SIGN_ADVISORY_MSG,SHARE_SIGN:s.SHARE_SIGN,SHARE_SIGN_TITLE:s.SHARE_SIGN_INFO_TOOLTIP})),this._initWrappers(),this._addEventListeners()),this.addUIModelEventListener(),this._addKeyEventListener(),this._changeUiFromServiceSelected(),i.QueryParams&&"true"===i.QueryParams.showTooltip&&(this.$usInviteReviewInfo.addClass("hovered"),_.delay(_.bind(function(){this.$usInviteReviewInfo.removeClass("hovered")},this),4e3)),this.options.sendFilesUiModel.get("isSnTenabled")||$("#share_view_row").hide(),this.options.sendFilesUiModel.get("isReviewVisible")||$("#share_review_row").hide(),this._setAdobeSignVisibility()},_initWrappers:function(){this.$usInviteViewInfo=this.$("#invite-view-info"),this.$usInviteReviewInfo=this.$("#invite-review-info"),this.$usInviteSignInfo=this.$("#invite-sign-info"),this.$ipLearnMore=this.$(".ip-learn-more"),this.$advisoryMsg=$("#share-user-advisory-message")},_addEventListeners:function(){this.$usInviteViewInfo.mouseenter(this._onHoverInviteViewInfo),this.$usInviteReviewInfo.mouseenter(this._onHoverInviteReviewInfo),this.$usInviteSignInfo.mouseenter(this._onHoverInviteSignInfo),this.$usInviteViewInfo.focus(_.bind(function(){this.$usInviteReviewInfo.removeClass("hovered"),this.$usInviteSignInfo.removeClass("hovered"),this.$usInviteViewInfo.addClass("hovered")},this)),this.$usInviteSignInfo.focus(_.bind(function(){this.$usInviteReviewInfo.removeClass("hovered"),this.$usInviteViewInfo.removeClass("hovered"),this.$usInviteSignInfo.addClass("hovered")},this)),this.$usInviteReviewInfo.focus(_.bind(function(){this.$usInviteReviewInfo.addClass("hovered")},this)),this.$usInviteViewInfo.blur(_.bind(function(){this.$usInviteViewInfo.removeClass("hovered")},this)),this.$usInviteReviewInfo.blur(_.bind(function(){setTimeout(_.bind(function(){this.$usInviteReviewInfo.removeClass("hovered")},this),100)},this)),this.$usInviteSignInfo.blur(_.bind(function(){setTimeout(_.bind(function(){this.$usInviteSignInfo.removeClass("hovered")},this),100)},this)),this.$usInviteViewInfo.hover(_.bind(function(){this.$usInviteReviewInfo.removeClass("hovered"),this.$usInviteSignInfo.removeClass("hovered"),this.$usInviteViewInfo.addClass("hovered")},this),_.bind(function(){this.$usInviteViewInfo.removeClass("hovered")},this)),this.$usInviteReviewInfo.hover(_.bind(function(){this.$usInviteSignInfo.removeClass("hovered"),this.$usInviteViewInfo.removeClass("hovered"),this.$usInviteReviewInfo.addClass("hovered")},this),_.bind(function(){this.$usInviteReviewInfo.removeClass("hovered")},this)),this.$usInviteSignInfo.hover(_.bind(function(){this.$usInviteViewInfo.removeClass("hovered"),this.$usInviteReviewInfo.removeClass("hovered"),this.$usInviteSignInfo.addClass("hovered")},this),_.bind(function(){this.$usInviteSignInfo.removeClass("hovered")},this)),this.$ipLearnMore.focus(_.bind(function(){this.$usInviteReviewInfo.addClass("learn-more-focus")},this)),this.$ipLearnMore.blur(_.bind(function(){this.$usInviteReviewInfo.removeClass("learn-more-focus hovered")},this)),$(document).mouseup(_.bind(function(e){var i=this.$(".us-tooltip");i.is(e.target)||0!==i.has(e.target).length||i.removeClass("hovered"),e.target.className.includes("service-selector-label")&&(this.mouseUp=!0)},this))},_setAdobeSignVisibility:function(){this.options.sendFilesUiModel.get("isAdobeSignVisible")||$("#share_sign_row").hide()},_selectService:function(e){var i=$(e.currentTarget),t=i.attr("id");this.$usInviteViewInfo.attr("tabindex","-1"),this.$usInviteReviewInfo.attr("tabindex","-1"),this.$usInviteSignInfo.attr("tabindex","-1"),this.$advisoryMsg.text(s.USER_ADVISORY_MSG),"share_send_file"===t?(this.options.sendFilesUiModel.setUSMode("#send-mode"),this.$usInviteViewInfo.attr("tabindex","0")):"share_review"===t?(this.options.sendFilesUiModel.setUSMode("#review-mode"),this.$usInviteReviewInfo.attr("tabindex","0")):"share_sign"===t&&(this.options.sendFilesUiModel.setUSMode("#sign-mode"),this.$usInviteSignInfo.attr("tabindex","0"),this.$advisoryMsg.text(s.SHARE_SIGN_ADVISORY_MSG)),this.mouseUp&&i.blur(),this.mouseUp=!1},addUIModelEventListener:function(){var e=this.options.sendFilesUiModel;e.on("change:us_mode",this._changeUiFromServiceSelected)},_addKeyEventListener:function(){this.$ipLearnMore.keypress(this._onKeyPress)},_onKeyPress:function(e){var i=$(e.currentTarget);e&&13==e.which&&i.trigger("click")},_changeUiFromServiceSelected:function(){var e=this.options.sendFilesUiModel.get("us_mode");if(console.log("_changeUiFromServiceSelected"+e),this.$usInviteViewInfo.attr("tabindex","-1"),this.$usInviteReviewInfo.attr("tabindex","-1"),this.$usInviteSignInfo.attr("tabindex","-1"),"#send-mode"===e){var t=this.$("#share_send_file").next(".service-selector-label");this.$("#share_send_file").prop("checked",!0),$(".service-selector-label.active").not(t).toggleClass("active"),t.toggleClass("active"),this.$usInviteViewInfo.attr("tabindex","0")}else"#review-mode"===e?i.opFactory.create("CanSendForReviewOp",this.options).run().then(_.bind(function(){var e=this.$("#share_review").next(".service-selector-label");this.$("#share_review").prop("checked",!0),$(".service-selector-label.active").not(e).toggleClass("active"),e.toggleClass("active"),this.$usInviteReviewInfo.attr("tabindex","0")},this),_.bind(function(e){this.$("#share_send_file").prop("checked",!0),this.options.sendFilesUiModel.setUSMode("#send-mode"),this.options.appApi.displayApi.showModal(!1);var i=this.options.sendFilesUiModel.get("ShareVariant"),t=n.ERROR,o=e.analyticsEvent;this.options.appApi.siteCatalystApi.logScEvent([i,t,o]),this.options.appApi.dialogApi.displayTextAlert(this.options.appApi.dialogApi.SEVERITY_ERROR,s.FILE_CANT_BE_SENT,e.msg)},this)):"#sign-mode"===e&&i.opFactory.create("SignFilesValidatorOp",this.options).run().then(_.bind(function(){var e=this.$("#share_sign").next(".service-selector-label");this.$("#share_sign").prop("checked",!0),$(".service-selector-label.active").not(e).toggleClass("active"),e.toggleClass("active"),this.$usInviteSignInfo.attr("tabindex","0")},this),_.bind(function(e){this.$("#share_send_file").prop("checked",!0),this.options.sendFilesUiModel.setUSMode("#send-mode"),this.options.appApi.displayApi.showModal(!1);var i=this.options.sendFilesUiModel.get("ShareVariant"),t=n.ERROR,o=e.analyticsEvent;this.options.appApi.siteCatalystApi.logScEvent([i,t,o]),this.options.appApi.dialogApi.displayTextAlert(this.options.appApi.dialogApi.SEVERITY_ERROR,s.FILE_CANT_BE_SENT,e.msg)},this))},_onHoverInviteViewInfo:function(){var e=this.options.sendFilesUiModel.get("ShareVariant"),i=n.USE,t="Select info for view invite";this.options.appApi.siteCatalystApi.logScEvent([e,i,t])},_onHoverInviteSignInfo:function(){var e=this.options.sendFilesUiModel.get("ShareVariant"),i=n.USE,t="Select info for sign invite";this.options.appApi.siteCatalystApi.logScEvent([e,i,t])},_onHoverInviteReviewInfo:function(){var e=this.options.sendFilesUiModel.get("ShareVariant"),i=n.USE,t="Select info for review invite";this.options.appApi.siteCatalystApi.logScEvent([e,i,t])},_launchLearnMoreReview:function(){this.options.appApi.rnaApi.done(_.bind(function(e){e.openDecoratedUrl(s.REVIEW_LEARN_MORE_LINK_GO_URL)},this))}}),i.USServiceSelectorView}),define("pdmplugins/unified-share/js/templates/us-deadline-selector-template",[],function(){return' <div class="us-checkbox-cell" id="deadline-selector">           <input type="checkbox" id="select-deadline" name="select-deadline" class="select-date share-check-box core-checkbox" tabindex="0" />           <label for="select-deadline" class=" select-deadline-text ui-theme theme-text" tabindex="-1"><%= SELECT_DEADLINE %></label>           <span class = "date-selected ui-theme theme-share-add-files" id= "deadline-selected" tabindex="-1"></span>       </div>		<div class = "date-selector-container deadline-selector-container"></div> 		<div class="us-checkbox-cell" id="reminder-selector">           <input type="checkbox" id="select-reminder" name="select-reminder" class="select-date share-check-box core-checkbox" tabindex="0" />           <label for="select-reminder" class=" select-reminder-text ui-theme theme-text" tabindex="-1"><%= SELECT_REMINDER %></label>           <span class = "date-selected ui-theme theme-share-add-files" id= "reminder-selected" tabindex="-1"></span>       </div>		<div class = "date-selector-container reminder-selector-container"></div>'}),define("pdmplugins/unified-share/js/utils/us-utils",["i18n!core/nls/ui-strings"],function(e){var i={getMonthName:function(i){switch(i){case 0:return e.JANUARY_S;case 1:return e.FEBRUARY_S;case 2:return e.MARCH_S;case 3:return e.APRIL_S;case 4:return e.MAY_S;case 5:return e.JUNE_S;case 6:return e.JULY_S;case 7:return e.AUGUST_S;case 8:return e.SEPTEMBER_S;case 9:return e.OCTOBER_S;case 10:return e.NOVEMBER_S;case 11:return e.DECEMBER_S}},getDayName:function(i){switch(i){case 0:return e.SUNDAY_S;case 1:return e.MONDAY_S;case 2:return e.TUESDAY_S;case 3:return e.WEDNESDAY_S;case 4:return e.THURSDAY_S;case 5:return e.FRIDAY_S;case 6:return e.SATURDAY_S}}};return i}),define("pdmplugins/unified-share/js/templates/us-date-selector-template",[],function(){return'<div class="ui-theme theme-text date-calender" id="us-date-calender"><div><button class="dialog-close-btn" tabindex="0"><span class="hidden-accessible"><%- close %></span></button></div><table><tr><td><div class ="date-calender-left-div"><div class="dateLabelFrom"><label for="from-date"><%- from %></label><span class="invalid-from-date-error hide">*<%- invalidDate %></span></div><input class="dateInput ui-theme theme-share-container theme-text" type="text" id="from-date" placeholder="MM/DD/YYYY" tabindex="0"/><div class="dateLabelTo"><label for="to-date"><%- to %></label><span class="invalid-to-date-error hide">*<%- invalidDate %></span></div><input class="dateInput ui-theme theme-share-container theme-text" type="text" id="to-date" placeholder="MM/DD/YYYY" tabindex="0"/><div class="date-div-go" ><button class = "date-calender-action-go" tabindex="0"><%- go %></button><span class="invalid-date-range-error hide">*<%- invalidDateRange %></span></div></div></td><td><div id="date-calender-month-view"><div class="header"><button class="left navButton usNavButton core-down-triangle" id="prev" style="font-size: 8px;" tabindex="0" title = "<%- prevMonth %>" aria-label = "<%- prevMonth %>" ></button><span class="left hook"></span><span class="month-year"></span><span class="right hook" id=""></span><button class="right navButton usNavButton core-down-triangle" id="next" style="font-size: 8px;" tabindex="0" title = "<%- nextMonth %>" aria-label = "<%- nextMonth %>" ></button></div><table id="week-days"><tr class = "day-labels"><td class = "sunday-label">Su</td><td class = "monday-label">Mo</td><td class = "tuesday-label">Tu</td><td class = "wednesday-label">We</td><td class = "thursday-label">Th</td><td class = "friday-label">Fr</td><td class = "saturday-label">Sa</td></tr></table><div class="month-dates"><table class="curr"><tr class="week"><td class="day"></td><td class="day"></td><td class="day"></td><td class="day"></td><td class="day"></td><td class="day"></td><td class="day"></td></tr><tr class="week"><td class="day"></td><td class="day"></td><td class="day"></td><td class="day"></td><td class="day"></td><td class="day"></td><td class="day"></td></tr><tr class="week"><td class="day"></td><td class="day"></td><td class="day"></td><td class="day"></td><td class="day"></td><td class="day"></td><td class="day"></td></tr><tr class="week"><td class="day"></td><td class="day"></td><td class="day"></td><td class="day"></td><td class="day"></td><td class="day"></td><td class="day"></td></tr><tr class="week"><td class="day"></td><td class="day"></td><td class="day"></td><td class="day"></td><td class="day"></td><td class="day"></td><td class="day"></td></tr><tr class="week"><td class="day"></td><td class="day"></td><td class="day"></td><td class="day"></td><td class="day"></td><td class="day"></td><td class="day"></td></tr></table></div></div></td></tr></table><div class="react-spectrum-Datepicker-clockContainer"><div class="react-spectrum-Clock "><input type="number" class="spectrum-Textfield clock-hour ui-theme theme-text theme-share-container" aria-label= "<%= HOURS_LABEL %>" placeholder="HH" min="0" max="23" value=""/><span class="react-spectrum-Clock-divider">:</span><input type="number" class="spectrum-Textfield clock-minute ui-theme theme-text theme-share-container" aria-label= "<%= MINUTES_LABEL %>" placeholder="mm" min="0" max="59" value=""/></div></div><button class="date-selector-go-button button-grey ui-theme theme-share-grey-button" aria-label= "<%= DONE %>" aria-describedby="date-selector-go-button" ><%= DONE %></button></div>'}),define("pdmplugins/unified-share/js/ops/check-deadline-reminder-error-op",["core/ac-core","pdmplugins/unified-share/js/ac-unified-share","i18n!pdmplugins/unified-share/js/nls/ui-strings","i18n!core/nls/ui-strings","pdmplugins/unified-share/js/utils/sc-constants","core/ops/op"],function(e,i,t,s,n){i.CheckDeadlineReminderErrorOp=e.Op.extend({run:function(){var e,i,o,a,l,r,d=this.options.uiModel,p=d.get("deadline"),h=d.get("reminder"),c=new Date,u=d.get("us_mode"),m=!0,E=this.options.returnPromise,g=$.Deferred();if("#review-mode"===u){if(!p&&!h)return E?$.Deferred().resolve().promise():!0;if(e=new Date(p.getFullYear(),p.getMonth(),p.getDate()),h&&(i=new Date(h.getFullYear(),h.getMonth(),h.getDate())),o=new Date(c.getFullYear(),c.getMonth(),c.getDate()),p&&o>e?(m=!1,a=t.SHARE_DEADLINE_ERROR_DLG_TITLE,l=t.SHARE_DEADLINE_ERROR_DLG_MSG,r=n.DEADLINE_ERROR):p&&c>p?(m=!1,a=t.SHARE_DEADLINE_TIME_DLG_TITLE,l=t.SHARE_DEADLINE_TIME_DLG_MSG,r=n.DEADLINE_ERROR):h&&o>i?(m=!1,a=t.SHARE_REMINDER_ERROR_DLG_TITLE,l=t.SHARE_REMINDER_ERROR_1_DLG_MSG,r=n.REMINDER_ERROR):h&&c>h?(m=!1,a=t.SHARE_REMINDER_TIME_DLG_TITLE,l=t.SHARE_REMINDER_TIME_DLG_MSG,r=n.REMINDER_ERROR):p&&h&&i>e?(m=!1,a=t.SHARE_REM_AFTER_DEAD_DLG_TITLE,l=t.SHARE_REMINDER_ERROR_DLG_MSG,r=n.REMINDER_ERROR):p&&h&&h>p&&(m=!1,a=t.SHARE_REM_AFTER_DEAD_DLG_TITLE,l=t.SHARE_REM_AFTER_DEAD_DLG_MSG,r=n.REMINDER_ERROR),"true"==d.get("isModalView")&&0==E)return _.extend({},{isError:!m,errTitle:a,errMessage:l,errorType:r});if(0==m){var S=this.options.appApi.dialogApi.displayHtmlAlert(this.options.appApi.dialogApi.SEVERITY_ERROR,a,l,s.OK);S.always(function(){g.reject()})}else g.resolve()}else g.resolve();return E?g.promise():m}})}),define("pdmplugins/unified-share/js/views/us-date-selector",["core/ac-core","core/utils/view-util","pdmplugins/unified-share/js/ac-unified-share","pdmplugins/unified-share/js/templates/us-date-selector-template","i18n!pdmplugins/unified-share/js/nls/ui-strings","i18n!core/nls/ui-strings","pdmplugins/unified-share/js/utils/us-utils","pdmplugins/unified-share/js/ops/check-deadline-reminder-error-op"],function(e,i,t,s,n,o,a){return t.USDateSelector=e.CustomRangeSelectorView.extend({initialize:function(){e.DialogView.prototype.initialize.call(this),this._template=_.template(s)({custom:o.CUSTOM,close:o.CLOSE,from:o.FROM,to:o.TO,go:o.GO,invalidDate:o.INVALID_DATE,invalidDateRange:o.INVALID_DATE_RANGE,prevMonth:o.PREVIOUS_MONTH,nextMonth:o.NEXT_MONTH,HOURS_LABEL:this._updateAccessibilityForHour(),MINUTES_LABEL:this._updateAccessibilityForMinutes(),DONE:o.DONE}),this._currentMonthView=null,this._currentYearView=null,this._currentActiveDateElement=1},_getAriaLabelForTime:function(e,i){return _.template(n.GENERIC_ARIA_LABEL_STRING,{prefix:e,suffix:i})},_updateAccessibilityForHour:function(){var e=this._getAriaLabelForTime(this.$(".clock-hour").val(),o.HOUR);return this.$(".clock-hour").attr("aria-label",e),e},_updateAccessibilityForMinutes:function(){var e=this._getAriaLabelForTime(this.$(".clock-minute").val(),o.MINUTES);return this.$(".clock-minute").attr("aria-label",e),e},render:function(){return e.DialogView.prototype.render.call(this),this._appendToDialog(this._template),this._initWrappers(),this._initAdditionalWrappers(),this._fillCurrentMonthCalender(),this._setCss(),this._updateTimeInUI(),this._setDefaultDate(),this._addUiEventListeners(),this._goToSetDateMonth(),this.$usModalView.show(),this.$usModalView.addClass("transparent-modal"),this},_initAdditionalWrappers:function(){this.$clockHour=this.$(".clock-hour"),this.$clockMinute=this.$(".clock-minute"),this.$usModalView=$("#us-modal-view"),this.$day=this.$(".day"),this.$dateSelectorGoButton=this.$(".date-selector-go-button"),this.$spectrumTextField=this.$(".spectrum-Textfield")},_setCss:function(){this.$dlg.width("90%"),this.$dlg.css("min-width","230px"),this.$dlg.css("margin-left","-50%"),this.$dlg.css("margin-top","-420px"),this.$dlg.css("padding","10px 10px 18px 10px"),this.$dlg.css("font-size","12px"),this.$dlg.css("box-shadow","3px 3px 18px -5px #323232"),this.$titleBar.hide()},_addUiEventListeners:function(){$("#modal-mask").on("click",this._onCalCloseClick),$("#us-modal-view").on("click",this._onCalCloseClick),$(".clock-hour").on("change",this._updateAccessibilityForHour),$(".clock-minute").on("change",this._updateAccessibilityForMinutes),this.$spectrumTextField.on("input",this._onTimeInput),this.$day.hover(this._onDateHover,void 0),this.$dateSelectorGoButton.on("click",this._onCalCloseClick)},_setDefaultDate:function(){if("checkbox"===this.options.origin){var e=new Date;if("deadline"===this.options.mode)this._setTime(e),this.options.sendFilesUiModel.set(this.options.mode,e);else{var i,t,s=6e4,n=this.options.sendFilesUiModel.get("deadline"),o=new Date(e.getFullYear(),e.getMonth(),e.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds());n>o||e.getHours()>=18||60*s>=n-e?(i=new Date(n.valueOf()-60*s),e>i&&(i=new Date(e.valueOf()+2e4)),this.options.sendFilesUiModel.set(this.options.mode,i),this._updateTimeInUI(!0)):(t=new Date(n.getFullYear(),n.getMonth(),n.getDate()),this.options.sendFilesUiModel.set(this.options.mode,t),this._setTime(t))}}this._updateAccessibilityForHour(),this._updateAccessibilityForMinutes(),this._showSelection()},_goToSetDateMonth:function(){var e=this.options.sendFilesUiModel.get(this.options.mode);this._createMonthCalender(e.getMonth(),e.getFullYear())},_onCalFrameClick:function(e){var i=$(e.target);if(i.attr("title")){var t=new Date(this._currentYearView,this._currentMonthView,i.text()),s=new Date,n=new Date(s.getFullYear(),s.getMonth(),s.getDate());this._setTime(t),t>=n&&("deadline"===this.options.mode||t<=this.options.sendFilesUiModel.get("deadline"))&&this.options.sendFilesUiModel.set(this.options.mode,t),this._showSelection()}},_onCalFrameDblClick:function(e){var i=e.target;i.className.includes("day")&&0==i.className.includes("disabled")&&this._onCalCloseClick()},_onCalCloseClick:function(){var e=new t.CheckDeadlineReminderErrorOp({uiModel:this.options.sendFilesUiModel,appApi:this.options.appApi,returnPromise:!0});this._setSelectedTime(),this.$dlg.hide(),e.run().then(_.bind(function(){this.$dlg.show(),this.$usModalView.hide(),this.$usModalView.removeClass("transparent-modal"),$("#us-modal-view").off("click",this._onCalCloseClick),$("#modal-mask").off("click",this._onCalCloseClick),this.close(!1)},this),_.bind(function(){this.$dlg.show()},this))},_onTimeInput:function(e){var i,t=$(e.currentTarget)[0];i=t.value,i=i.replace(/^0+/,""),t.className.includes("clock-hour")?i>23&&(i="23"):t.className.includes("clock-minute")&&i>59&&(i="59"),i=this._prefixZero(i),0==i&&(i="00"),i&&(t.value=i),this._setSelectedTime()},_onDateHover:function(e){var i,t,s=this._currentYearView,n=this._currentMonthView;i=e.currentTarget.innerHTML,i&&(t=this._getTitleForDate(s,n,i),e.currentTarget.title=t)},_showSelection:function(){var e,i,t=this.options.sendFilesUiModel.get("deadline"),s=this.options.sendFilesUiModel.get("reminder"),n=this._currentYearView,o=this._currentMonthView,a=this.options.mode,l=new Date,r=new Date(l.getFullYear(),l.getMonth(),l.getDate()),d=this._getTitleForDate;e="deadline"===a?t:s,e&&(isNaN(e)||$(".curr tr").each(function(){$("td",this).each(function(){var s=this;if($(this).removeClass("disabled"),$(this).removeClass("selected"),$(this).removeClass("today"),$(this).removeClass("ui-theme theme-calendar-day"),$(this).removeClass("theme-keyboard-focus"),""!=s.innerHTML){i=d(n,o,s.innerHTML),$(this).attr("aria-label",i),$(this).addClass("ui-theme theme-calendar-day");var l=new Date(n,o,s.innerHTML);l.valueOf()==r.valueOf()&&$(this).addClass("today"),l.getDate()==e.getDate()&&l.getMonth()==e.getMonth()&&l.getFullYear()==e.getFullYear()?($(this).addClass("selected"),$(this).focus()):r>l||"reminder"===a&&l>=t?($(this).addClass("disabled"),$(this).removeClass("ui-theme theme-calendar-day")):($(this).removeClass("disabled"),$(this).removeClass("selected"))}})}))},_getHours:function(){return this.$clockHour.val()},_getMinutes:function(){return this.$clockMinute.val()},_setTime:function(e){var i=this._getHours(),t=this._getMinutes();isNaN(i)||isNaN(t)||i>23||0>i||t>59||0>t||(e&&e.setHours(i,t),this.options.sendFilesUiModel.trigger("change:"+this.options.mode))},_setSelectedTime:function(){var e=this.options.mode,i=this.options.sendFilesUiModel.get(e);i&&this._setTime(i)},_updateTimeInUI:function(e){var i,t="deadline"===this.options.mode?"23":"18",s="deadline"===this.options.mode?"59":"00",n=this.options.mode,o=this.options.origin;("hyperlink"===o||e)&&(i=this.options.sendFilesUiModel.get(n),t=this._prefixZero(i.getHours()),s=this._prefixZero(i.getMinutes())),this.$clockHour.val(t),this.$clockMinute.val(s)},_getMonth:function(e){return a.getMonthName(e)},_getDayName:function(e){return a.getDayName(e)},_getTitleForDate:function(e,i,t){var s,n,o,a,l={day:"numeric"},r=this.options.appApi.localeApi.getLocale();return s=new Date(e,i,t),n=s.getDay(),o=s.toLocaleDateString(r,l),a=this._getDayName(n)+", "+this._getMonth(i)+" "+o+", "+e},_prefixZero:function(e){return""!==e&&e>=0&&9>=e&&(e="0"+e),e},_onAnyKeyDown:function(e){var i=$(e.target);if(27===e.which)this._consumeEvent(e),this._onCalCloseClick();else if("Enter"==e.key)this._onCalBodyClick(e);else if(e.target.className.includes("day")){var t;if("ArrowDown"==e.key){var s=i.closest("tr"),n=s.next();void 0!=n&&(t=$(n.find("td")[e.target.cellIndex]))}else if("ArrowUp"==e.key){var s=i.closest("tr"),o=s.prev();void 0!=o&&(t=$(o.find("td")[e.target.cellIndex]))}else"ArrowLeft"==e.key?t=i.prev():"ArrowRight"==e.key&&(t=i.next());void 0!=t&&""!=t.text()&&(t.focus(),i.removeClass("theme-keyboard-focus"),t.addClass("theme-keyboard-focus"))}else(69==e.which||187==e.which||189==e.which||190==e.which)&&this._consumeEvent(e)}}),t.USDateSelector}),define("pdmplugins/unified-share/js/views/us-date-selector-container-view",["core/ac-core","core/utils/view-util","pdmplugins/unified-share/js/ac-unified-share","i18n!pdmplugins/unified-share/js/nls/ui-strings","pdmplugins/unified-share/js/views/us-date-selector"],function(e,i,t){return t.DateSelectorContainer=e.View.extend({initialize:function(){e.View.prototype.initialize.call(this)},render:function(){e.View.prototype.render.call(this),this._showCalender()},_showCalender:function(){var i=e.uiModelFactory.create("DialogsUiModel"),s=_.extend({},this.options,{dialogsUiModel:i,parentView:this}),n=new t.USDateSelector(s);n.open(s.parentView)}}),t.DateSelectorContainer}),define("pdmplugins/unified-share/js/views/us-deadline-selector",["core/ac-core","core/utils/view-util","pdmplugins/unified-share/js/ac-unified-share","pdmplugins/unified-share/js/templates/us-deadline-selector-template","i18n!pdmplugins/unified-share/js/nls/ui-strings","pdmplugins/unified-share/js/utils/us-utils","pdmplugins/unified-share/js/utils/sc-constants","pdmplugins/unified-share/js/views/us-date-selector-container-view"],function(e,i,t,s,n,o,a){return t.DeadlineSelector=e.View.extend({events:{"click .select-date":"_setDeadlineReminder","click .date-selected":"_onDateSelectedClick"},initialize:function(){e.View.prototype.initialize.call(this),this._template=_.template(s)},render:function(){e.View.prototype.render.call(this),0===this.$el.children().length&&(this.$el.html(this._template({SELECT_DEADLINE:n.US_CHOICE_SET_DEADLINE,SELECT_REMINDER:n.US_CHOICE_SET_REMINDER})),this._initWrappers()),this._processRecipients(),this._addUiModelEventListeners(),this._addKeyEventListeners()},_initWrappers:function(){this.$deadlineSelectorContainer=this.$(".deadline-selector-container"),this.$reminderSelectorContainer=this.$(".reminder-selector-container"),this.$deadlineSelector=this.$("#deadline-selector"),this.$reminderSelector=this.$("#reminder-selector"),this.$selectDeadlineText=this.$(".select-deadline-text"),this.$selectReminderText=this.$(".select-reminder-text"),this.$deadlineSelected=this.$("#deadline-selected"),this.$reminderSelected=this.$("#reminder-selected"),this.$selectDate=this.$(".select-date"),this.$dateSelected=this.$(".date-selected")},_processRecipients:function(){this._toggleDeadlineSelector(),this._toggleReminderSelector()},_addUiModelEventListeners:function(){var e=this.options.sendFilesUiModel;e.get("email_addr_collection").on("all",this._processRecipients),e.on("change:us_mode",this._onModeChange),e.on("change:set_deadline",this._checkUncheckDeadlineSelector),e.on("change:deadline",this._onDeadlineChange),e.on("change:reminder",this._onReminderChange)},_addKeyEventListeners:function(){this.$selectDate.keypress(this._onKeyPress),this.$dateSelected.keypress(this._onKeyPress)},_showCalendar:function(e,i){var s=_.extend({},{origin:i,mode:e,sendFilesUiModel:this.options.sendFilesUiModel});this.removeAllChildViews(),"deadline"===e?this._renderChildView("_deadlineSelectorContainer",t.DateSelectorContainer,this.$deadlineSelectorContainer,s):this._renderChildView("_reminderSelectorContainer",t.DateSelectorContainer,this.$reminderSelectorContainer,s)},_setDeadline:function(e){var i=this.options.sendFilesUiModel.get("set_deadline");"checkbox"===e&&this.options.sendFilesUiModel.set("set_deadline",!i,{silent:!0}),i&&"hyperlink"!==e?this._reset():this._showCalendar("deadline",e);var t=this.options.sendFilesUiModel.get("ShareVariant"),s=a.USE,n="Add deadline";this.options.appApi.siteCatalystApi.logScEvent([t,s,n])},_setReminder:function(e){var i=this.options.sendFilesUiModel.get("set_reminder");"checkbox"===e&&this.options.sendFilesUiModel.set("set_reminder",!i,{silent:!0}),i&&"hyperlink"!==e?this._resetReminder():this._showCalendar("reminder",e);var t=this.options.sendFilesUiModel.get("ShareVariant"),s=a.USE,n="Setup reminder";this.options.appApi.siteCatalystApi.logScEvent([t,s,n])},_onDateSelectedClick:function(e){this._opencalendar(e,"hyperlink")},_setDeadlineReminder:function(e){this._opencalendar(e,"checkbox")},_onKeyPress:function(e){var i=$(e.currentTarget);e&&13==e.which&&i.trigger("click")},_opencalendar:function(e,i){var t=$(e.currentTarget),s=t.attr("id");"deadline-selected"===s||"select-deadline"===s?this._setDeadline(i):this._setReminder(i)},_onModeChange:function(){this._toggleDeadlineSelector(),this._toggleReminderSelector()},_toggleDeadlineSelector:function(){var e=this.options.sendFilesUiModel.get("email_addr_collection"),i=this.options.sendFilesUiModel.get("us_mode");e.length>0&&"#review-mode"===i?this.$deadlineSelector.slideDown(200):this.$deadlineSelector.slideUp(200)},_toggleReminderSelector:function(){var e=this.options.sendFilesUiModel,i=e.get("email_addr_collection"),t=e.get("us_mode"),s=void 0;i.length>0&&"#review-mode"===t&&s?this.$reminderSelector.slideDown(200):this.$reminderSelector.slideUp(200)},_checkUncheckDeadlineSelector:function(){var e=this.options.sendFilesUiModel.get("set_deadline");e?this.$("#select-deadline").attr("checked",!0):this.$("#select-deadline").attr("checked",!1)},_onDeadlineChange:function(){var e=this.options.sendFilesUiModel,i=e.get("deadline");i?(this.$selectDeadlineText.text(n.DUE_BY),this.$deadlineSelected.text(this._formatdate(i)),this.$deadlineSelected.attr("tabindex","0")):(this.$deadlineSelected.text(""),this.$deadlineSelected.attr("tabindex","-1")),this._toggleReminderSelector(),this._onReminderChange()},_onReminderChange:function(){var e=this.options.sendFilesUiModel,i=e.get("reminder");i?(this.$selectReminderText.text(n.REMIND_BY),this.$reminderSelected.text(this._formatdate(i)),this.$reminderSelected.attr("tabindex","0")):(this.$reminderSelected.text(""),this.$reminderSelected.attr("tabindex","-1"))},_reset:function(){this._resetDeadline(),this._resetReminder()},_resetDeadline:function(){var e=this.options.sendFilesUiModel;this.$selectDeadlineText.text(n.US_CHOICE_SET_DEADLINE),e.set("deadline",""),e.set("set_deadline",!1),this.$("#select-deadline").attr("checked",!1)},_resetReminder:function(){var e=this.options.sendFilesUiModel;this.$selectReminderText.text(n.US_CHOICE_SET_REMINDER),e.set("reminder",""),e.set("set_reminder",!1),this.$("#select-reminder").attr("checked",!1)
},_formatdate:function(e){var i=this.options.appApi.localeApi.getLocale(),t={day:"numeric"},s=e.toLocaleDateString(i,t),n=this._getMonth(e.getMonth()),o=(e.getFullYear(),e.getHours()),a=e.getMinutes();return 10>o&&(o="0"+o),10>a&&(a="0"+a),s+" "+n+", "+o+":"+a},_getMonth:function(e){return o.getMonthName(e)}}),t.DeadlineSelector}),define("pdmplugins/unified-share/js/templates/us-mode-content-template",[],function(){return'<button class="us-tab2 ui-theme theme-tab-button theme-text" id="send-mode" aria-label="<%= send_mode_head %>"title="<%=CAN_VIEW %>" ><%= send_mode_head %></button><button class="us-tab2 ui-theme theme-tab-button theme-text" id="review-mode" aria-label="<%= review_mode_head %>"title="<%= CAN_COMMENT %>" ><%= review_mode_head %></button><button class="us-tab2 ui-theme theme-tab-button theme-text" id="sign-mode" aria-label="<%= sign_mode_head %>"title="<%= CAN_SIGN %>" ><%= sign_mode_head %></button>'}),define("pdmplugins/unified-share/js/templates/us-send-mode-container-template",[],function(){return'<div id = "us-send-mode-container"><div id = "edit-logo-placeholder"></div></div>'}),define("pdmplugins/unified-share/js/templates/us-edit-logo-template",[],function(){return' <div class="us-checkbox-cell share-choice-line share-customize-recipient-page-line" id="edit-logo">           <input type="checkbox" id="share-customize-recipient-page" name="share-customize-recipient-page" class="share-customize-recipient-page share-check-box core-checkbox" />           <div class="share-choice share-customize-choice theme-text">               <label for="share-customize-recipient-page"><%= SHARE_CHOICE_CUSTOMIZE_RECIPIENT_PAGE %></label>               <a class="branding-button theme-hyperlink" tabindex="-1" role="link" href="javascript:void(0)">(<%= SHARE_CHOICE_CUSTOMIZE_RECIPIENT_PAGE_EDIT %>)</a>           </div>       </div>'}),define("pdmplugins/unified-share/js/views/us-edit-logo-view",["core/ac-core","pdmplugins/unified-share/js/ac-unified-share","pdmplugins/unified-share/js/templates/us-edit-logo-template","i18n!pdmplugins/unified-share/js/nls/ui-strings","pdmplugins/unified-share/js/utils/sc-constants"],function(e,i,t,s,n){return i.EditLogoView=e.View.extend({events:{"click #share-customize-recipient-page":"_onShareCustomizeRecipientPage","click .branding-button":"_onBrandingClick"},initialize:function(){e.View.prototype.initialize.call(this),this._template=_.template(t)},render:function(){return e.View.prototype.render.call(this),0===this.$el.children().length&&(this.$el.html(this._template({SHARE_CHOICE_CUSTOMIZE_RECIPIENT_PAGE:s.US_CHOICE_ADD_LOGO_COLOR,SHARE_CHOICE_CUSTOMIZE_RECIPIENT_PAGE_EDIT:s.US_CHOICE_ADD_LOGO_COLOR_EDIT})),this._initWrappers()),this},_initWrappers:function(){this.$EditLogo=this.$("#edit-logo"),this.$EditLogoCheckBox=this.$("#share-customize-recipient-page")},_onShareCustomizeRecipientPage:function(t){var s=this.options,o=s.sendFilesUiModel,a=$(t.target),l=s.brandingModel.get("logo");this.options.appApi.siteCatalystApi.logScEvent(a.hasClass("selected")?[n.TOOLS,this.options.sendFilesUiModel.get("ShareVariant"),n.BRANDING,n.TURN_OFF_BRANDING]:[n.TOOLS,this.options.sendFilesUiModel.get("ShareVariant"),n.BRANDING,n.TURN_ON_BRANDING]),e.Util.isCEF()?""===l||null===l||void 0==l?this.options.appApi.sessionApi.ensureSignedIn().then(_.bind(function(){this.options.readRegistry=!1,console.log("_onShareCustomizeRecipientPage : ensureSignedIN"),i.opFactory.create("DesktopGettingSubscriptionLevels",this.options).run().then(_.bind(function(){console.log("_onShareCustomizeRecipientPage : ensureSignedIN"),l=this.options.brandingModel.get("logo"),""===l||null===l||void 0==l?this._onBrandingClickDebounced():this.options.sendFilesUiModel.set({customize_recipient_page:!a.hasClass("selected")})},this))},this),_.bind(function(e){e&&"NoAccessToPdfServices"==e.errorString&&this._displayNoAccessToUser(e.errorCode)},this)):o.set({customize_recipient_page:!a.hasClass("selected")}):(o.set({customize_recipient_page:!a.hasClass("selected")}),(""===l||null===l)&&this._onBrandingClick())},_getAriaLabelForDesktop:function(e,i){return _.template(s.GENERIC_ARIA_LABEL_STRING,{prefix:e,suffix:i})},_onBrandingClickDebounced:function(){this._debouncedBrandingClick||(this._debouncedBrandingClick=_.debounce(this._onBrandingClick,1e3,!0)),this._debouncedBrandingClick()},_onBrandingClick:function(){var i,t,o,a=this.options.sendFilesUiModel,l=!1,r={},d=a.get("view_mode"),p=document.createElement("a");return e.Util.isCEF()?e.Util.isReader()?this.options.appApi.siteCatalystApi.logScEvent([n.TOOLS,this.options.sendFilesUiModel.get("ShareVariant"),n.BRANDING,n.CLICK_BRANDING_IN_READER]):e.Util.isAcrobat()&&this.options.appApi.siteCatalystApi.logScEvent([n.TOOLS,this.options.sendFilesUiModel.get("ShareVariant"),n.BRANDING,n.CLICK_BRANDING_IN_ACROBAT]):this.options.appApi.siteCatalystApi.logScEvent([n.TOOLS,this.options.sendFilesUiModel.get("ShareVariant"),n.BRANDING,n.CLICK_BRANDING]),"web"===d?(p.href=this.options.appApi.baseCloudUrisApi.getApiUri(),t=p.protocol+"//"+p.host+"/send",i=$.Deferred().promise().resolve()):(e.Util.isCEF()&&(r.okButtonClass="branding-aria-label"),this.options.appApi.siteCatalystApi.logScEvent([n.TOOLS,this.options.sendFilesUiModel.get("ShareVariant"),n.BRANDING,n.EDIT_BRANDING_ONLINE]),o="cef"===d?s.S_T_CUSTOMIZE_RECIPIENT_PAGE_DIALOG_USE_WEB_MSG:s.CUSTOMIZE_RECIPIENT_PAGE_DIALOG_USE_WEB_MSG,i=this.options.appApi.dialogApi.displayHtmlAlert(!1,s.CUSTOMIZE_RECIPIENT_PAGE_DIALOG_NOT_AVAILABLE,_.template(o,{targetUrl:t,buttonName:s.CUSTOMIZE_RECIPIENT_PAGE_DIALOG_USE_WEB_OK}),s.CUSTOMIZE_RECIPIENT_PAGE_DIALOG_USE_WEB_OK,s.CUSTOMIZE_RECIPIENT_PAGE_CLOSE,r).then(_.bind(function(){this.options.appApi.siteCatalystApi.logScEvent([n.TOOLS,this.options.sendFilesUiModel.get("ShareVariant"),n.BRANDING,n.EDIT_BRANDING_ONLINE,n.CONTINUE]),this.options.appApi.sessionApi.ensureSignedIn().done(_.bind(function(){e.opFactory.create("GettingSsoUriOp",this.options).run("send").done(function(e){e&&window.open(e.uri)})},this)),console.log("continue : need to uncheck the checkbox"),this.$EditLogoCheckBox.attr("checked",!1)},this,t),_.bind(function(){this.options.appApi.siteCatalystApi.logScEvent([n.TOOLS,this.options.sendFilesUiModel.get("ShareVariant"),n.BRANDING,n.EDIT_BRANDING_ONLINE,n.CANCEL]),console.log("cancel:need to uncheck the checkbox"),this.$EditLogoCheckBox.attr("checked",!1)},this)),e.Util.isCEF()&&$(".branding-aria-label").attr("aria-label",this._getAriaLabelForDesktop(s.CUSTOMIZE_RECIPIENT_PAGE_DIALOG_NOT_AVAILABLE,s.CUSTOMIZE_RECIPIENT_PAGE_DIALOG_USE_WEB_OK))),this.options.brandingModel.get("logo")||(a.set({customize_recipient_page:!1}),l=!0),i}}),i.EditLogoView}),define("pdmplugins/unified-share/js/views/us-send-mode-options-view",["core/ac-core","pdmplugins/unified-share/js/ac-unified-share","pdmplugins/unified-share/js/templates/us-send-mode-container-template","pdmplugins/unified-share/js/views/us-edit-logo-view"],function(e,i,t){return i.SendModeOptionsView=e.View.extend({initialize:function(){e.View.prototype.initialize.call(this),this._template=_.template(t),this._addUiModelEventListeners()},render:function(){e.View.prototype.render.call(this);this.$el;0===this.$el.children().length&&(this.$el.html(this._template({})),this._initWrappers()),this._renderChildViews()},_initWrappers:function(){this.$usEditLogo=this.$("#edit-logo-placeholder")},_renderChildViews:function(){},_addUiModelEventListeners:function(){}}),i.SendModeOptionsView}),define("pdmplugins/unified-share/js/templates/us-review-mode-container-template",[],function(){return'<div id = "us-review-mode-container"><div id = "edit-logo-placeholder"></div></div>'}),define("pdmplugins/unified-share/js/views/us-review-mode-options-view",["core/ac-core","pdmplugins/unified-share/js/ac-unified-share","pdmplugins/unified-share/js/templates/us-review-mode-container-template","pdmplugins/unified-share/js/views/us-edit-logo-view"],function(e,i,t){return i.ReviewModeOptionsView=e.View.extend({initialize:function(){e.View.prototype.initialize.call(this),this._template=_.template(t),this._addUiModelEventListeners()},render:function(){e.View.prototype.render.call(this);this.$el;0===this.$el.children().length&&(this.$el.html(this._template({})),this._initWrappers()),this._renderChildViews()},_initWrappers:function(){this.$usEditLogo=this.$("#edit-logo-placeholder")},_renderChildViews:function(){},_addUiModelEventListeners:function(){}}),i.ReviewModeOptionsView}),define("pdmplugins/unified-share/js/templates/us-sign-mode-container-template",[],function(){return'<div id = "us-sign-mode-container"><button id = "advanced-sign-img"/><div id = "advanced-sign-options" class="ui-theme theme-text advanced-sign"><%= ADVANCED_SIGN_OPTIONS%></div><div id = "advanced-sign-subtext" class="ui-theme theme-text"><%= ADVANCED_SIGN_SUBTEXT%></div></div>'}),define("pdmplugins/unified-share/js/views/us-sign-mode-options-view",["core/ac-core","pdmplugins/unified-share/js/ac-unified-share","pdmplugins/unified-share/js/templates/us-sign-mode-container-template","i18n!pdmplugins/unified-share/js/nls/ui-strings"],function(e,i,t,s){return i.SignModeOptionsView=e.View.extend({events:{"click #advanced-sign-options":"_onAdvancedSignClick","click #advanced-sign-img":"_onAdvancedSignClick"},initialize:function(){e.View.prototype.initialize.call(this),this._template=_.template(t),this._addUiModelEventListeners()},render:function(){e.View.prototype.render.call(this);this.$el;0===this.$el.children().length&&(this.$el.html(this._template({ADVANCED_SIGN_OPTIONS:s.ADVANCED_SIGN_OPTIONS,ADVANCED_SIGN_SUBTEXT:s.ADVANCED_SIGN_SUBTEXT1})),this._initWrappers()),this._renderChildViews()},_initWrappers:function(){this.$usAdvancedSignOptions=this.$("#advanced-sign-options")},_renderChildViews:function(){},_addUiModelEventListeners:function(){},_onAdvancedSignClick:function(){console.log("On Advanced Sign click..."),this.options.canSignUiModel.set("advancedSignClick",!0),this.options.canSignUiModel.set("advancedSignClick",!1,{silent:!0})}}),i.SignModeOptionsView}),define("pdmplugins/unified-share/js/views/us-mode-container-view",["core/ac-core","pdmplugins/unified-share/js/ac-unified-share","pdmplugins/unified-share/js/templates/us-mode-content-template","i18n!pdmplugins/unified-share/js/nls/ui-strings","pdmplugins/unified-share/js/views/us-send-mode-options-view","pdmplugins/unified-share/js/views/us-review-mode-options-view","pdmplugins/unified-share/js/views/us-sign-mode-options-view"],function(e,i,t,s){return i.ModeCollection=e.Collection.extend({select:function(e){this.each(function(i){i.set("selected",e===i)})}}),i.ModeView=e.View.extend({initialize:function(){this.render(),this.model.on("change:selected",function(){this.render()},this)},select:function(){this.model.collection.select(this.model)},render:function(){e.View.prototype.render.call(this),this.$el.toggleClass("selected",this.model.get("selected"))}}),i.USModeContainerView=e.View.extend({events:{"click .us-tab2":"setModeContent"},modeContentViews:{},modeViews:{},currentMode:"",initialize:function(){_.bind(this.setModeContent,this),_.bind(this.initialize,this),_.bind(this.render,this),this.currentMode=this.options.sendFilesUiModel.get("us_mode"),e.View.prototype.initialize.call(this)},render:function(){this.$el;e.View.prototype.render.call(this),this._template=_.template(t);this.$el;0===this.$el.children().length&&this.$el.html(this._template({send_mode_head:s.SHARE_SEND_TAB_HEADING,review_mode_head:s.SHARE_REVIEW_TAB_HEADING,sign_mode_head:s.SHARE_SIGN_TAB_HEADING,CAN_VIEW:s.SHARE_SEND_TAB_HEADING,CAN_COMMENT:s.CAN_COMMENT_TOOLTIP,CAN_SIGN:s.CAN_SIGN_TOOLTIP})),this._addUiModelEventListeners();var n=new i.ModeCollection;i.modeCollection=n;var o=$("#us-mode-selector"),a=$("#us-mode-selector").find(".us-tab2");_.each(a,function(e){n.add({id:$(e).attr("id"),selected:!1});var t=new i.ModeView({model:n.last(),el:e});o.append(t.$el)}),this._setCurrentMode(),this.setModeContent({currentTarget:this.currentMode})},_addUiModelEventListeners:function(){this.options.sendFilesUiModel},_setCurrentMode:function(){},setModeContent:function(e){var t=$(e.currentTarget);this.currentMode="#"+t.attr("id"),this.options.sendFilesUiModel.setUSMode(this.currentMode),$("#us-mode-content-container").children().detach(),this.modeContentViews[t.attr("id")]||(this.modeContentViews[t.attr("id")]=this.createModeContentViewForEl(t)),_.each(i.modeCollection.models,function(e){e.get("id")===t.attr("id")&&e.collection.select(e)}),$("#us-mode-content-container").append(this.modeContentViews[t.attr("id")].$el),this.modeContentViews[t.attr("id")].render()},createModeContentViewForEl:function(e){var t,s=_.extend(this.options,{el:$("#us-mode-content-container")});switch(e.attr("id")){case"send-mode":t=new i.SendModeOptionsView(s);break;case"review-mode":t=new i.ReviewModeOptionsView(s);break;case"sign-mode":t=new i.SignModeOptionsView(s)}return t}}),i.USModeContainerView}),define("pdmplugins/unified-share/js/views/us-email-addr-view",["core/ac-core","pdmplugins/unified-share/js/ac-unified-share","pdmplugins/unified-share/js/templates/us-email-addr-view-template","pdmplugins/unified-share/js/templates/us-email-list-item-template","i18n!pdmplugins/unified-share/js/nls/ui-strings","pdmplugins/unified-share/js/views/us-chicklet-edit-control","pdmplugins/unified-share/js/views/us-autocomplete-view","pdmplugins/unified-share/js/utils/sc-constants","core/utils/truncate","pdmplugins/unified-share/js/views/us-service-selector-view","pdmplugins/unified-share/js/views/us-deadline-selector","pdmplugins/unified-share/js/views/us-mode-container-view"],function(e,i,t,s,n,o,a,l,r){return i.EmailAddrView=e.View.extend({events:{"input .us-share-address-input":"_onRecipientsInput","paste .us-share-address-input":"_onRecipientsPaste","blur  .us-share-address-input":"_onRecipientsBlur","click .us-share-address-box":"_onShareAddressClick","click .share-email-list-close":"_onEmailListClose"},initialize:function(){e.View.prototype.initialize.call(this),this._template=_.template(t),this._localAddressTemplate=_.template(s);var i=_.extend({},this.options,{searchString:""});this.PGCOp=e.opFactory.create("GettingPGCSuggestionsOp",i)},render:function(){var i;e.View.prototype.render.call(this);var t=this.options.sendFilesUiModel;if(!t.get("is_message_user_input")){var s="#send-mode"==t.get("us_mode")?n.SHARE_MESSAGE_PROMPT2:n.SHARE_MESSAGE_PROMPT_REVIEW_4;s="#sign-mode"==t.get("us_mode")?n.SHARE_MESSAGE_PROMPT_SIGN:s,t.set("us_message_text",s)}var o=t.get("us_subject_text"),s=t.get("us_message_text");return 0===this.$el.children().length&&(this.$el.html(this._template({SHARE_ADDRESS_HEADING:n.SHARE_ADDRESS_HEADING,SHARE_ADDRESS_PROMPT:n.SHARE_ADDRESS_PROMPT,SHARE_INDIVIDUAL_HELP:n.SHARE_INDIVIDUAL_HELP,CLOSE:n.CLOSE,SHARE_INITIAL_SUBJECT_ARIA_LABEL:this._getSubjectInitialAriaLabel(),SHARE_INITIAL_SUBJECT:o,SHARE_MESSAGE_HEADING_ARIA_LABEL:this._getMessageInitialAriaLabel(),SHARE_MESSAGE_PROMPT:s,SHARE_MESSAGE_PROMPT_PLACEHOLDER:n.SHARE_MESSAGE_PROMPT_PLACEHOLDER,ADDED_MEMBERS:n.ADDED_RECIPIENT,SHARE_SUBTEXT:n.SHARE_SUBTEXT,USER_ADVISORY_MSG:"#sign-mode"===t.get("us_mode")?n.SHARE_SIGN_ADVISORY_MSG:n.USER_ADVISORY_MSG,ADDED_MEMBERS_MSG:n.SHARE_ACCORDIAN_SUMMARY_2,SUBJECT_TITLE:n.NAME_STRING,MESSAGE_TITLE:n.SHARE_MESSAGE_HEADING})),this._initWrappers(),this.$shareSubjectinput.one("input",this._onSubjectInputOnce),this.$shareSubjectinput.one("paste",this._onSubjectInputOnce),this.$shareMessageInput.one("input",this._onMessageInputOnce),this.$shareMessageInput.one("paste",this._onMessageInputOnce),i=document.createElement("input"),void 0!==i.placeholder?this.$addressHeading.hide():this.$addressHeading.show(),e.Util.isCEF()&&(this.$addressHelpMsg.css("z-index","1000"),this.$autocompleteBox.css("z-index","1001"))),this._addUiModelEventListeners(),this._addKeyEventListener(),_.delay(_.bind(function(){this.$shareMessageInput.trigger("resize")},this),500),this._renderChildViews(),$(".us-share-address-input").one("focus",this._initialiseEmailAddFetching),this._updateEmailFields(),this._processRecipients(!0),this},stopListening:function(i,t,s){e.View.prototype.stopListening.call(this,i,t,s),this.applyMethodRecursively("undelegateEvents"),this._removeUiModelEventListeners()},_initWrappers:function(){this.$addressHeading=this.$(".share-address-heading"),this.$addressBox=this.$(".us-share-address-box"),this.$emailErrorBubble=this.$(".sharing-email-error"),this.$addressHelpMsg=this.$(".share-address-help-msg"),this.$autocompleteBox=this.$(".us-share-autocomplete-box"),this.$filesList=this.$(".share-email-list"),this.$shareUserAdvisoryMessage=this.$("#share-user-advisory-message"),this.$addedMembers=this.$("#added-members"),this.$addedMembersMessage=this.$("#share-added-members-message"),this.$addedMembersListContainer=this.$("#added-members-list-container"),this.$removeButton=this.$(".share-email-list-close"),this.$usModeSelector=this.$("#us-mode-selector"),this.$shareSubjectinput=this.$(".us-share-subject-input"),this.$shareMessageInput=this.$(".us-share-message-input"),this.$shareSubjectTitle=this.$("#us-share-subject-title"),this.$shareMessageTitle=this.$("#us-share-message-title"),this.$usModeContentContainer=this.$("#us-mode-content-container"),this.$deadlineSelectorContainer=this.$("#deadline-selector-container")},_renderChildViews:function(){var e,t,s=this.options.sendFilesUiModel;t=_.extend({},this.options,{emailView:this}),this._renderChildView("_chickletEditControl",o,this.$addressBox,t),s.get("enable_autocomplete")?(e=_.extend({},this.options,{editControl:this._chickletEditControl,emailView:this}),this.$autocompleteBox.show(),this._renderChildView("_autocompleteControl",a,this.$autocompleteBox,e)):(this._autocompleteControl&&this.removeChildView(this._autocompleteControl),this.$autocompleteBox.hide()),this.options.appApi.rnaApi.done(_.bind(function(e){(this.options.sendFilesUiModel.get("isReviewVisible")||e.esApi.isSendForSignEnabled())&&this._renderChildView("_usModeSelectorView",i.USServiceSelectorView,this.$usModeSelector)},this)),this._renderChildView("_deadlineSelectorContainer",i.DeadlineSelector,this.$deadlineSelectorContainer)},_detachChildViewsAndClear:function(){this._chickletEditControl&&this.removeChildView(this._chickletEditControl),this._autocompleteControl&&this.removeChildView(this._autocompleteControl);var e=this.options.sendFilesUiModel.get("email_addr_collection");e.length>0&&e.reset()},_updateEmailFields:function(){{var e=this.options.sendFilesUiModel;"share"===e.get("US_tab_open")}this.$el.removeClass("disabled"),this.$addressHeading.removeAttr("disabled"),this._chickletEditControl.enable(!0)},_onEmailListClose:function(e){var i,t,s=$(e.target),n=this.options.sendFilesUiModel.get("email_addr_collection"),o=this.options.sendFilesUiModel.get("ShareVariant"),a=l.USE,r="Remove User";this.options.appApi.siteCatalystApi.logScEvent([o,a,r]),i=s.data("asset-id"),i&&(t=n.get(i),n.remove(t)),this._updateAddedMembersText(n.length)},_processRecipients:function(e){var i=this.options.sendFilesUiModel.get("email_addr_collection");i.length>0?(this.$shareUserAdvisoryMessage.show(),this._toggleSubjectAndMessageVisibility(!0)):(this.$shareUserAdvisoryMessage.hide(),this._toggleSubjectAndMessageVisibility(!1)),this._updateSubjectFromModel(),e&&(this._chickletEditControl.processRecipients(i),this._renderEmailList(i))},_renderEmailList:function(i){var t,s,o,a,l,d=this.$filesList,p=this.options.sendFilesUiModel,h=(p.get("view_mode"),this.options,this._computeMaxAvailWidth());e.Util.isCEF()&&d.show(),d.empty(),i.each(_.bind(function(e){s=e.get(e.get("name")?"name":"email"),o=e.get("email"),l=e.get("valid"),a=this._localAddressTemplate({name:s,email:o,remove:n.SHARE_EMAIL_REMOVE,asset_id:e.cid,ariaRemoveLabel:this._getRemoveAriaLabel(s)}),console.log(s),s&&l?d.prepend(a):l||i.remove(e)},this)),_.each(this.$(".share-email-list-name"),function(e){t=$(e);var i={truncateFromRight:!0,truncateFromExt:!1,ellipsis:"...",maxIterations:10};r.truncateElementText(t,h-$(".share-email-list-close").width(),i)}),this._updateAddedMembersText(i.length)},_updateAddedMembersText:function(e){void 0!=e&&e>=0&&this.$addedMembers.html(n.ADDED_RECIPIENT_NO_COUNT+" ("+e+")")},_updateSubjectFromModel:function(){var e=this.options.sendFilesUiModel;this.setSubject(e.get("us_subject_text"))},_updateMessageFromModel:function(){var e=this.options.sendFilesUiModel;this.setMessage(e.get("us_message_text"))},_getRemoveAriaLabel:function(e){return _.template(n.GENERIC_ARIA_LABEL_STRING,{prefix:e,suffix:n.SHARE_EMAIL_REMOVE})},_initialiseEmailAddFetching:function(){var t=this.options,s=t.sendFilesUiModel,n=(t.limitsModel,this._getResolvedPromise());this._displayIPMToUser=!1,s.set({is_individual:!0}),e.Util.isCEF()&&s.get("autocomplete_local_contacts_imported")===!1&&(n=this._importLocalEmailContacts(),n.then(_.bind(function(){s.set({autocomplete_local_contacts_imported:!0})},this))),e.Util.isCEF()&&s.get("autocomplete_cloud_contacts_imported")===!1&&this.options.appApi.sessionApi.isSignedInReader()&&i.opFactory.create("DesktopFetchingAutocompleteListOp",this.options).run().then(_.bind(function(){s.set({autocomplete_cloud_contacts_imported:!0})},this)),e.Util.isCEF()&&s.get("autocomplete_msgraph_contacts_imported")===!1&&this.options.appApi.rnaApi.done(_.bind(function(i){i.rnaMicrosoftGraphAPI.isMicrosoftGraphEnabled().done(_.bind(function(){i.rnaMicrosoftGraphAPI.isSignedInMicrosoftGraph().done(_.bind(function(i){if(i){var t=e.opFactory.create("MicrosoftGraphOutlookContactsOp",this.options),n=this.options.sendFilesUiModel.get("ShareVariant"),o=l.USE,a="Get MSGraph Contacts for SignedIn User";this.options.appApi.siteCatalystApi.logScEvent([n,o,a]),t.run().then(_.bind(function(e){var i=this.options.autoCCollection;i.add(e.toJSON(),{merge:!0}),s.set({autocomplete_msgraph_contacts_imported:!0})},this),_.bind(function(){},this))}},this))},this))},this))},_toggleSubjectAndMessageVisibility:function(e){e?(this.$shareSubjectTitle.show(),this.$shareMessageTitle.show(),this.$shareSubjectinput.show(),this.$shareMessageInput.show(),this.$addedMembers.show(),this.$addedMembersMessage.hide(),this.$addedMembersListContainer.show()):(this.$shareSubjectTitle.hide(),this.$shareMessageTitle.hide(),this.$shareSubjectinput.hide(),this.$shareMessageInput.hide(),this.$addedMembers.hide(),this.$addedMembersMessage.hide(),this.$addedMembersListContainer.hide())},_importLocalEmailContacts:function(){return this.options.appApi.rnaApi.then(_.bind(function(e){return e.stApi.getOutlookAutoCompleteListAtIdleAPI().then(_.bind(function(e){return e._addEventListener("custom:onOutlookAddressesFetchComplete",_.bind(function(e,i){var t=i.params,s=t.split(";"),n="",o="",a=-1,l=this.options.autoCCollection;s.pop(),_.each(s,function(e){a=_.lastIndexOf(e,"<"),-1===a?(o=e,n=""):(o=e.substring(a+1),n=e.substring(0,a)),">"===_.last(o)&&(o=o.slice(0,-1))," "===_.last(n)&&(n=n.slice(0,-1)),l.get(o)&&l.remove(o),l.add({email:o,name:n,isLocalContact:!0})})},this)),$.Deferred().resolve().promise()},this),_.bind(function(){return $.Deferred().reject().promise()},this))},this),_.bind(function(){return $.Deferred().reject().promise()},this))},_addUiModelEventListeners:function(){var e=this.options.sendFilesUiModel;e.get("email_addr_collection").on("all",this._onRecipientsChange),e.on("change:enable_autocomplete",this._onEnableAutocompleteChange),e.on("change:us_subject_text",this._updateSubjectFromModel),e.on("change:us_message_text",this._updateMessageFromModel)},_removeUiModelEventListeners:function(){var e=this.options.sendFilesUiModel;e.get("email_addr_collection").off("all",this._onRecipientsChange),e.off("change:enable_autocomplete",this._onEnableAutocompleteChange)},_onViewEvent:function(i,t){"CHICKLET_REMOVED"===i&&this._onChickletRemoved(),e.View.prototype._onViewEvent.call(this,i,t)},_onRecipientsChange:function(){this._onDebouncedRecipientsChange()},_onDebouncedRecipientsChange:function(){this._processRecipients(!0)},_getSubjectInitialAriaLabel:function(){return this._getAriaLabelForDesktop(n.NAME_STRING,this.options.sendFilesUiModel.get("us_subject_text"))},_getMessageInitialAriaLabel:function(){return this._getAriaLabelForDesktop(n.SHARE_MESSAGE_HEADING,this.options.sendFilesUiModel.get("us_message_text"))},_getAriaLabelForDesktop:function(e,i){return _.template(n.GENERIC_ARIA_LABEL_STRING,{prefix:e,suffix:i})},_onEnableAutocompleteChange:function(){this._renderChildViews()},_addKeyEventListener:function(){this.options.appApi.keyApi.pushKeyHandler(this);var e=this.options.appApi.localeApi.getLocale();jQuery.each($(".us-share-message-input"),function(){var i=function(i){i.style.height="19px","ja-jp"===e?i.style.height="24px":-1!==$.inArray(e,["zh-cn","zh-tw"])&&(i.style.height="20px");var t=i.scrollHeight;0===t&&(jQuery(i).show(),t=i.scrollHeight,jQuery(i).hide()),57>t?i.style.height=t-9+"px":(i.style.height="57px",i.style.overflowY="auto")};i(this),jQuery(this).on("keyup input resize",function(){i(this)})})},_removeKeyEventListener:function(){this.options.appApi.keyApi.popKeyHandler(this)},_onKeyDown:function(e){var i=!1,t=e.which,s=!1,n=this._chickletEditControl.$input;return this._chickletEditControl._input._hasFocus()?(13===t?this._autocompleteControl&&(this._autocompleteControl.makeChoice(!1)||_.defer(_.bind(function(){this.abortPGCRequest(),this._setRecipientModels()},this))):9===t?this._autocompleteControl&&!e.shiftKey&&this._autocompleteControl.makeChoice()&&(i=!0):8===t?this._chickletEditControl.hasText()||(i=!0):40===t?this._autocompleteControl&&(this._autocompleteControl.selectDown(),s=!0,i=!0):38===t?this._autocompleteControl&&(this._autocompleteControl.selectUp(),s=!0,i=!0):27===t&&this._autocompleteControl&&(this._autocompleteControl.filteredCollection.length?(this._autocompleteControl.setFilter(void 0),i=!0):i=!1),s?n.attr("aria-activedescendant",this._autocompleteControl.$(".selected").attr("id")):n.removeAttr("aria-activedescendant"),i&&this._consumeEvent(e),i):i},_onKeyup:function(e){var i=!1,t=e.which;return this._chickletEditControl._input._hasFocus()?(32===t&&(i=!0,_.defer(_.bind(function(){this._setRecipientModels(!0)},this))),i):i},_changeTextColor:function(e){e?($("#us-share-address-input").removeClass("theme-share-input-text"),$("#us-share-address-input").addClass("theme-text")):($("#us-share-address-input").removeClass("theme-text"),$("#us-share-address-input").addClass("theme-share-input-text"))},_setAutocompleteFilterValue:function(e){this._autocompleteControl&&(this.options.appApi.sessionApi.isSignedInReader()?""!==e?(this._autocompleteControl.setFilter(e),this.PGCOp.updateSearchString(e),this.PGCOp.run().then(_.bind(function(i){i.length>0&&(this.options.sendFilesUiModel.set("pgcSuggestionsCollection",i),this._autocompleteControl.setFilter(e))},this))):(this.abortPGCRequest(),this._autocompleteControl.setFilter(e)):this._autocompleteControl.setFilter(e))},abortPGCRequest:function(){this.options.appApi.sessionApi.isSignedInReader()&&(this.PGCOp.updateSearchString(""),this.PGCOp.run())},_onRecipientsInput:function(){var e=this._chickletEditControl.val();this._changeTextColor(e),this._setAutocompleteFilterValue(e)},_onRecipientsPaste:function(){_.defer(_.bind(function(){var e=this._chickletEditControl.val();this._changeTextColor(!0),this._setRecipientModels(),this._setAutocompleteFilterValue(e)},this),100)},_onRecipientsBlur:function(){return this._setRecipientModels(),this._autocompleteControl&&this._autocompleteControl.setFilter(void 0),!0},_setRecipientModels:function(e){var i=this._chickletEditControl.val();_.isUndefined(e)||!e||i.match(/.*@.*/)||(i+=" "),this._setRecipientsFromText(i)},_setRecipientsFromText:function(i,t){var s,n,o=this.options,a=o.sendFilesUiModel;if(e.Util.isCEF()&&i.match(/.+\s$/)&&0!==this._autocompleteControl.filteredCollection.length&&!i.match(/.*@.*|.+\s\s$/))return void this._chickletEditControl.setValue(i);if(i=i.replace(/(\r\n|\n|\r)/gm,""),s=i.split(i.match(/(<\S+>)/)?/\s*[,;]+\s*/:/\s*[,;\s]+\s*/),n=a.parseEmailArray(s,t),n.length>0)if(console.log(n[0].get("valid")),0==n[0].get("valid"));else{a.addRecipientsToCollection(n),this._chickletEditControl.clear();var r=this.options.sendFilesUiModel.get("ShareVariant"),d=l.USE,p="Add user";o.appApi.siteCatalystApi.logScEvent([r,d,p]),o.appApi.siteCatalystApi.logScEvent([l.TOOLS,this.options.sendFilesUiModel.get("ShareVariant"),l.EMAIL,l.CHICKLET_ADDED]),a.get("autocomplete_avoided")||(o.appApi.siteCatalystApi.logScEvent([l.TOOLS,this.options.sendFilesUiModel.get("ShareVariant"),l.EMAIL,l.AUTOCOMPLETE,l.AVOIDED]),a.set("autocomplete_avoided",!0))}},_onSubjectInputOnce:function(){var e=this.options.sendFilesUiModel.get("ShareVariant"),i=l.USE,t="Add subject";this.options.appApi.siteCatalystApi.logScEvent([e,i,t]),this.options.sendFilesUiModel.set("is_subject_user_input",!0),this.$shareSubjectinput.removeClass("theme-share-input-text"),this.$shareSubjectinput.addClass("theme-text")},_onMessageInputOnce:function(){var e=this.options.sendFilesUiModel.get("ShareVariant"),i=l.USE,t="Add message";console.log("_onMessageInputOnce"),this.options.appApi.siteCatalystApi.logScEvent([e,i,t]),this.options.sendFilesUiModel.set("is_message_user_input",!0),this.$shareMessageInput.removeClass("theme-share-input-text"),this.$shareMessageInput.addClass("theme-text")},_getSubjectText:function(){var e=this.$shareSubjectinput.val();return e.toString().normalize("NFC")},setSubject:function(e){this.$shareSubjectinput.val(e),this.$shareSubjectinput.attr("aria-label",this._getSubjectInitialAriaLabel())},_getMessageText:function(){var e=this.$shareMessageInput.val();return e.normalize("NFC")},setMessage:function(e){this.$shareMessageInput.val(e),this.$shareMessageInput.attr("aria-label",this._getMessageInitialAriaLabel()),this.$shareMessageInput.trigger("resize")},_onShareAddrHelp:function(){var e=this.options.sendFilesUiModel;e.set({display_individual_help:!0})},_onShareAddrMsgClose:function(){var e=this.options.sendFilesUiModel;e.set({display_individual_help:!1}),this._chickletEditControl.focus(!0)},_onShareAddressClick:function(){this._chickletEditControl.focus(!0)},_onChickletRemoved:function(){this._chickletEditControl.focus(!0)},_computeMaxAvailWidth:function(){var e=this.$(".share-tool-frame").width(),i=this.$(".share-email-list").outerWidth(!0)-this.$(".share-email-list").outerWidth();return e-3*i}}),i.EmailAddrView}),define("pdmplugins/unified-share/js/ops/share-files-op",["core/ac-core","i18n!core/nls/ui-strings","i18n!pdmplugins/unified-share/js/nls/ui-strings","pdmplugins/unified-share/js/ac-unified-share","core/utils/http-util","pdmplugins/unified-share/js/utils/sc-constants"],function(e,i,t,s,n){s.ShareFilesOp=e.Op.extend({run:function(){{var e,i,t,s,o,a,l,r,d=this.options,p=_.clone(d.recipients);d.appApi.dialogApi}if(s=d.shareFiles.map(function(e){var i={id:e.id||e.get("id"),name:e.get("name"),content_type:e.content_type||e.get("content_type"),size:e.get("size")};return i}),d.is_public&&p.push("PARCEL_PUBLIC_SHARING"),e=d.rootUrl+"/a/api/parcels",i="POST",t={files:s,recipients:p,email_subject:d.email_subject,can_make_comments:d.can_make_comments,branding_enabled:d.is_branding},this.options.filesList=s,d.email_message&&(t.email_message=d.email_message),d.uiModel.get("respond_back_options_enabled")&&(t.include_message=!0,t.respond_back=d.uiModel.get("respond_back")),d.is_review){t.can_make_comments=!0;var h=d.sendFilesUiModel.get("deadline"),c=d.sendFilesUiModel.get("reminder");h=h?h.toISOString():"",c=c?c.toISOString():"";var u={};""!==h&&(u.deadline_date=h),""!==c&&(u.reminder_dates=[c]),t.review={review_info:u}}d.sendFilesUiModel.get("instant_link_token")&&(t.public_link_token=d.sendFilesUiModel.get("instant_link_token")),o=JSON.stringify(t),a=n.getRequestHeaders(i),a["Content-Type"]="application/json",l=d.uiModel.get("user_action_id"),r=d.uiModel.get("user_action_name"),l&&(a["x-user-action-id"]=l,a["x-user-action-name"]=r,a["x-user-engagement"]="active");var m=this.options.appApi.rnaApi;
return m.done(_.bind(function(e){e._reviewAPI.invoke("EurekaLogPerformance",["Uploading Finished"])}),this),this.options.parcelCreationPromise=$.Deferred(),$.ajax(e,{data:o,dataType:"json",success:_.bind(function(e){var i=this.options;this.options.fileCount=e.parcel.files.length+"";var t=e.parcel,s={};if(t.review){var n=t.review.url,o=t.invitations,a=0,l="true"===this.options.sendFilesUiModel.get("isModalView")?!0:!1,r=this._gettingInitiatorInvitationId(o);_.isUndefined(r)&&(r=t.parcel_id),r&&(s.reviewUrl=n,s.invitationId=r,s.closeExistingDoc=!0,s.isNewlyCreatedReview=!0,s.closeShareModalView=l,i.is_individual&&(a=i.sendFilesUiModel.getRecipientsArray().length),s.numReviewers=a)}var d=!0;if("ACTIVE"===t.state)if(d=!1,this.options.appApi.rnaApi.done(_.bind(function(e){e._reviewAPI.invoke("EurekaLogPerformance",["Parcel Marked ACTIVE"])}),this),this._logData(t.parcel_id,i,"Success"),i.is_review)this.options.appApi.rnaApi.done(function(e){i.is_individual?e.assetApi({methodName:"openEurekaFile",methodArgs:s}):i.sendFilesUiModel.set("openEurekaFileArgs",s),e.stApi.setLastSharePaneMode(1),e.stApi.UnifiedShareSuccess("review")}),this.options.parcelCreationPromise.resolve(e);else{this._logData(i.parcel_id,i,"Success"),this.options.appApi.rnaApi.done(_.bind(function(e){e.stApi.setLastSharePaneMode(0),e.stApi.UnifiedShareSuccess("view")},this)),this.options.parcelCreationPromise.resolve(e);var p=this.options.filesList[0].name,h=p.lastIndexOf(".");if("pdf"!==p.substr(h)){var c=this.options.filesList[0].id;this._updateLastAccessDate(c)}}if(d){var p=this.options.filesList[0].name,h=p.lastIndexOf(".");if("pdf"!==p.substr(h)){var c=this.options.filesList[0].id;this._updateLastAccessDate(c)}if(this.options.pollCount=1,this.options.MAX_POLL_COUNT=50,this.options.openEurekaFileArgs=s,this.options.parcel_id=t.parcel_id,i.is_review){var u=this.options.appApi.rnaApi;u.done(_.bind(function(e){e._reviewAPI.invoke("EurekaLogPerformance",["Review Creation Finished Polling Started"])}),this),setTimeout(_.bind(this._pollReviewParcel,this),1e3)}else this.options.postResponseParcel=t,this.options.MAX_POLL_COUNT=Math.ceil(1.5*this.options.MAX_POLL_COUNT),setTimeout(_.bind(this._pollViewsParcel,this),1e3)}},this),complete:_.bind(function(){},this),error:_.bind(function(e){this._logData(void 0,this.options,"Error",e),this.options.parcelCreationPromise.reject(e)},this),global:!1,headers:a,type:i}),this.options.parcelCreationPromise},_updateLastAccessDate:function(e){var i,t,s,o;i=Ac.discoveryUrisModel.getPutMetaDataUri(),i=i.replace("{+asset_id}",e),i=i.concat("/last_access"),t="PUT",s=n.getRequestHeaders(t),s["Content-Type"]=Ac.discoveryUrisModel.getPutMetaDataContentType(),o=JSON.stringify({last_access:""}),$.ajax(i,{dataType:"json",success:_.bind(function(){},this),error:_.bind(function(){},this),data:o,global:!1,headers:s,type:t})},_pollReviewParcel:function(){var e,i,t,s=this.options.parcel_id;e=this.options.rootUrl+"/a/api/parcels/"+s,i="GET",t=n.getRequestHeaders(i),$.ajax(e,{dataType:"json",success:_.bind(function(e,i,t){var s=this.options;if("ACTIVE"===e.parcels[0].state){this.options.appApi.rnaApi.done(_.bind(function(e){e._reviewAPI.invoke("EurekaLogPerformance",["Parcel Marked ACTIVE"])}),this),this._logData(s.parcel_id,s,"Success"),this.options.appApi.rnaApi.done(function(e){s.is_individual?e.assetApi({methodName:"openEurekaFile",methodArgs:s.openEurekaFileArgs}):s.sendFilesUiModel.set("openEurekaFileArgs",s.openEurekaFileArgs),e.stApi.setLastSharePaneMode(1),e.stApi.UnifiedShareSuccess("review")});var n={};n.parcel=e.parcels[0],this.options.parcelCreationPromise.resolve(n)}else"PENDING"===e.parcels[0].state&&s.pollCount<=s.MAX_POLL_COUNT?(s.pollCount++,setTimeout(_.bind(this._pollReviewParcel,this),2e3)):(this._showShareError(),this.options.parcelCreationPromise.reject(t))},this),error:_.bind(function(e){this._logData(void 0,this.options,"Error",e),this.options.parcelCreationPromise.reject(e)},this),global:!1,headers:t,type:i})},_pollParcelStandalone:function(){var e,i,t,s=this.options.parcel_id;e=this.options.rootUrl+"/a/api/parcels/"+s,i="GET",t=n.getRequestHeaders(i),$.ajax(e,{dataType:"json",success:_.bind(function(e,i,t){var s=this.options;if("ACTIVE"===e.parcels[0].state){this.options.fileCount=e.parcels[0].files.length+"";var n={};n.parcel=e.parcels[0],this.options.parcelCreationPromise.resolve(n)}else"PENDING"===e.parcels[0].state&&s.pollCount<=s.MAX_POLL_COUNT?(s.pollCount++,setTimeout(_.bind(this._pollParcelStandalone,this),2e3)):this.options.parcelCreationPromise.reject(t,e)},this),error:_.bind(function(e){this._logData(void 0,this.options,"Error",e),this.options.parcelCreationPromise.reject(e)},this),global:!1,headers:t,type:i})},_pollViewsParcelRequestBodyForSCUser:function(){var e={scope:["parcel"],subscope:["document_cloud"],ownership_types:["sender"],sort_orderby:"last_access_date",sort_order:"desc",limit:10};return e},_pollViewsParcelRequestBodyForACPUser:function(){var e={fetch_fields:{includes:["api:metadata/application$$docCloud:documentCustomMetadata","api:metadata/peruser#mine$$shell:favorite","api:metadata/peruser#mine$$shell:lastAccessDate","api:metadata/peruser#mine$$docCloud:userCustomMetadata","collab_metadata.collaborators","collab_metadata.shared_by"]},scope:["creative_cloud"],sort_orderby:"api:metadata/peruser#mine$$shell:lastAccessDate",sort_order:"desc",shared_by_me:!0,start_index:0,creative_cloud_asset_type:["asset","collection"],op_none_of:[{"api:metadata/application$$shell:visibility":["hiddenSelf","hiddenRecursive"]},{"app_metadata$$project:directoryType":"team"},{op_field_exists:["app_metadata$$cc:inherited$$cc:team","app_metadata$$review:sourceAsset$$dc:format"]}],creative_cloud_toplevel_collection_name:"cloud-content",limit:10,asset_id_opacity:!0};return e},_pollViewsParcel:function(){var e,i,t,s=this.options.parcel_id;e=this.options.rootUrl+"/a/api/parcels/"+s,i="GET",t=n.getRequestHeaders(i),$.ajax(e,{dataType:"json",success:_.bind(function(e,i,t){var s=this.options;if("ACTIVE"===e.parcels[0].state){this.options.fileCount=e.parcels[0].files.length+"",this._logData(s.parcel_id,s,"Success"),this.options.appApi.rnaApi.done(_.bind(function(e){e.stApi.setLastSharePaneMode(0),e.stApi.UnifiedShareSuccess("view")},this));var n={};this.options.postResponseParcel.state="ACTIVE",n.parcel=this.options.postResponseParcel,this.options.parcelCreationPromise.resolve(n)}else"PENDING"===e.parcels[0].state&&s.pollCount<=s.MAX_POLL_COUNT?(s.pollCount++,setTimeout(_.bind(this._pollViewsParcel,this),2e3*Math.pow(2,s.pollCount-2))):this.options.parcelCreationPromise.reject(t,e)},this),error:_.bind(function(e){this._logData(void 0,this.options,"Error",e),this.options.parcelCreationPromise.reject(e)},this),global:!1,headers:t,type:i})},_showShareError:function(){var e="true"===this.options.sendFilesUiModel.get("isModalView")?!0:!1;e||this.options.appApi.dialogApi.displayTextAlert(this.options.appApi.dialogApi.SEVERITY_ERROR,t.SHARE_UPLOAD_ERROR_TITLE,t.SHARE_UPLOAD_ERROR_MSG)},_computeSharingType:function(e,i){var t="";return t+=i?"Personalized":"Public",t+=" - ",t+=e?"Can Comment":"Can View Only"},_gettingInitiatorInvitationId:function(e){var i;if(this.options.appApi.sessionApi.isSignedIn()){var t=this.options.appApi.usersMeApi.getUserIdentity().email;_.isUndefined(t)||$.each(e,function(e,s){return s.recipient_email===t||s.is_public?i=s.invitation_id:void 0})}return i},_logData:function(e,i,t,s){var n={};n.Status=t,"Success"===t?(_.isUndefined(e)||(n.parcelid=e),n.CountFileAdded=this.options.fileCount,n.CountUserAdded=i.is_individual?i.sendFilesUiModel.getRecipientsArray().length+"":"NA"):(n.ErrorCode=s.status+"",n.ErrorMessage=s.responseText),n.SharingType=this._computeSharingType(i.is_review,i.is_individual),i.sendFilesUiModel.get("ShareVariant")&&(n.ShareVariant=i.sendFilesUiModel.get("ShareVariant")),this.options.appApi.rnaApi.done(_.bind(function(e){var i={methodName:"logUnifiedShareSenderData",methodArgs:[n]};e.stApi.invokeMethod(i)},this))}})}),define("pdmplugins/unified-share/js/views/us-share-tab-view",["core/ac-core","files/ac-files","core/utils/file-types","pdmplugins/unified-share/js/ac-unified-share","pdmplugins/unified-share/js/templates/us-share-tab-view-template","i18n!pdmplugins/unified-share/js/nls/ui-strings","pdmplugins/unified-share/js/utils/sc-constants","pdmplugins/unified-share/js/utils/ts-utils","pdmplugins/unified-share/js/ops/desktop-do-upload-op","pdmplugins/unified-share/js/ops/finding-upload-folder-op","pdmplugins/unified-share/js/ops/begin-desktop-upload-op","pdmplugins/unified-share/js/ops/update-dirty-doc-state-op","pdmplugins/unified-share/js/views/us-email-addr-view","pdmplugins/unified-share/js/ops/share-files-op","pdmplugins/unified-share/js/ops/close-app-op","pdmplugins/unified-share/js/ops/upload-and-run-sfs-op","pdmplugins/unified-share/js/ops/check-deadline-reminder-error-op"],function(e,i,t,s,n,o,a,l){return s.ShareTabView=e.View.extend({events:{"click .share-files-button":"_onShareClickDebounced","click #close-share-button":"_onClickClose","click .share-more-options":"_onAdvancedSignOptions","input  #us-share-subject-input":"_onSubjectInput","input  #us-share-message-input":"_onMessageInput","paste  #us-share-subject-input":"_onSubjectPaste","paste  #us-share-message-input":"_onMessagePaste","blur  #us-share-subject-input":"_onSubjectBlur","blur  #us-share-message-input":"_onMessageBlur"},initialize:function(){e.View.prototype.initialize.call(this),this._template=_.template(n)},render:function(){e.View.prototype.render.call(this),0===this.$el.children().length&&(this.$el.html(this._template({SHARE_BUTTON:o.SHARE_BUTTON,MORE_OPTIONS:o.MORE_OPTIONS,MORE_OPTIONS_TOOLTIP:o.ADVANCED_BUTTON_TOOLTIP,SEND_INVITATIONS:o.SEND_BUTTON_TOOLTIP,PLACE_HOLDER_ALT:o.PLACE_HOLDER_ALT,PLACE_HOLDER_TEXT:o.PLACE_HOLDER_TEXT_2,SHARE_CLOSE:o.SHARE_SUCCESS_CLOSE})),this._initWrappers()),this._addUiModelEventListeners(),this._renderChildViews(),this._processRecipients(!0),this._toggleAddFilesButton(),this._togglePlaceHolder(),this._toggleBetweenSendAndNext()},_initWrappers:function(){this.$placeholderImageSend=this.$("#place-holder-img-send"),this.$placeholderImageReview=this.$("#place-holder-img-review"),this.$placeholderImageSign=this.$("#place-holder-img-sign"),this.$emailAddressView=this.$("#email-address-template-container"),this.$shareButton=this.$(".share-files-button"),this.$signMoreOptionButton=this.$(".share-more-options"),this.$imagePlaceholderBox=this.$("#image-placeholder-box"),this.$closeShareButton=this.$("#close-share-button"),this.$shareButtonBar=this.$(".share-button-bar")},_renderChildViews:function(){this._renderChildView("_emailAddressView",s.EmailAddrView,this.$emailAddressView)},_addUiModelEventListeners:function(){var e=this.options.sendFilesUiModel;e.get("email_addr_collection").on("all",this._onRecipientsChange),e.on("change:local_file_objects",this._onFilesChange),e.get("metadata_collection").on("all",this._onFilesChange),e.on("change:connector_file_objects",this._onFilesChange),e.on("change:ccloud_file_objects",this._onFilesChange),e.on("change:us_mode",this._onModeChange),e.on("change:US_tab_open",this._onUsTabChanged),this.options.canSignUiModel.on("change:can_sign_state",this._onCanSignStateChanged),this.options.canSignUiModel.on("change:advancedSignClick",this._onAdvancedSignOptionsClickDebounced)},_processRecipients:function(){var e=this.options.sendFilesUiModel.get("email_addr_collection");this._toggleSendButton(),e.length>0?(this.$shareButtonBar.show(),this.$shareButton.show()):(this.$shareButtonBar.hide(),this.$shareButton.hide())},_onRecipientsChange:function(){this._onDebouncedRecipientsChange()},_onFilesChange:function(){this._toggleSendButton()},_onModeChange:function(){this._toggleAddFilesButton(),this._checkMaximumFiles(),this._toggleMessage(),this._togglePlaceHolder(),this._toggleBetweenSendAndNext()},_onUsTabChanged:function(){console.log("us-share-tab-view : _onUsTabChanged"),this._toggleAddFilesButton(),this._toggleBetweenSendAndNext(),this._checkMaximumFiles(),this._toggleMessage()},_onCanSignStateChanged:function(){var e=this.options.canSignUiModel.get("can_sign_state");switch(console.log("state changed to : "+e),e){case"authorising":break;case"authorised":var i=this.options.esAuthUiModel.get("access_token");console.log("Authorised , authToken generated : "+String(i));break;case"uploading":this.options.sendFilesUiModel.setShareState("Sharing");break;case"uploaded":console.log("uploaded : all files uploaded to echo sign server ");break;case"failed":console.log("uploading or authorising failed"),this.options.appApi.displayApi.showModal(!1),this.options.sendFilesUiModel.setShareState("preShare")}},_toggleBetweenSendAndNext:function(){var e=this.options.sendFilesUiModel.get("us_mode");"#sign-mode"==e?(this.$shareButton.text(o.CONTINUE_BUTTON),this.$signMoreOptionButton.removeClass("hidden")):(this.$shareButton.text(o.SHARE_BUTTON),this.$signMoreOptionButton.addClass("hidden"))},_checkMaximumFiles:function(){var e=this.options.sendFilesUiModel,i=e.get("us_mode"),t=e.get("US_tab_open");if("share"===t){if("#review-mode"===i&&e.isMultipleFilesSelected()){var s=this.options.appApi.dialogApi,n=o.SHARE_TOO_MANY_FILES_DLG_TITLE,a=o.ERROR_MULTIPLE_FILES_REVIEW1+" "+o.ERROR_MULTIPLE_FILES_REVIEW2;return $("#share_send_file").prop("checked",!0),e.setUSMode("#send-mode"),e.setCLMode("#send-mode"),s.displayHtmlAlert(s.SEVERITY_INFORMATIONAL,n,a,o.SHARE_SUCCESS_CLOSE),!1}var l,e=this.options.sendFilesUiModel,r=e.get("limits_model"),i=e.get("us_mode"),d=e.get("local_file_objects").length+e.get("metadata_collection").length;if(l=_.isUndefined(r)?50:r.get("#send-mode"===i?"max_files":"max_review_files"),d>l){var s=this.options.appApi.dialogApi,p=o.SHARE_TOO_MANY_FILES_DLG_TITLE,h=_.template(o.SHARE_TOO_MANY_FILES_DLG_MSG,{maxNumber:l});return s.displayTextAlert(s.SEVERITY_WARNING,p,h),!1}}return!0},_checkNameLength:function(e){var i,t=this.options.sendFilesUiModel,s=t.get("limits_model");if(i=_.isUndefined(s)?1e3:s.get("max_subject_length"),e.length>i){var n=this.options.appApi.dialogApi,a=o.SHARE_NAME_SIZE_ERROR_DLG_TITLE,l=_.template(o.SHARE_NAME_SIZE_ERROR_DLG_MSG,{maxNumber:i});return n.displayTextAlert(n.SEVERITY_WARNING,a,l),!1}return!0},_checkMessageLength:function(e){var i,t=this.options.sendFilesUiModel,s=t.get("limits_model");if(i=_.isUndefined(s)?1e3:s.get("max_message_length"),e.length>i){var n=this.options.appApi.dialogApi,a=o.SHARE_MSG_SIZE_ERROR_DLG_TITLE,l=_.template(o.SHARE_MSG_SIZE_ERROR_DLG_MSG,{maxNumber:i});return n.displayTextAlert(n.SEVERITY_WARNING,a,l),!1}return!0},_toggleAddFilesButton:function(){{var e=this.options.sendFilesUiModel,i=(e.get("us_mode"),e.get("allow_comments"),e.get("US_tab_open"));e.get("cl_active_view")}"attachToEmail"===i?e.set("enable_add_files",!0):e.set("enable_add_files",!1),e.trigger("change:enable_add_files")},_toggleSubject:function(){var e=this.options.sendFilesUiModel,i=(e.get("us_mode"),e.get("is_subject_user_input")),t=this._getSubjectText(!1),s="";s=i?t:o.SHARE_INITIAL_SUBJECT,this._emailAddressView.setSubject(s),e.setSubjectText(s)},_toggleMessage:function(){var e=this.options.sendFilesUiModel,i=e.get("us_mode"),t=e.get("is_message_user_input"),s=this._getMessageText(),n="";t?n=s:(n="#review-mode"===i?o.SHARE_MESSAGE_PROMPT_REVIEW_4:o.SHARE_MESSAGE_PROMPT2,n="#sign-mode"===i?o.SHARE_MESSAGE_PROMPT_SIGN:n),this._emailAddressView.setMessage(n),e.setMessageText(n)},_toggleSendButton:function(){var e=this.options.sendFilesUiModel,i=e.get("local_file_objects"),t=this.options.sendFilesUiModel.get("email_addr_collection"),s=e.get("metadata_collection"),n=e.get("ccloud_file_objects");0===i.length&&0===s.length||0===t.length||n.length>0?this.$shareButton.addClass("disabled").attr("disabled","disabled"):this.$shareButton.removeClass("disabled").removeAttr("disabled")},_togglePlaceHolder:function(){var e=this.options.sendFilesUiModel,i=e.get("us_mode");this.$placeholderImageSend.hide(),this.$placeholderImageReview.hide(),this.$placeholderImageSign.hide(),"#send-mode"===i?this.$placeholderImageSend.show():"#review-mode"===i?this.$placeholderImageReview.show():this.$placeholderImageSign.show()},_onDebouncedRecipientsChange:function(){this._processRecipients(!0)},_onClickClose:function(){var e=new s.CloseAppOp(this.options);e.run()},_onShareClickDebounced:function(){this.options.appApi.rnaApi.done(function(e){e.logPerformance("ShareAFile","start")}),e.Util.isCEF()?(this._debouncedShareClick||(this._debouncedShareClick=_.debounce(this._onShareClick,1e3,!0)),this._debouncedShareClick()):this._onShareClick()},_reorderCollections:function(e){var i=[],t=$.Deferred(),s=0,n=[],o=this.options.sendFilesUiModel,l=o.get("limits_model"),r=0;if(!this.options.localFiles.length)return t.resolve().promise();if(this.avFlag=!1,this.formFlag=!1,_.each(this.options.localFiles,_.bind(function(t){var a;"postUpload"===e&&(t.id=this.options.assetIdarray[s],a=this.options.sendFilesUiModel.addFilesToCollection([t.id],void 0,o.get("share_collection"),!0,!0),i.push(a[0]),s++),"preUpload"===e&&(_.isUndefined(t.get("path"))||"\\\\www.adobe.com\\go\\homeacrordrunified18_2018"!==t.get("path")&&"http://www.adobe.com/go/homeacrordrunified18_2018"!==t.get("path")?_.isEmpty(t.get("ext"))?(this.options.sendFilesUiModel.removeLocalFile([t]),a=this._showErrorDialogMsg("noExtension"),i.push(a)):_.isEmpty(t.get("assetId"))||this.options.sendFilesUiModel.get("bHFileIsDirty")&&t.get("assetId")===this.options.sendFilesUiModel.get("openedFileAssetId")?!l.get("can_send_av")&&o.hasAudioVideoExt(t.get("ext"))?(this.avFlag=!0,n[r++]=t,a=$.Deferred().resolve().promise(),i.push(a)):o.get("enable_form_send")||"form"!==t.get("ext")?(a=$.Deferred().resolve().promise(),i.push(a)):(this.formFlag=!0,n[r++]=t,a=$.Deferred().resolve().promise(),i.push(a)):(this.options.sendFilesUiModel.removeLocalFile([t]),a=this.options.sendFilesUiModel.addFilesToCollection([t.get("assetId")]),i.push(a[0])):console.log("Welcome.pdf"))},this)),n.length){var d;this.options.appApi.siteCatalystApi.logScEvent([a.TOOLS,this.options.sendFilesUiModel.get("ShareVariant"),a.FILES_SHARED_DLG,a.DISALLOWED,a.WARNING,a.SHOWN]),d=this.options.isType2OR3?this._showErrorDialogMsg("type2or3",n):this.avFlag&&!this.formFlag?this._showErrorDialogMsg("avError",n):!this.avFlag&&this.formFlag?this._showErrorDialogMsg("fileTypeError",n,"formError"):this._showErrorDialogMsg("fileTypeError",n,"avFormError"),i.push(d)}return $.when.apply($,i).then(_.bind(function(){this.options.localFiles=this.options.sendFilesUiModel.get("local_file_objects"),this.options.files=this.options.sendFilesUiModel.get("metadata_collection"),t.resolve()},this),_.bind(function(){t.reject()},this)),t.promise()},_showErrorDialogMsg:function(e,i,t){{var s,n,l=this.options.appApi.dialogApi;this.options.sendFilesUiModel.get("limits_model")}if("noExtension"===e)return s=o.ADD_FILES_REJECTED_TITLE,n=o.ADD_FILES_REJECTED_MESSAGE,l.displayHtmlAlert(l.SEVERITY_WARNING,s,n,o.SHARE_SUCCESS_CLOSE);if("avError"===e){var r=_.extend({},{okButtonClass:"us-upsell-learn-more",cancelButtonClass:"us-upsell-close"});s=o.SHARE_AV_UPSELL_TITLE,n=o.SHARE_AV_UPSELL_MSG;var d=l.displayHtmlAlert(l.SEVERITY_WARNING,s,n,o.LEARN_MORE,o.CLOSE_STRING,r);return $(".alert-dlg-buttons-rhp").css({"text-align":"right",direction:"rtl"}),$(".us-upsell-learn-more").css({"padding-left":"15px","padding-right":"15px","margin-left":"10px","margin-right":"5px"}),d.then(_.bind(function(){return this._onUpsell(),$.Deferred().reject().promise()},this),_.bind(function(){return _.each(i,_.bind(function(e){this.options.sendFilesUiModel.removeLocalFile([e])},this)),$.Deferred().reject().promise()},this)).always(_.bind(function(){$(".alert-dlg-buttons-rhp").css({"text-align":"center",direction:"ltr"})},this))}if("type2or3"===e){var s=o.COULD_NOT_SEND,n=o.ENTERPRISE_USERS_ACCESS_ERROR;return l.displayHtmlAlert(l.SEVERITY_WARNING,s,n,o.SHARE_SUCCESS_CLOSE).then(_.bind(function(){return _.each(i,_.bind(function(e){this.options.sendFilesUiModel.removeLocalFile([e])},this)),$.Deferred().reject().promise()},this))}return"fileTypeError"===e?(s=o.SEND_UPSELL_UPGRADE_REQUIRED,"formError"===t?(n=o.SHARE_FORMS_ERROR_DESKTOP,this.options.appApi.siteCatalystApi.logScEvent([a.TOOLS,this.options.sendFilesUiModel.get("ShareVariant"),a.ATTEMPTED_TO_SHARE_FORM])):"avFormError"===t&&(n=o.SHARE_AV_FORMS_ERROR+o.SHARE_AV_UPGRADE_MESSAGE),l.displayHtmlAlert(l.SEVERITY_WARNING,s,n,o.SHARE_SUCCESS_CLOSE).then(_.bind(function(){return _.each(i,_.bind(function(e){this.options.sendFilesUiModel.removeLocalFile([e])},this)),$.Deferred().reject().promise()},this))):void 0},_onUpsell:function(i){var t=this.options.limitsModel,s=t.get("upgrade_url");this.options.appApi.rnaApi.done(_.bind(function(e){e.openDecoratedUrl(s)},this)),e.Util.isCEF()&&this.options.appApi.sessionApi.ensureSignedIn()},_acceptPGCRecipients:function(i){var t=[];i.map(_.bind(function(i){if(_.isUndefined(i.get("token"))){var s=_.extend({},this.options,{newContactEmail:i.get("email")});e.opFactory.create("AcceptingNewPGCSuggestionOp",s).run()}else t.push(i.get("token"))},this));var s=_.extend({},this.options,{tokens:t});e.opFactory.create("AcceptingPGCSuggestionsOp",s).run()},_onShareClick:function(){if("onlyRHP"===this.options.sendFilesUiModel.get("layout")&&this.options.sendFilesUiModel.get("checkForSave")===!0)this.options.appApi.rnaApi.done(_.bind(function(e){e.rnaServicesAPI.checkOpenedDocAndPromptForSaveApi().then(_.bind(function(){var e=this.options.sendFilesUiModel.get("us_mode");"#sign-mode"===e?this._onShareNextClick("AUTHORING"):this._onShareSendClick()},this))},this));else{var e=this.options.sendFilesUiModel.get("us_mode");"#sign-mode"===e?this._onShareNextClick("AUTHORING"):this._onShareSendClick()}},_processSFSClick:function(e){console.log("_processSFSClick() reached ");var i=new s.UploadAndRunSFSOp(this.options),t=this.options.appApi.usersMeApi.getUserIdentity().email;_.isUndefined(t)||(this.options.sendFilesUiModel.isSenderOnlyRecipient(t)?this.options.appApi.dialogApi.displayTextAlert(this.options.appApi.dialogApi.SEVERITY_ERROR,o.ERROR_STRING,o.ERROR_SINGLE_SIGNER_IS_SENDER):this.options.appApi.rnaApi.done(_.bind(function(t){t.esApi.isAnySFSWorkflowsRunning().then(_.bind(function(s){if(s)this.options.appApi.dialogApi.displayTextAlert(this.options.appApi.dialogApi.SEVERITY_ERROR,o.ERROR_STRING,o.SFS_MULTIPLE_WORKFLOWS_DENIED);else{this._setSFSWorkflowInProgress();var n=this.options.sendFilesUiModel.getRecipientsArray(),a=_.clone(this.options.autoCCollection),l=this.options.autoCCollection.filter(function(e){return _.contains(n,e.get("email"))});a.reset(l),_.each(n,function(e){a.add({email:e})}),this._acceptPGCRecipients(a),i.run().then(_.bind(function(){console.log("upload Success"),this._clearSFSWorkflowInProgress(),t.stApi.setLastSharePaneMode(2),this._launchSFSWithData(e),this.options.appApi.displayApi.showModal(!1)},this),_.bind(function(e){console.log("upload failed"+e),this._clearSFSWorkflowInProgress(),this.options.appApi.displayApi.showModal(!1),this._onCanSignUploadError(e)},this))}},this))},this)))},_onShareNextClick:function(e){return this.options.appApi.siteCatalystApi.logScEvent("AUTHORING"===e?[a.GET_SIG,a.SHARE_BUTTON,a.CLICKED]:[a.GET_SIG,a.MORE_OPTIONS,a.CLICKED]),this.options.appApi.networkConnectivityApi.isOnline()?void(this.options.appApi.sessionApi.isSignedIn()?(console.log("User is signed in"),this._processSFSClick(e)):this.options.appApi.sessionApi.ensureSignedIn().then(_.bind(function(){this._processSFSClick(e)},this))):(this._renderOfflineView(),void this.options.appApi.dialogApi.displayTextAlert(this.options.appApi.dialogApi.SEVERITY_ERROR,o.SHARE_NO_INTERNET_CONNECTION,o.SHARE_NO_INTERNET_CONNECTION_MSG))},_onCanSignUploadError:function(){this._onShareError()},_onAdvancedSignOptionsClickDebounced:function(){e.Util.isCEF()?(this._debouncedAdvSign||(this._debouncedAdvSign=_.debounce(this._onAdvancedSignOptions,1e3,!0)),this._debouncedAdvSign()):this._onAdvancedSignOptions()},_onAdvancedSignOptions:function(){this.options.sendFilesUiModel.get("checkForSave")?this.options.appApi.rnaApi.done(_.bind(function(e){e.rnaServicesAPI.checkOpenedDocAndPromptForSaveApi().then(_.bind(function(){this._onShareNextClick("DRAFT")},this))},this)):this._onShareNextClick("DRAFT")},_onShareSendClick:function(){var i,t,n,l,r,d,p,h,c,u,m,E,g,S,f,A,v,R=[],b=[];if(this.$shareButton.hasClass("disabled"))return void this.options.appApi.siteCatalystApi.logScEvent([a.TOOLS,this.options.sendFilesUiModel.get("ShareVariant"),a.SHARE_BUTTON,a.DISABLED]);if(0!=this._checkMaximumFiles()){var I=this.options.sendFilesUiModel.get("us_mode");if(this.options.appApi.siteCatalystApi.logScEvent([a.TOOLS,this.options.sendFilesUiModel.get("ShareVariant"),a.SHARE_BUTTON,a.CLICKED,I]),v=new s.CheckDeadlineReminderErrorOp({uiModel:this.options.sendFilesUiModel,appApi:this.options.appApi,returnPromise:!1}),0!=v.run()){if(n=this.options.sendFilesUiModel,l=n.get("metadata_collection"),p=n.get("local_file_objects"),r="createLink"===n.get("US_tab_open"),d="share"===n.get("US_tab_open"),u=n.get("customize_recipient_page"),d){R=n.getRecipientsArray();var M=_.clone(this.options.autoCCollection),C=this.options.autoCCollection.filter(function(e){return _.contains(R,e.get("email"))});M.reset(C),_.each(R,function(e){M.add({email:e})}),this._acceptPGCRecipients(M),A=!1}h=this._getSubjectText(!0),""===h.trim()&&(h=this.options.sendFilesUiModel.get("cl_subject_text")),c=this._getMessageText();var L="#review-mode"==n.get("us_mode");if(this._checkNameLength(h)&&this._checkMessageLength(c)&&(e.Util.isCEF()||this._checkMaximumRecipients(R)!==!1))if(i={uiModel:n,files:l,localFiles:p,recipients:R,is_public:r,is_individual:d,can_make_comments:A,email_subject:h,email_message:c,displayApi:this.options.appApi.displayApi,appApi:this.options.appApi,rootView:this.options.rootView,is_branding:u,sendFilesUiModel:this.options.sendFilesUiModel,assetIdarray:b,is_review:L},t=_.extend({},{filesModelBackup:l.clone(),localFilesBackup:p}),e.Util.isCEF()&&(i=_.extend({},i,{recipientsAreFinalized:!0})),m=_.bind(function(){var i,l,r=this.options,d=new s.UpdateDirtyDocState(this.options);if(e.Util.isCEF())if(L){var u=n.get("deadline")?n.get("deadline").toISOString():"",m=n.get("reminder")?n.get("reminder").toISOString():"";this.options.appApi.rnaApi.done(_.bind(function(e){var i=!1,t=this.options.sendFilesUiModel.get("limits_model");!_.isUndefined(t)&&t.get("original_sharing_enabled")&&(i=!0);var n={email_message:c,email_subject:h,deadLineDate:u,reminderDate:m,participants:R,original_sharing_enabled:i};e.stApi.UnifiedShareInitiateAsyncReview(n),s.CloseAppOp(this.options).run()},this))}else this.options.sendFilesUiModel.get("isShareViewSyncEnabled")?this.options.appApi.rnaApi.done(_.bind(function(e){var i=!1,t=this.options.sendFilesUiModel.get("limits_model");!_.isUndefined(t)&&t.get("original_sharing_enabled")&&(i=!0);var n={email_message:c,email_subject:h,participants:R,original_sharing_enabled:i};e.stApi.UnifiedShareInitiateAsyncView(n),s.CloseAppOp(this.options).run()},this)):d.run().then(_.bind(function(){this._reorderCollections("preUpload").then(_.bind(function(){r=this.options,i=new s.BeginDesktopUploadOp(r),f=new s.FindingUploadFolderOp(r),l=_.bind(function(){r.parentId=f.id,_.isUndefined(f.persistence)||(r.persistence=f.persistence),n.get("local_file_objects").length>0&&n.set("share_loader_text",o.SHARE_LOADER_UPLOAD2),i.run().then(_.bind(function(){this._onShareClickFinish(r,t)},this),_.bind(function(){this._onShareError(t,a.ERROR_UPLOAD),this._resetAfterError(t)},this))},this),p.length?f.run().then(l,_.bind(function(){this._onShareError(t,a.NO_CONNECTIVITY),this._resetAfterError(t)},this)):l()},this),_.bind(function(){this._resetAfterError(t)},this))},this));else i=new s.DoUploadOp(r),f=new s.FindingUploadFolderOp(r),l=_.bind(function(){r.parentId=f.id,_.isUndefined(f.persistence)||(r.persistence=f.persistence),i.run().then(_.bind(function(){this._onShareClickFinish(r)},this),_.bind(function(){this._onShareError(t,a.ERROR_UPLOAD),this._resetAfterError(t)},this))},this),p.length?f.run().then(l):l()},this),S=_.bind(function(){var e=this.options.appApi.dialogApi,i=_.template('<div class = "learn-more-sharing"><%=LEARN_MORE%></div>')({LEARN_MORE:o.LEARN_MORE}),s=o.FILE_CANT_BE_SENT,n=o.SHARE_ERROR_ENTERPRISE_SEND_DLG_MSG+i,l=this.options.sendFilesUiModel.get("ShareVariant"),r=a.USE,d="Sharing Restriction Error Prompt Shown";this.options.appApi.siteCatalystApi.logScEvent([l,r,d]),e.displayHtmlAlert(e.SEVERITY_WARNING,s,n),$(".learn-more-sharing").click(this._onSharingLearnMore),this._resetAfterError(t)},this),E=_.bind(function(e){if(e){var i=this.options.limitsModel.get("restrictions_white_list");if(-1!==$.inArray("all",i))m();else if(-1!==$.inArray("none",i))S();else{var t=this.options.sendFilesUiModel.getRecipientsArray(),s=_.find(t,function(e){var t=e.split("@").pop();return-1===$.inArray(t,i)?!0:!1});_.isUndefined(s)?m():S()}}else m()},this),g=_.bind(function(){n.setShareState("Sharing");var e=this.options.appApi.rnaApi;e.done(_.bind(function(e){E(e.isFeatRunning()?!1:!1)},this))},this),this.options=_.extend({},this.options,i),e.Util.isCEF()){if(!this.options.appApi.networkConnectivityApi.isOnline())return this._renderOfflineView(),this._onShareError(t,a.NO_CONNECTIVITY),void this._resetAfterError(t);this.options.appApi.sessionApi.isSignedInReader()&&n.setShareState("Sharing"),this.options.appApi.sessionApi.ensureSignedIn().then(_.bind(function(){n.setShareState("Sharing"),setTimeout(_.bind(function(){this._resolveRecipientsAddressesList(this.options.recipients).always(_.bind(function(){this.options=_.extend({},this.options,this._postSignInFunction()),this.options.readRegistry=!1,s.opFactory.create("DesktopGettingSubscriptionLevels",this.options).run().then(_.bind(function(){return this._checkMaximumRecipients(this.options.recipients)===!1?void this._resetAfterError(t):void g()},this),_.bind(function(){this._onShareError(t,a.NO_CONNECTIVITY),this._resetAfterError(t)},this))},this))},this),100)},this),_.bind(function(e){e&&"NoAccessToPdfServices"===e.errorString&&this._displayNoAccessToUser(e.errorCode)},this))}else this.options.appApi.sessionApi.isSignedIn()?m():this.options.appApi.sessionApi.ensureSignedIn().then(_.bind(function(){s.opFactory.create("GettingAuthenticatedModelsOp",this.options).run().then(m)},this))}}},_onShareClickFinish:function(i,t){{var n,l,r,d=this.options.sendFilesUiModel.get("share_collection"),p=this.options.sendFilesUiModel.get("metadata_collection");this.options.brandingModel}d.reset(),p.each(_.bind(function(e){var i=new s.FileMetadataModel;i.set(_.clone(e.attributes)),d.add(i)},this)),this.options=_.extend({},this.options,i),r=_.extend({shareFiles:d},i),this._reorderCollections("postUpload").then(_.bind(function(){r.shareFiles.length&&(n=new s.ShareFilesOp(r),n.run().then(_.bind(function(e){var i;if(i=_.bind(function(e){var i;e&&(i=$.trim(e.toLowerCase()),this.options.autoCCollection.add({email:i}))},this),_.each(this.options.recipients,i),!this.options.is_review){var t={};t.op="addParcel",t.parcel=e.parcel,this.options.appApi.rnaApi.done(_.bind(function(e){e.stApi.updateInAppDMStateAPI(t)},this))}this.options.sendFilesUiModel.set({active_view:"success",parcel:e.parcel}),this._logFormShareSuccess();var s=this.options.sendFilesUiModel.get("ShareVariant"),n=a.SUCCESS,o="Send";this.options.appApi.siteCatalystApi.logScEvent([s,n,o]),this.options.appApi.displayApi.showModal(!1),this._drawNextPane(),this.$shareButton.show()},this),_.bind(function(i){function s(e){var i={Unauthorized:o.SHARE_UNVERIFIED_ID_MSG,PDFIsPortfolio:o.REVIEW_DISABLE_REASON_PORTFOLIO,PDFIsPasswordProtected:o.REVIEW_DISABLE_PROTECTED,PDFIsCertificateProtected:o.REVIEW_DISABLE_PROTECTED,PDFIsUnknownProtected:o.REVIEW_DISABLE_PROTECTED,PDFIsPolicyProtected:o.REVIEW_DISABLE_PROTECTED,PDFIsPDFA:o.REVIEW_DISABLE_REASON_PDFA,UnsupportedCommentsPDF:o.REVIEW_DISABLE_REASON_UNSUPPORTED_ANNOTS,PDFIsSecure:o.REVIEW_DISABLE_PROTECTED,PDFIsInvalid:o.REVIEW_DISABLE_REASON_INVALID_FILE,InvalidComment:o.REVIEW_DISABLE_REASON_UNSUPPORTED_ANNOTS,InvalidCommentBodyLength:o.REVIEW_DISABLE_INVALID_COMMENT_LENGTH,CommentCountExceeded:o.REVIEW_DISABLE_COMMENT_COUNT_EXCEEDED,CommentsExtractionSizeExceeded:o.REVIEW_DISABLE_COMMENT_EXTRACTION_ERROR,Unknown:o.REVIEW_DISABLE_UNKNOWN_ERROR};
try{var t=JSON.parse(e.responseText);n=t.error.code}catch(s){}if(_.isUndefined(n))try{var t=JSON.parse(e.responseText);n=t.parcels[0].reason_for_failed_state}catch(s){}n&&(r=i[n])}var n,r;s(i);var d=this.options.appApi.dialogApi;if("SendLimitExceeded"===n){var p=this.options.limitsModel.get("can_upgrade_send");if(p)this._displayShareUpsellDialog(o.SHARE_LIMIT_EXCEEDED_DLG_TITLE,o.SHARE_UPSELL_MSG);else if(this.options.limitsModel.get("restrictions"))d.displayHtmlAlert(d.SEVERITY_ERROR,o.SHARE_LIMIT_EXCEEDED_DLG_TITLE,o.SHARE_LIMIT_EXCEEDED_DLG_MSG,o.CLOSE_STRING);else{var h=this.options.sendFilesUiModel.get("ShareVariant"),c=a.USE,u="Invite Send limit reached.";this.options.appApi.siteCatalystApi.logScEvent([h,c,u]);var m=_.template(o.SHARE_RECIPIENTS_LIMIT_PER_DAY_REACHED,{GET_LINK_HTML:_.template("<span id='get-link-hyperlink'><%=GET_LINK %></span>",{GET_LINK:o.SHARE_PUBLIC})});d.displayHtmlAlert(d.SEVERITY_ERROR,o.SHARE_LIMIT_EXCEEDED_DLG_TITLE,m,o.CLOSE_STRING),$("#get-link-hyperlink").on("click",_.bind(function(){this._redirectToGetLink()},this))}}else if("UnsupportedSharingMimeType"===n)d.displayTextAlert(d.SEVERITY_ERROR,o.SHARE_ERROR_UNSUPPORTED_DLG_TITLE,o.SHARE_ERROR_UNSUPPORTED_DLG_MSG);else if(_.isUndefined(r)){var E=this.options.sendFilesUiModel,g=E.get("local_file_objects").length+E.get("metadata_collection").length,S=g>1?o.SHARE_ERROR_SEND_MUL_DLG_MSG:o.SHARE_ERROR_SEND_DLG_MSG;d.displayTextAlert(d.SEVERITY_ERROR,o.SHARE_ERROR_SEND_DLG_TITLE,S)}else d.displayTextAlert(d.SEVERITY_ERROR,o.SHARE_ERROR_SEND_DLG_TITLE,r);try{l=JSON.parse(i.responseText).error.code}catch(f){}l&&0===l.indexOf("CannotConvertForm")&&this._logFormShareError(l),e.Util.isCEF()&&this._resetAfterError(t)},this)))},this),_.bind(function(){this._onShareError(t,a.NO_CONNECTIVITY),this._resetAfterError(t)},this))},_launchSFSWithData:function(e){return console.log("launching SFS app .... "),this.options.appApi.rnaApi.then(_.bind(function(i){var t=this.options.sendFilesUiModel.getRecipientsArray(),s=[{transientDocIds:this.options.canSignUiModel.get("transient_Doc_Ids"),esAccessToken:"Bearer "+this.options.esAuthUiModel.get("access_token"),emailSubject:this._getSubjectText(!0),emailMessage:this._getMessageText(),recipients:t,agreementStatus:e,agreementName:this.options.sendFilesUiModel.get("us_subject_text")}];return i.stApi.launchSendForSignWithTransientDocIdsAPI(s).then(_.bind(function(){return $.Deferred().resolve().promise()},this),_.bind(function(){return $.Deferred().reject().promise()},this))},this),_.bind(function(){return $.Deferred().reject().promise()},this))},_showLoader:function(){this.$closeShareButton.hide()},_showShareButton:function(){this.$shareButton.show(),this._toggleSendButton()},_getSubjectText:function(e){var i=this._emailAddressView._getSubjectText();return e&&(i=i.replace(o.SHARE_INITIAL_SUBJECT_PREFIX,"")),i},_getMessageText:function(){var e=this._emailAddressView._getMessageText();return e},_onShareError:function(e,i){if(i===a.NO_CONNECTIVITY)this.options.appApi.dialogApi.displayTextAlert(this.options.appApi.dialogApi.SEVERITY_ERROR,o.SHARE_NO_INTERNET_CONNECTION,o.SHARE_NO_INTERNET_CONNECTION_MSG);else if(i===a.REVIEW_NOT_PERMITTED){var t=this.options.sendFilesUiModel.get("ShareVariant"),s=a.USE,n="Review not supported";this.options.appApi.siteCatalystApi.logScEvent([t,s,n]),this.options.appApi.dialogApi.displayTextAlert(this.options.appApi.dialogApi.SEVERITY_ERROR,o.SHARE_REVIEW_RESTRICTED,o.SHARE_REVIEW_RESTRICTED_MSG).done(_.bind(function(){this.options.sendFilesUiModel.setUSMode("#send-mode"),this.options.sendFilesUiModel.setCLMode("#send-mode")},this))}else{var l=this.options.sendFilesUiModel.get("us_mode"),r=o.SHARE_UPLOAD_ERROR_MSG;"#sign-mode"===l&&(r=o.SHARE_SIGN_UPLOAD_ERROR_MSG),this.options.appApi.dialogApi.displayTextAlert(this.options.appApi.dialogApi.SEVERITY_ERROR,o.SHARE_UPLOAD_ERROR_TITLE,r)}},_onSharingLearnMore:function(){this.options.appApi.rnaApi.then(_.bind(function(e){e.stApi.launchSendTrackRestrictionsLearnMoreUrl()}))},_resetAfterError:function(e){var i=this.options.sendFilesUiModel;i.setShareState("preShare"),this.$shareButton.show(),i.set("metadata_collection",e.filesModelBackup.clone()),i.set("local_file_objects",e.localFilesBackup)},_onSubjectInput:function(){console.log("_onSubjectInput us-share-tab-view");var e=this._getSubjectText(!1);this.options.sendFilesUiModel.setSubjectText(e)},_onSubjectPaste:function(){console.log("_onSubjectPaste us-share-tab-view"),_.delay(_.bind(function(){var e=this._getSubjectText(!1);this.options.sendFilesUiModel.setSubjectText(e)},this),100)},_onSubjectBlur:function(){console.log("_onSubjectBlur us-share-tab-view");var e=this._getSubjectText(!1);this._checkNameLength(e)},_onMessageInput:function(){console.log("_onMessageInput");var e=this._getMessageText();this.options.sendFilesUiModel.setMessageText(e)},_onMessagePaste:function(){console.log("_onMessagePaste");var e=$("#us-share-message-input").scrollTop(),i=$("#us-share-message-input").prop("scrollHeight");_.delay(_.bind(function(){var t=this._getMessageText();this.options.sendFilesUiModel.setMessageText(t);var s=$("#us-share-message-input").prop("scrollHeight");$("#us-share-message-input").scrollTop(e+(s-i))},this),100)},_onMessageBlur:function(){console.log("_onMessageBlur us-share-tab-view");var e=this._getMessageText();this._checkMessageLength(e)},_redirectToGetLink:function(){var e=this.options.sendFilesUiModel.get("ShareVariant"),i=a.USE,t="Redirect To Get Link on Send Limit reached.";this.options.appApi.siteCatalystApi.logScEvent([e,i,t]),this.options.appApi.dialogApi.closeAllDialogs(),$(".get-link-accordian-heading").click()},_renderOfflineView:function(){console.log("Render offlineView")},_fetchingSubscriptionWait:function(e){e?(this.$fullOverlay=this.options.appApi.displayApi.showFullOverlay(!0),this.$fullOverlay.addClass("progress-fetch-subscription")):(this.$fullOverlay.removeClass("progress-fetch-subscription"),this.options.appApi.displayApi.showFullOverlay(!1))},_resolveRecipientsAddressesList:function(e){return this.options.appApi.rnaApi.then(_.bind(function(i){if(_.isUndefined(e)||0===e.length)return this._getResolvedPromise();var t=this.options.recipients;return i.stApi.getLastUsedPreferences().then(_.bind(function(s){return s&&1==s.remeberChoice?this._getResolvedPromise():i.stApi.getResolvedEmailAddressesListAPI(e).then(_.bind(function(e){var i;return 0===e.length?$.Deferred().reject().promise():(i=e.split(";"),i.pop(),this.options.recipients=[],i.every(_.bind(function(e){return-1!==e.indexOf("@")?(this.options.recipients.push(e),!0):(this.options.recipients=t,!1)},this)),$.Deferred().resolve().promise())},this),_.bind(function(){return $.Deferred().reject().promise()},this))},this),_.bind(function(){return $.Deferred().reject().promise()},this))},this),_.bind(function(){return $.Deferred().reject().promise()},this))},_postSignInFunction:function(){var e,i,t=this.options,s=this.options.is_public,n=this.options.recipients,o=this.options.is_individual;return i=this.options.appApi.baseFilesUrisApi.getAlternateUploadUri(),this.options.appApi.siteCatalystApi.logScEvent([a.TOOLS,this.options.sendFilesUiModel.get("ShareVariant"),a.SHARE_BUTTON,"async"]),this._logSharingParams(s,o,n),e=this.options.appApi.baseFilesUrisApi.getSendApiUri(),e=l.extractRootUrl(e),t={rootUrl:e,uploadUrl:i}},_resetPageToDefault:function(){console.log("Draw the success view for Create Link")},_drawNextPane:function(){console.log("Draw the success view for share");var e=this.options.sendFilesUiModel;e.setShareState("postShare")},_logSharingParams:function(e,i,t){var s,n,o,l,r=this.options.appApi.siteCatalystApi;e&&r.logScEvent([a.TOOLS,this.options.sendFilesUiModel.get("ShareVariant"),a.SHARE_WITH,a.PUBLIC]),l=a.DEFAULT,r.logScEvent([a.TOOLS,this.options.sendFilesUiModel.get("ShareVariant"),a.SUBJECT,l]),i&&(n=[a.TOOLS,this.options.sendFilesUiModel.get("ShareVariant"),a.SHARE_WITH,a.PERSONAL],r.logScEvent(n),s=t.length,o=1===s?a[1]:5>=s?a["2_TO_5"]:10>=s?a["6_TO_10"]:a["11_OR_MORE"],n.push(o),r.logScEvent(n),l=a.ENTERED,r.logScEvent([a.TOOLS,this.options.sendFilesUiModel.get("ShareVariant"),a.MESSAGE,l])),this._logFormShareStarted()},_logFormShareStarted:function(){var e,i,t=this.options.appApi.siteCatalystApi;this._parcelHasForms()&&(e=[a.TOOLS,a.FSS,a.FORM,a.OUTPUT,a.SAVE_TO_PDF,a["1_STARTED"],a.SEND_TAB],i=e.join(":"),t.logScEvent(e,{featureType:i}))},_logFormShareSuccess:function(){var e,i,t,s=this.options.appApi.siteCatalystApi;this._parcelHasForms()&&(e=[a.TOOLS,a.FSS,a.FORM,a.OUTPUT,a.SAVE_TO_PDF,a["2_COMPLETED"],a.SEND_TAB],i=e.join(":"),t=[a.TOOLS,a.FSS,a.FORM,a.COMPLETED].join(":"),s.logScEvent(e,{featureType:i,sectionName:t}))},_logFormShareError:function(e){var i,t,s,n=this.options.appApi.siteCatalystApi;if(this._parcelHasForms()){var o="ServerError";switch(e){case"CannotConvertFormTimeout":o="TimeOut";break;case"CannotConvertFormRestrictedEditPermission":o="PermSet"}i=[a.TOOLS,a.FSS,a.FORM,a.OUTPUT,a.SAVE_TO_PDF,a.ERROR,o,a.SEND_TAB],t=i.join(":"),s=[a.TOOLS,a.FSS,a.FORM,a.OUTPUT,a.SAVE_TO_PDF,a.ERROR].join(":"),n.logScEvent(i,{featureType:t,sectionName:s})}},_parcelHasForms:function(){var e,i,s,n=!1;return e=this.options.sendFilesUiModel,i=e.get("metadata_collection"),s=e.get("enable_form_send"),s&&(n=i.some(function(e){return t.isFormMimeType(e.get("content_type"))})),n},_displayShareUpsellDialog:function(e,i){var t=_.extend({},{okButtonClass:"us-upsell-learn-more",cancelButtonClass:"us-upsell-close"}),s=this.options.appApi.dialogApi,n=s.displayHtmlAlert(s.SEVERITY_WARNING,e,i,o.LEARN_MORE,o.CLOSE_STRING,t);return $(".alert-dlg-buttons-rhp").css({"text-align":"right",direction:"rtl"}),$(".us-upsell-learn-more").css({"padding-left":"15px","padding-right":"15px","margin-left":"10px","margin-right":"5px"}),n.then(_.bind(function(){this._onUpsell()},this)).always(_.bind(function(){$(".alert-dlg-buttons-rhp").css({"text-align":"center",direction:"ltr"})},this))},_checkMaximumRecipients:function(e){var i,t=this.options.sendFilesUiModel,s=t.get("limits_model"),n=!1,a=t.get("us_mode");if(e)if(i=_.isUndefined(s)?250:s.get("#send-mode"===a?"max_recipients":"max_review_recipients"),e.length>i){var l=s.get("can_upgrade_send"),r=s.get("can_send_to_individuals");r?(l?this._displayShareUpsellDialog(o.SHARE_LIMIT_EXCEEDED_DLG_TITLE,o.SHARE_UPSELL_MSG):this._displayTooManyRecipients(e.length,i),n=!1):n=!0}else n=!0;return n},_displayTooManyRecipients:function(e,i){console.log("Too many recipients");var t=this.options.appApi.dialogApi,s=o.SHARE_TOO_MANY_RECIPIENTS_DLG_TITLE,n=_.template(o.SHARE_TOO_MANY_RECIPIENTS_DLG_MSG,{maxRecipients:i});t.displayTextAlert(t.SEVERITY_WARNING,s,n)},_displayNoAccessToUser:function(e){var i,t,s=this.options.appApi.dialogApi;i=o.COULD_NOT_SEND,t="UserEncrypted"===e?o.ENCRYPTION_KEY_DISABLED_MESSAGE:o.ENTERPRISE_USERS_ACCESS_ERROR,s.displayTextAlert(s.SEVERITY_WARNING,i,t)},_setSFSWorkflowInProgress:function(){this.options.appApi.rnaApi.done(_.bind(function(e){e.esApi.setSFSWorkflowInProgress(!0)},this))},_clearSFSWorkflowInProgress:function(){this.options.appApi.rnaApi.done(_.bind(function(e){e.esApi.setSFSWorkflowInProgress(!1)},this))}}),s.ShareTabView}),define("pdmplugins/unified-share/js/templates/us-create-link-template",[],function(){return'<div id="create-link-content"><div id="create-link-welcome-view"></div><div id="create-link-working-view"></div><div id="create-link-complete-view"></div></div>'}),define("pdmplugins/unified-share/js/templates/us-create-link-welcome-template",[],function(){return'<div id="create-link-message-heading" class="ui-theme theme-header-text"><%= CREATE_LINK_MESSAGE_HEADING %></div><div id="create-link-message-text" class="ui-theme theme-text"><%= CREATE_LINK_MESSAGE_TEXT %></div><div id="us-cl-mode-selector" class ="ui-theme theme-share-container mode-selector"></div><div id="cl-sub-and-message"><input type="text" maxlength="1000" class="us-share-subject-input ui-theme theme-share-container theme-text" aria-label = "<%= SHARE_INITIAL_SUBJECT_ARIA_LABEL %>" value="<%= SHARE_INITIAL_SUBJECT %>" id="create-link-subject-input"/><textarea type="text" maxlength="1000" class="us-share-message-input ui-theme theme-share-container theme-text" id="create-link-message-input" aria-label="<%= SHARE_MESSAGE_HEADING_ARIA_LABEL %>"placeholder = "<%= SHARE_MESSAGE_PROMPT_PLACEHOLDER %>"><%= SHARE_MESSAGE_PROMPT %></textarea></div><div class="cl-welcome-button-bar ui-theme theme-share-container"><button class="create-link-button control-button button-grey ui-theme theme-share-grey-button" aria-label = "<%= CREATE_LINK_GENERATE %>" aria-describedby="create-link-button" id="create-link-generate"><%= CREATE_LINK_GENERATE %></button><button class="ui-theme theme-text create-link-close" tabindex = "-1"><%= CREATE_LINK_CLOSE %></button></div>'}),define("pdmplugins/unified-share/js/templates/us-cl-service-selector-view-template",[],function(){return'<div><table class="us-table"><tr class="us-row"><td class="us-radio-cell"><input class = "service-selector cl-service-selector " type="radio" id="cl_send_file" name = "cl_mode" aria-label ="<%= SHARE_VIEW_TITLE %>"></td><td><label for="cl_send_file" class="cl-service-selector-label ui-theme theme-text"><%= SHARE_VIEW %></label></td><td class="us-icon-cell"><div id="get-link-view-info" class="info-icon-img us-tooltip" aria-label ="<%= SHARE_VIEW_TITLE %>"><span class="ui-theme theme-tooltip us-tooltip-text"><span class="ui-theme theme-tooltip-text"><%= SHARE_VIEW_TITLE %></span></span></div></td></tr><tr class="us-row"><td class="us-radio-cell"><input class = "service-selector cl-service-selector " type="radio" id="cl_review" name = "cl_mode" aria-label ="<%= SHARE_REVIEW_TITLE %> <%= LEARN_MORE_LABEL %>"></td><td><label for="cl_review" class="cl-service-selector-label ui-theme theme-text"><%= SHARE_REVIEW %></label></td><td class="us-icon-cell"><div id="get-link-review-info" class="info-icon-img us-tooltip" aria-label ="<%= SHARE_REVIEW_TITLE %> <%= LEARN_MORE_LABEL %>"><span class="ui-theme theme-tooltip us-tooltip-text"><div class="ui-theme theme-tooltip-text"><%= SHARE_REVIEW_TITLE %></div><span class="ui-theme theme-tooltip-text cl-learn-more" tabindex="0" aria-label= "<%= LEARN_MORE_LABEL %>"><%=LEARN_MORE_LINK%></span></span></div></td></tr></table></div>'}),define("pdmplugins/unified-share/js/views/us-cl-service-selector-view",["core/ac-core","pdmplugins/unified-share/js/ac-unified-share","pdmplugins/unified-share/js/templates/us-cl-service-selector-view-template","i18n!pdmplugins/unified-share/js/nls/ui-strings","pdmplugins/unified-share/js/utils/sc-constants"],function(e,i,t,s,n){return i.USCLServiceSelectorView=e.View.extend({events:{"click .cl-service-selector":"_selectService","click .cl-learn-more":"_launchLearnMoreReview"},initialize:function(){e.View.prototype.initialize.call(this),this.mouseUp=!1},render:function(){this.$el;e.View.prototype.render.call(this),this._template=_.template(t),0===this.$el.children().length&&(this.$el.html(this._template({SHARE_VIEW:s.SHARE_VIEW,SHARE_REVIEW:s.SHARE_REVIEW,SHARE_VIEW_TITLE:s.GET_LINK_VIEW_INFO_TOOLTIP,SHARE_REVIEW_TITLE:s.GET_LINK_REVIEW_INFO_TOOLTIP,LEARN_MORE_LINK:s.LEARN_MORE,LEARN_MORE_LABEL:s.LEARN_MORE_LABEL})),this._initWrappers(),this._addEventListeners()),this.addUIModelEventListener(),this._changeUiFromServiceSelected(),this._addKeyEventListener()},_initWrappers:function(){this.$usGetLinkViewInfo=this.$("#get-link-view-info"),this.$usGetLinkReviewInfo=this.$("#get-link-review-info"),this.$clLearnMore=this.$(".cl-learn-more")},_addEventListeners:function(){this.$usGetLinkViewInfo.mouseenter(this._onHoverGetLinkViewInfo),this.$usGetLinkReviewInfo.mouseenter(this._onHoverGetLinkReviewInfo),this.$usGetLinkViewInfo.focus(_.bind(function(){this.$usGetLinkViewInfo.addClass("hovered")},this)),this.$usGetLinkReviewInfo.focus(_.bind(function(){this.$usGetLinkReviewInfo.addClass("hovered")},this)),this.$usGetLinkViewInfo.blur(_.bind(function(){this.$usGetLinkViewInfo.removeClass("hovered")},this)),this.$usGetLinkReviewInfo.blur(_.bind(function(){setTimeout(_.bind(function(){this.$usGetLinkReviewInfo.removeClass("hovered")},this),100)},this)),this.$usGetLinkViewInfo.hover(_.bind(function(){this.$usGetLinkViewInfo.addClass("hovered")},this),_.bind(function(){this.$usGetLinkViewInfo.removeClass("hovered")},this)),this.$usGetLinkReviewInfo.hover(_.bind(function(){this.$usGetLinkReviewInfo.addClass("hovered")},this),_.bind(function(){this.$usGetLinkReviewInfo.removeClass("hovered")},this)),this.$clLearnMore.focus(_.bind(function(){this.$usGetLinkReviewInfo.addClass("learn-more-focus")},this)),this.$clLearnMore.blur(_.bind(function(){this.$usGetLinkReviewInfo.removeClass("learn-more-focus hovered")},this)),$(document).mouseup(_.bind(function(e){e.target.className.includes("service-selector-label")&&(this.mouseUp=!0)},this))},addUIModelEventListener:function(){var e=this.options.sendFilesUiModel;e.on("change:cl_mode",this._changeUiFromServiceSelected)},_addKeyEventListener:function(){this.$clLearnMore.keypress(this._onKeyPress)},_onKeyPress:function(e){var i=$(e.currentTarget);e&&13==e.which&&i.trigger("click")},_selectService:function(e){var i=this.options.sendFilesUiModel,t=$(e.currentTarget),s=t.attr("id");this.$usGetLinkViewInfo.attr("tabindex","-1"),this.$usGetLinkReviewInfo.attr("tabindex","-1"),"cl_send_file"===s?(i.setCLMode("#send-mode"),this.$usGetLinkViewInfo.attr("tabindex","0")):"cl_review"===s&&(i.setCLMode("#review-mode"),this.$usGetLinkReviewInfo.attr("tabindex","0")),this.mouseUp&&t.blur(),this.mouseUp=!1},_changeUiFromServiceSelected:function(){var e=this.options.sendFilesUiModel,t=e.get("cl_mode");this.$usGetLinkViewInfo.attr("tabindex","-1"),this.$usGetLinkReviewInfo.attr("tabindex","-1"),"#send-mode"===t?(this.$("#cl_send_file").prop("checked",!0),e.set("allow_comments",!1),this.$usGetLinkViewInfo.attr("tabindex","0")):e.get("allow_comments_enabled")===!0&&i.opFactory.create("CanSendForReviewOp",this.options).run().then(_.bind(function(){this.$("#cl_review").prop("checked",!0),e.set("allow_comments",!0),this.$usGetLinkReviewInfo.attr("tabindex","0")},this),_.bind(function(e){this.$("#cl_send_file").prop("checked",!0),this.options.sendFilesUiModel.setCLMode("#send-mode"),this.options.sendFilesUiModel.setUSMode("#send-mode"),this.options.appApi.displayApi.showModal(!1);var i=this.options.sendFilesUiModel.get("ShareVariant"),t=n.ERROR,o=e.analyticsEvent;this.options.appApi.siteCatalystApi.logScEvent([i,t,o]),this.options.appApi.dialogApi.displayTextAlert(this.options.appApi.dialogApi.SEVERITY_ERROR,s.FILE_CANT_BE_SENT,e.msg)},this))},_onHoverGetLinkViewInfo:function(){var e=this.options.sendFilesUiModel.get("ShareVariant"),i=n.USE,t="Select info for view link";this.options.appApi.siteCatalystApi.logScEvent([e,i,t])},_onHoverGetLinkReviewInfo:function(){var e=this.options.sendFilesUiModel.get("ShareVariant"),i=n.USE,t="Select info for review link";this.options.appApi.siteCatalystApi.logScEvent([e,i,t])},_launchLearnMoreReview:function(){this.options.appApi.rnaApi.done(_.bind(function(e){e.openDecoratedUrl(s.REVIEW_LEARN_MORE_LINK_GO_URL)},this))}}),i.USCLServiceSelectorView}),define("pdmplugins/unified-share/js/views/us-create-link-welcome-view",["core/ac-core","files/ac-files","core/utils/file-types","pdmplugins/unified-share/js/ac-unified-share","pdmplugins/unified-share/js/templates/us-create-link-welcome-template","i18n!pdmplugins/unified-share/js/nls/ui-strings","pdmplugins/unified-share/js/utils/sc-constants","pdmplugins/unified-share/js/utils/ts-utils","pdmplugins/unified-share/js/ops/desktop-do-upload-op","pdmplugins/unified-share/js/ops/finding-upload-folder-op","pdmplugins/unified-share/js/ops/begin-desktop-upload-op","pdmplugins/unified-share/js/ops/update-dirty-doc-state-op","pdmplugins/unified-share/js/ops/share-files-op","pdmplugins/unified-share/js/ops/close-app-op","pdmplugins/unified-share/js/views/us-cl-service-selector-view"],function(e,i,t,s,n,o,a,l){return s.CreateLinkWelcomeView=e.View.extend({events:{"click #create-link-generate":"_onGenerateLink","click .create-link-close":"_onClickClose","blur  #create-link-subject-input":"_onSubjectInput","blur  #create-link-message-input":"_onMessageBlur"},initialize:function(){e.View.prototype.initialize.call(this);this.$el;this._template=_.template(n)},render:function(){e.View.prototype.render.call(this);var i=this.options.sendFilesUiModel,t=i.get("cl_subject_text"),s=i.get("cl_message_text");0===this.$el.children().length&&(this.$el.html(this._template({CREATE_LINK_MESSAGE_HEADING:o.CREATE_LINK_MESSAGE_HEADING,CREATE_LINK_MESSAGE_TEXT:o.CREATE_LINK_MESSAGE_TEXT,CREATE_LINK_ALLOW_COMMENTS:o.CREATE_LINK_ALLOW_COMMENTS,SHARE_INITIAL_SUBJECT_ARIA_LABEL:this._getSubjectInitialAriaLabel(),SHARE_INITIAL_SUBJECT:t,SHARE_MESSAGE_HEADING_ARIA_LABEL:this._getMessageInitialAriaLabel(),SHARE_MESSAGE_PROMPT:s,SHARE_MESSAGE_PROMPT_PLACEHOLDER:o.SHARE_MESSAGE_PROMPT_PLACEHOLDER,CREATE_LINK_GENERATE:o.CREATE_LINK,CREATE_LINK_CLOSE:o.CLOSE_STRING,CL_MODE_SELECTOR_MESSAGE_TEXT:o.GET_LINK_SUBTEXT})),this._initWrappers(),this._addUiModelEventListeners(),this._renderChildViews(),this._onFilesChange())},_initWrappers:function(){this.$usCLContent=this.$("#create-link-content"),this.$usCLMessageHeading=this.$("#create-link-message-heading"),this.$usCLMessageText=this.$("#create-link-message-text"),this.$usCLGenerateLinkButton=this.$("#create-link-generate"),this.$createLinkSubject=this.$("#create-link-subject-input"),this.$createLinkMessage=this.$("#create-link-message-input"),this.$subAndMessageContainer=this.$("#cl-sub-and-message"),this.$usClModeSelector=this.$("#us-cl-mode-selector")},_renderChildViews:function(){this.options.sendFilesUiModel.get("isReviewVisible")&&this._renderChildView("_usClModeSelectorView",s.USCLServiceSelectorView,this.$usClModeSelector)},_reorderCollections:function(e){var i=[],t=$.Deferred(),s=0,n=[],o=this.options.sendFilesUiModel,l=o.get("limits_model"),r=0;if(!this.options.localFiles.length)return t.resolve().promise();if(this.avFlag=!1,this.formFlag=!1,_.each(this.options.localFiles,_.bind(function(t){var a;"postUpload"===e&&(t.id=this.options.assetIdarray[s],a=this.options.sendFilesUiModel.addFilesToCollection([t.id],void 0,o.get("share_collection"),!0,!0),i.push(a[0]),s++),"preUpload"===e&&(!_.isUndefined(t.get("path"))&&"\\\\www.adobe.com\\go\\homeacrordrunified18_2018"===t.get("path")||"http://www.adobe.com/go/homeacrordrunified18_2018"===t.get("path")?console.log("Welcome.pdf"):_.isEmpty(t.get("ext"))?(this.options.sendFilesUiModel.removeLocalFile([t]),a=this._showErrorDialogMsg("noExtension"),i.push(a)):_.isEmpty(t.get("assetId"))||this.options.sendFilesUiModel.get("bHFileIsDirty")&&t.get("assetId")===this.options.sendFilesUiModel.get("openedFileAssetId")?!l.get("can_send_av")&&o.hasAudioVideoExt(t.get("ext"))?(this.avFlag=!0,n[r++]=t,a=$.Deferred().resolve().promise(),i.push(a)):o.get("enable_form_send")||"form"!==t.get("ext")?(a=$.Deferred().resolve().promise(),i.push(a)):(this.formFlag=!0,n[r++]=t,a=$.Deferred().resolve().promise(),i.push(a)):(this.options.sendFilesUiModel.removeLocalFile([t]),a=this.options.sendFilesUiModel.addFilesToCollection([t.get("assetId")]),i.push(a[0])))},this)),n.length){var d;this.options.appApi.siteCatalystApi.logScEvent([a.TOOLS,this.options.sendFilesUiModel.get("ShareVariant"),a.FILES_SHARED_DLG,a.DISALLOWED,a.WARNING,a.SHOWN]),d=this.options.isType2OR3?this._showErrorDialogMsg("type2or3",n):this.avFlag&&!this.formFlag?this._showErrorDialogMsg("avError",n):!this.avFlag&&this.formFlag?this._showErrorDialogMsg("fileTypeError",n,"formError"):this._showErrorDialogMsg("fileTypeError",n,"avFormError"),i.push(d)}return $.when.apply($,i).then(_.bind(function(){this.options.localFiles=this.options.sendFilesUiModel.get("local_file_objects"),this.options.files=this.options.sendFilesUiModel.get("metadata_collection"),t.resolve()},this),_.bind(function(){t.reject()},this)),t.promise()},_showErrorDialogMsg:function(e,i,t){{var s,n,l=this.options.appApi.dialogApi;this.options.sendFilesUiModel.get("limits_model")}if("noExtension"===e)return s=o.ADD_FILES_REJECTED_TITLE,n=o.ADD_FILES_REJECTED_MESSAGE,l.displayHtmlAlert(l.SEVERITY_WARNING,s,n,o.SHARE_SUCCESS_CLOSE);if("avError"===e){var r=_.extend({},{okButtonClass:"us-upsell-learn-more",cancelButtonClass:"us-upsell-close"});s=o.SHARE_AV_UPSELL_TITLE,n=o.SHARE_AV_UPSELL_MSG;var d=l.displayHtmlAlert(l.SEVERITY_WARNING,s,n,o.LEARN_MORE,o.CLOSE_STRING,r);return $(".alert-dlg-buttons-rhp").css({"text-align":"right",direction:"rtl"}),$(".us-upsell-learn-more").css({"padding-left":"15px","padding-right":"15px","margin-left":"10px","margin-right":"5px"}),d.then(_.bind(function(){return this._onUpsell(),$.Deferred().reject().promise()},this),_.bind(function(){return _.each(i,_.bind(function(e){this.options.sendFilesUiModel.removeLocalFile([e])},this)),$.Deferred().reject().promise()},this)).always(_.bind(function(){$(".alert-dlg-buttons-rhp").css({"text-align":"center",direction:"ltr"})},this))}if("type2or3"===e){var s=o.COULD_NOT_SEND,n=o.ENTERPRISE_USERS_ACCESS_ERROR;return l.displayHtmlAlert(l.SEVERITY_WARNING,s,n,o.SHARE_SUCCESS_CLOSE).then(_.bind(function(){return _.each(i,_.bind(function(e){this.options.sendFilesUiModel.removeLocalFile([e])},this)),$.Deferred().reject().promise()},this))}return"fileTypeError"===e?(s=o.SEND_UPSELL_UPGRADE_REQUIRED,"formError"===t?(n=o.SHARE_FORMS_ERROR_DESKTOP,this.options.appApi.siteCatalystApi.logScEvent([a.TOOLS,this.options.sendFilesUiModel.get("ShareVariant"),a.ATTEMPTED_TO_SHARE_FORM])):"avFormError"===t&&(n=o.SHARE_AV_FORMS_ERROR+o.SHARE_AV_UPGRADE_MESSAGE),l.displayHtmlAlert(l.SEVERITY_WARNING,s,n,o.SHARE_SUCCESS_CLOSE).then(_.bind(function(){return _.each(i,_.bind(function(e){this.options.sendFilesUiModel.removeLocalFile([e])},this)),$.Deferred().reject().promise()},this))):void 0},_onUpsell:function(i){var t=this.options.limitsModel,s=t.get("upgrade_url");this.options.appApi.rnaApi.done(_.bind(function(e){e.openDecoratedUrl(s)},this)),e.Util.isCEF()&&this.options.appApi.sessionApi.ensureSignedIn()},_onAllowComments:function(){console.log("On Allow Comments..."),this._toggleAddFilesButton(),this._checkMaximumFiles()},_toggleAddFilesButton:function(){},_toggleSubAndMsgVisibility:function(){var e=this.options.sendFilesUiModel.get("allow_comments");e?this.$subAndMessageContainer.show():this.$subAndMessageContainer.hide()},_checkMaximumFiles:function(){var e=this.options.sendFilesUiModel,i=e.get("US_tab_open");if("createLink"===i){if(e.get("allow_comments")&&e.isMultipleFilesSelected()){var t=this.options.appApi.dialogApi,s=o.SHARE_TOO_MANY_FILES_DLG_TITLE,n=o.ERROR_MULTIPLE_FILES_REVIEW1+" "+o.ERROR_MULTIPLE_FILES_REVIEW2;return $("#cl_send_file").prop("checked",!0),e.setCLMode("#send-mode"),e.setUSMode("#send-mode"),t.displayHtmlAlert(t.SEVERITY_INFORMATIONAL,s,n,o.SHARE_SUCCESS_CLOSE),!1}var a,e=this.options.sendFilesUiModel,l=e.get("limits_model"),r=e.get("us_mode"),d=e.get("local_file_objects").length+e.get("metadata_collection").length;if(a=_.isUndefined(l)?50:l.get("#send-mode"===r?"max_files":"max_review_files"),d>a){var t=this.options.appApi.dialogApi,p=o.SHARE_TOO_MANY_FILES_DLG_TITLE,h=_.template(o.SHARE_TOO_MANY_FILES_DLG_MSG,{maxNumber:a});return t.displayTextAlert(t.SEVERITY_WARNING,p,h),!1}}return!0},_onSubjectInput:function(){console.log("_onSubjectInput ");var e=this._getSubjectText(!1);this.options.sendFilesUiModel.set("cl_subject_text",e)},_onMessageBlur:function(){console.log("_onMessageBlur");var e=this._getMessageText();this.options.sendFilesUiModel.set("cl_message_text",e)},_onGenerateLink:function(){console.log("Generating link...."),this._debouncedShareClick||(this._debouncedShareClick=_.debounce(this._onShareClick,1e3,!0)),"onlyRHP"===this.options.sendFilesUiModel.get("layout")&&this.options.sendFilesUiModel.get("checkForSave")?this.options.appApi.rnaApi.done(_.bind(function(e){e.rnaServicesAPI.checkOpenedDocAndPromptForSaveApi().then(_.bind(function(){this._debouncedShareClick()},this))},this)):this._debouncedShareClick()},_onShareClick:function(){var e,i,t,n,l,r,d,p,h,c,u,m,E,g,S,f=[],A=[];if(this._checkMaximumFiles()){if(this.options.appApi.siteCatalystApi.logScEvent([a.TOOLS,this.options.sendFilesUiModel.get("ShareVariant"),a.SHARE_BUTTON,a.CLICKED]),t=this.options.sendFilesUiModel,n=t.get("metadata_collection"),p=t.get("local_file_objects"),l="createLink"===t.get("US_tab_open"),r="share"===t.get("US_tab_open"),c=t.get("customize_recipient_page"),S=t.get("allow_comments"),d=t.get("allow_comments"),h=this._getSubjectText(!1),e={uiModel:t,files:n,localFiles:p,recipients:f,is_public:l,is_individual:r,can_make_comments:S,email_subject:h,displayApi:this.options.appApi.displayApi,appApi:this.options.appApi,rootView:this.options.rootView,is_branding:c,sendFilesUiModel:this.options.sendFilesUiModel,assetIdarray:A,recipientsAreFinalized:!0,is_review:S},i=_.extend({},{filesModelBackup:n.clone(),localFilesBackup:p}),u=_.bind(function(){var e,n,l=this.options,r=new s.UpdateDirtyDocState(this.options);r.run().then(_.bind(function(){this._reorderCollections("preUpload").then(_.bind(function(){l=this.options,e=new s.BeginDesktopUploadOp(l),g=new s.FindingUploadFolderOp(l),n=_.bind(function(){l.parentId=g.id,_.isUndefined(g.persistence)||(l.persistence=g.persistence),"#send-mode"===t.get("cl_mode")&&t.get("local_file_objects").length>0&&t.set("share_loader_text",o.SHARE_LOADER_UPLOAD3),e.run().then(_.bind(function(){this._onShareClickFinish(l,i)},this),_.bind(function(){this._onShareError(i,a.ERROR_UPLOAD),this._resetAfterError(i)},this))},this),p.length?g.run().then(n,_.bind(function(){this._onShareError(i,a.NO_CONNECTIVITY),this._resetAfterError(i)},this)):n()},this),_.bind(function(){this._resetAfterError(i)},this))},this))},this),m=_.bind(function(e){if(e){var t=this.options.appApi.dialogApi,s=_.template('<div class = "learn-more-sharing"><%=LEARN_MORE%></div>')({LEARN_MORE:o.LEARN_MORE}),n=o.FILE_CANT_BE_SENT,l=o.SHARE_ERROR_ENTERPRISE_SEND_DLG_MSG+s,r=this.options.sendFilesUiModel.get("ShareVariant"),d=a.USE,p="Sharing Restriction Error Prompt Shown";this.options.appApi.siteCatalystApi.logScEvent([r,d,p]),t.displayHtmlAlert(t.SEVERITY_WARNING,n,l),$(".learn-more-sharing").click(this._onSharingLearnMore),this._resetAfterError(i)}else u()},this),E=_.bind(function(){var e=this.options.appApi.rnaApi;e.done(_.bind(function(e){m(e.isFeatRunning()?e.stApi.isSendTrackRestrictionsEnabled():this.options.limitsModel.get("restrictions"))},this))},this),this.options=_.extend({},this.options,e),!this.options.appApi.networkConnectivityApi.isOnline())return this._renderOfflineView(),this._onShareError(i,a.NO_CONNECTIVITY),void this._resetAfterError(i);this.options.appApi.sessionApi.isSignedInReader()&&this._setWorkingView(),this.options.appApi.sessionApi.ensureSignedIn().then(_.bind(function(){this._setWorkingView(),this._resolveRecipientsAddressesList(this.options.recipients).always(_.bind(function(){this.options=_.extend({},this.options,this._postSignInFunction()),this.options.readRegistry=!1,this._checkMaximumRecipients(this.options.recipients)!==!1&&s.opFactory.create("DesktopGettingSubscriptionLevels",this.options).run().then(_.bind(function(){E()},this),_.bind(function(){this.options.appApi.displayApi.showModal(!1),this._onShareError(i,a.NO_CONNECTIVITY),this._resetAfterError(i)},this))},this))},this),_.bind(function(e){e&&"NoAccessToPdfServices"===e.errorString&&this._displayNoAccessToUser(e.errorCode)},this))}},_onShareClickFinish:function(i,t){{var n,l,r,d=this.options.sendFilesUiModel.get("share_collection"),p=this.options.sendFilesUiModel.get("metadata_collection");this.options.brandingModel}d.reset(),p.each(_.bind(function(e){var i=new s.FileMetadataModel;i.set(_.clone(e.attributes)),d.add(i)},this)),this.options=_.extend({},this.options,i),r=_.extend({shareFiles:d},i),this._reorderCollections("postUpload").then(_.bind(function(){r.shareFiles.length&&(n=new s.ShareFilesOp(r),n.run().then(_.bind(function(e){if(this.options.sendFilesUiModel.set({active_view:"success",parcel:e.parcel}),this.options.appApi.displayApi.showModal(!1),this.options.sendFilesUiModel.set("cl_active_view","complete"),this._resetPageToDefault(),this._logFormShareSuccess(),!this.options.is_review){var i={};
i.op="addParcel",i.parcel=e.parcel,this.options.appApi.rnaApi.done(_.bind(function(e){e.stApi.updateInAppDMStateAPI(i)},this))}},this),_.bind(function(i){function s(e){var i={Unauthorized:o.SHARE_UNVERIFIED_ID_MSG,PDFIsPortfolio:o.REVIEW_DISABLE_REASON_PORTFOLIO,PDFIsPasswordProtected:o.REVIEW_DISABLE_PROTECTED,PDFIsCertificateProtected:o.REVIEW_DISABLE_PROTECTED,PDFIsUnknownProtected:o.REVIEW_DISABLE_PROTECTED,PDFIsPolicyProtected:o.REVIEW_DISABLE_PROTECTED,PDFIsPDFA:o.REVIEW_DISABLE_REASON_PDFA,UnsupportedCommentsPDF:o.REVIEW_DISABLE_REASON_UNSUPPORTED_ANNOTS,PDFIsSecure:o.REVIEW_DISABLE_PROTECTED,PDFIsInvalid:o.REVIEW_DISABLE_REASON_INVALID_FILE,InvalidComment:o.REVIEW_DISABLE_REASON_UNSUPPORTED_ANNOTS,InvalidCommentBodyLength:o.REVIEW_DISABLE_INVALID_COMMENT_LENGTH,CommentCountExceeded:o.REVIEW_DISABLE_COMMENT_COUNT_EXCEEDED,CommentsExtractionSizeExceeded:o.REVIEW_DISABLE_COMMENT_EXTRACTION_ERROR,Unknown:o.REVIEW_DISABLE_UNKNOWN_ERROR};try{var t=JSON.parse(e.responseText);n=t.error.code}catch(s){}if(_.isUndefined(n))try{var t=JSON.parse(e.responseText);n=t.parcels[0].reason_for_failed_state}catch(s){}n&&(a=i[n])}var n,a;s(i);var r=this.options.appApi.dialogApi;_.isUndefined(a)?r.displayTextAlert(r.SEVERITY_ERROR,o.SHARE_CL_ERROR_DLG_TITLE,o.SHARE_CL_ERROR_DLG_MSG):r.displayTextAlert(r.SEVERITY_ERROR,o.SHARE_CL_ERROR_DLG_TITLE,a),this.options.appApi.displayApi.showModal(!1),this.options.sendFilesUiModel.set("cl_active_view","welcome");try{l=JSON.parse(i.responseText).error.code}catch(d){}l&&0===l.indexOf("CannotConvertForm")&&this._logFormShareError(l),e.Util.isCEF()&&this._resetAfterError(t)},this)))},this),_.bind(function(){this._onShareError(t,a.NO_CONNECTIVITY),this._resetAfterError(t)},this))},_onShareError:function(e,i){if(i===a.NO_CONNECTIVITY)this.options.appApi.dialogApi.displayTextAlert(this.options.appApi.dialogApi.SEVERITY_ERROR,o.SHARE_NO_INTERNET_CONNECTION,o.SHARE_NO_INTERNET_CONNECTION_MSG);else if(i===a.REVIEW_NOT_PERMITTED){var t=this.options.sendFilesUiModel.get("ShareVariant"),s=a.USE,n="Review not supported";this.options.appApi.siteCatalystApi.logScEvent([t,s,n]),this.options.appApi.dialogApi.displayTextAlert(this.options.appApi.dialogApi.SEVERITY_ERROR,o.SHARE_REVIEW_RESTRICTED,o.SHARE_REVIEW_RESTRICTED_MSG).done(_.bind(function(){this.options.sendFilesUiModel.setUSMode("#send-mode"),this.options.sendFilesUiModel.setCLMode("#send-mode")},this))}else i===a.ERROR_UPLOAD&&this.options.appApi.dialogApi.displayTextAlert(this.options.appApi.dialogApi.SEVERITY_ERROR,o.SHARE_UPLOAD_ERROR_TITLE,o.SHARE_UPLOAD_ERROR_MSG)},_onSharingLearnMore:function(){this.options.appApi.rnaApi.then(_.bind(function(e){e.stApi.launchSendTrackRestrictionsLearnMoreUrl()}))},_resetAfterError:function(e){var i=this.options.sendFilesUiModel;i.set("cl_active_view","welcome"),i.set("metadata_collection",e.filesModelBackup.clone()),i.set("local_file_objects",e.localFilesBackup)},_showConnectorFileError:function(){this.options.appApi.dialogApi.displayTextAlert(this.options.appApi.dialogApi.SEVERITY_ERROR,o.CONNECTOR_FILE_ERROR_TITLE,o.CONNECTOR_FILE_ERROR_MSG)},_getSubjectText:function(e){var i=this.options.sendFilesUiModel.get("cl_subject_text");return e&&(i=i.replace(o.SHARE_INITIAL_SUBJECT_PREFIX,"")),i},_getMessageText:function(){var e=this.$createLinkMessage.val();return e},_getSubjectInitialAriaLabel:function(){return this._getAriaLabelForDesktop(o.SHARE_SUBJECT_MSG_HEADING,o.SHARE_INITIAL_SUBJECT)},_getMessageInitialAriaLabel:function(){return this._getAriaLabelForDesktop(o.SHARE_MESSAGE_HEADING,o.SHARE_MESSAGE_PROMPT2)},_getAriaLabelForDesktop:function(e,i){return _.template(o.GENERIC_ARIA_LABEL_STRING,{prefix:e,suffix:i})},_renderOfflineView:function(){console.log("Render offlineView")},_fetchingSubscriptionWait:function(e){e?(this.$fullOverlay=this.options.appApi.displayApi.showFullOverlay(!0),this.$fullOverlay.addClass("progress-fetch-subscription")):(this.$fullOverlay.removeClass("progress-fetch-subscription"),this.options.appApi.displayApi.showFullOverlay(!1))},_resolveRecipientsAddressesList:function(e){return this.options.appApi.rnaApi.then(_.bind(function(i){return _.isUndefined(e)||0===e.length?this._getResolvedPromise():i.stApi.getResolvedEmailAddressesListAPI(e).then(_.bind(function(e){var i;return 0===e.length?$.Deferred().reject().promise():(i=e.split(";"),i.pop(),this.options.recipients=[],_.each(i,_.bind(function(e){-1!==e.indexOf("@")&&this.options.recipients.push(e)},this)),$.Deferred().resolve().promise())},this),_.bind(function(){return $.Deferred().reject().promise()},this))},this),_.bind(function(){return $.Deferred().reject().promise()},this))},_postSignInFunction:function(){var e,i,t=this.options,s=this.options.is_public,n=this.options.recipients,o=this.options.is_individual;return i=this.options.appApi.baseFilesUrisApi.getAlternateUploadUri(),this.options.appApi.siteCatalystApi.logScEvent([a.TOOLS,this.options.sendFilesUiModel.get("ShareVariant"),a.SHARE_BUTTON,"async"]),this._logSharingParams(s,o,n),e=this.options.appApi.baseFilesUrisApi.getSendApiUri(),e=l.extractRootUrl(e),t={rootUrl:e,uploadUrl:i}},_resetPageToDefault:function(){console.log("Draw the success view for Create Link")},_logSharingParams:function(e){var i,t=this.options.appApi.siteCatalystApi;e&&t.logScEvent([a.TOOLS,this.options.sendFilesUiModel.get("ShareVariant"),a.SHARE_WITH,a.PUBLIC]),i=a.DEFAULT,t.logScEvent([a.TOOLS,this.options.sendFilesUiModel.get("ShareVariant"),a.SUBJECT,i]),this._logFormShareStarted()},_logFormShareStarted:function(){var e,i,t=this.options.appApi.siteCatalystApi;this._parcelHasForms()&&(e=[a.TOOLS,a.FSS,a.FORM,a.OUTPUT,a.SAVE_TO_PDF,a["1_STARTED"],a.SEND_TAB],i=e.join(":"),t.logScEvent(e,{featureType:i}))},_logFormShareSuccess:function(){var e,i,t,s=this.options.appApi.siteCatalystApi;this._parcelHasForms()&&(e=[a.TOOLS,a.FSS,a.FORM,a.OUTPUT,a.SAVE_TO_PDF,a["2_COMPLETED"],a.SEND_TAB],i=e.join(":"),t=[a.TOOLS,a.FSS,a.FORM,a.COMPLETED].join(":"),s.logScEvent(e,{featureType:i,sectionName:t}))},_logFormShareError:function(e){var i,t,s,n=this.options.appApi.siteCatalystApi;if(this._parcelHasForms()){var o="ServerError";switch(e){case"CannotConvertFormTimeout":o="TimeOut";break;case"CannotConvertFormRestrictedEditPermission":o="PermSet"}i=[a.TOOLS,a.FSS,a.FORM,a.OUTPUT,a.SAVE_TO_PDF,a.ERROR,o,a.SEND_TAB],t=i.join(":"),s=[a.TOOLS,a.FSS,a.FORM,a.OUTPUT,a.SAVE_TO_PDF,a.ERROR].join(":"),n.logScEvent(i,{featureType:t,sectionName:s})}},_parcelHasForms:function(){var e,i,s,n=!1;return e=this.options.sendFilesUiModel,i=e.get("metadata_collection"),s=e.get("enable_form_send"),s&&(n=i.some(function(e){return t.isFormMimeType(e.get("content_type"))})),n},_checkMaximumRecipients:function(e){var i,t=this.options.sendFilesUiModel,s=t.get("limits_model"),n=!1;return e&&(i=s.get("max_recipients"),e.length>i?this._displayTooManyRecipients(e.length,i):n=!0),n},_displayTooManyRecipients:function(){console.log("Too many recipients")},_displayNoAccessToUser:function(e){var i,t,s=this.options.appApi.dialogApi;i=o.COULD_NOT_SEND,t="UserEncrypted"===e?filesUiStrings.ENCRYPTION_KEY_DISABLED_MESSAGE:o.ENTERPRISE_USERS_ACCESS_ERROR,s.displayTextAlert(s.SEVERITY_WARNING,i,t)},_addUiModelEventListeners:function(){var e=this.options.sendFilesUiModel;e.on("change:local_file_objects",this._onFilesChange),e.get("metadata_collection").on("all",this._onFilesChange),e.on("change:ccloud_file_objects",this._onFilesChange),e.on("change:US_tab_open",this._onUsTabChanged),e.on("change:allow_comments",this._onAllowComments)},_onFilesChange:function(){var e=this.options.sendFilesUiModel,i=e.get("local_file_objects"),t=e.get("metadata_collection"),s=e.get("ccloud_file_objects");0===i.length&&0===t.length||s.length>0?this.$usCLGenerateLinkButton.addClass("disabled").attr("disabled","disabled"):this.$usCLGenerateLinkButton.removeClass("disabled").removeAttr("disabled")},_onUsTabChanged:function(){console.log("us-create-link-welcome-view : _onUsTabChanged"),this._checkMaximumFiles()},_onClickClose:function(){var e=new s.CloseAppOp(this.options);e.run()},_setWorkingView:function(){this.options.sendFilesUiModel.set("cl_active_view","working"),this.options.sendFilesUiModel.get("allow_comments")?this.options.sendFilesUiModel.set("cl_active_view_heading",o.SHARE_LOADER_GENERATE_REVIEW_LINK2):this.options.sendFilesUiModel.set("cl_active_view_heading",o.SHARE_LOADER_GENERATE_LINK2)}}),s.CreateLinkWelcomeView}),define("pdmplugins/unified-share/js/templates/us-create-link-working-template",[],function(){return'<div id="us-cl-working-view-container" class= "ui-theme" ><div id="create-link-loader"></div><div id="create-link-working-heading" class="ui-theme theme-header-text"><%= CREATE_LINK_WORKING_HEADING %></div><div id="cl-uploading-text" class= "ui-theme theme-text"></div></div>'}),define("pdmplugins/unified-share/js/views/us-create-link-working-view",["core/ac-core","pdmplugins/unified-share/js/ac-unified-share","pdmplugins/unified-share/js/templates/us-create-link-working-template","i18n!pdmplugins/unified-share/js/nls/ui-strings"],function(e,i,t,s){return i.CreateLinkWorkingView=e.View.extend({initialize:function(){e.View.prototype.initialize.call(this),this._template=_.template(t),_.bind(this._setWorkingHeading,this)},render:function(){e.View.prototype.render.call(this);this.$el;this.$el.html(this._template({CREATE_LINK_WORKING_HEADING:s.SHARE_LOADER_CHECKING_RESTRICTIONS})),this._initWrappers(),this._addUiModelEventListeners(),this.options.sendFilesUiModel.set("enable_add_files",!1),this._centerVertically()},_initWrappers:function(){this.$usClWorkingViewContainer=this.$("#us-cl-working-view-container"),this.$usCLWorkingHeading=this.$("#create-link-working-heading"),this.$usCLLoader=this.$("#create-link-loader"),this.$clUploadingText=this.$("#cl-uploading-text")},_setWorkingHeading:function(){this.$usCLWorkingHeading.text(this.options.sendFilesUiModel.get("cl_active_view_heading"))},_addUiModelEventListeners:function(){this.listenTo(this.options.sendFilesUiModel,"change:cl_active_view_heading",this._setWorkingHeading),this.options.sendFilesUiModel.on("change:share_loader_text",this._updateLoaderText)},_updateLoaderText:function(){var e=this.options.sendFilesUiModel;this.$clUploadingText.text(e.get("share_loader_text"))},_centerVertically:function(){var e,i=$("#unified-share-container").height();console.log("the height is  : "+i),e=.3*i,this.$usClWorkingViewContainer.css("margin-top",e)}}),i.CreateLinkWorkingView}),define("pdmplugins/unified-share/js/templates/us-create-link-complete-template",[],function(){return'<div id="cl-success-view-container" class="ui-theme"><div id="create-link-message-heading" tabindex = "-1" class="ui-theme theme-header-text"><%= CREATE_LINK_MESSAGE_HEADING %></div><div id="create-link-message-text" tabindex = "-1" class="ui-theme theme-text"><%= CREATE_LINK_MESSAGE_TEXT %></div><button class= "us-cl-success-view-image" tabindex="-1" /><div id="us-cl-link-message" class ="ui-theme theme-text" tabindex="-1"><%= US_CL_LINK_MESSAGE %></div><div><textarea type="text" id="create-link-url" class="ui-theme theme-share-input-container theme-text" tabindex="-1" readonly="readonly" /></div><div id="cl-sub-and-message" tabindex="-1"><input readonly type="text" maxlength="1000" class="us-share-subject-input ui-theme theme-share-container theme-text" aria-label = "<%= SHARE_INITIAL_SUBJECT_ARIA_LABEL %>" tabindex = "-1" value="<%= SHARE_INITIAL_SUBJECT %>"/><textarea readonly type="text" maxlength="1000" tabindex = "-1"  class="us-share-message-input ui-theme theme-share-container theme-text" aria-label="<%= SHARE_MESSAGE_HEADING_ARIA_LABEL %>"placeholder = "<%= SHARE_MESSAGE_PROMPT_PLACEHOLDER %>"><%= SHARE_MESSAGE_PROMPT %></textarea></div><div class="cl-button-bar ui-theme theme-share-container"><button id="create-link-remove" class="ui-theme theme-hyperlink" tabindex="-1"><%= CREATE_LINK_REMOVE %></button><button class="ui-theme theme-text" id="create-link-close" tabindex="-1"><%= CREATE_LINK_CLOSE %></button><button class="control-button ui-theme theme-button" id="create-link-copy" aria-label="<%= CREATE_LINK_COPY %>"><%= CREATE_LINK_COPY %></button><button class="create-link-button control-button button-grey ui-theme theme-share-grey-button" id="cl-open-review" tabindex="-1"><%= CREATE_LINK_OPEN_REVIEW %></button><button class="control-button button-grey ui-theme theme-share-grey-button" id="cl-goto-sent-files" aria-label="<%= GO_TO_SENT_FILES %>"><%= GO_TO_SENT_FILES %></button></div><div class="rhp-actions-toast link-copied-toast theme-list-item-text" tabindex="-1" ><div class="toast-icon link-copied-toast-icon" tabindex = "-1"></div><div class="toast-message-string" tabindex = "-1" ><%=LINK_COPIED %></div></div></div>'}),define("pdmplugins/unified-share/js/models/parcel-model",["core/ac-core","pdmplugins/unified-share/js/ac-unified-share","core/utils/http-util","core/models/model"],function(e,i,t){return i.ParcelModel=e.Model.extend({initialize:function(i,t){e.Model.prototype.initialize.call(this,i,t),this.rootUrl="",this.idAttribute="parcel_id",t.collection&&(this.rootUrl=t.collection.rootUrl),t.rootUrl&&(this.rootUrl=t.rootUrl)},url:function(){return this.rootUrl+"/a/api/parcels/"+encodeURIComponent(this.id)},getRenditionUrl:function(e,i,s){var n=Ac.baseFilesUrisModel.getRenditionUri()+"assets/"+encodeURIComponent(e)+"/"+i;return n+="?"+t.getClientIdQueryParam(),s&&(n+="&page="+s),n},idAttribute:"parcel_id",parse:function(e){return e.parcels?e.parcels[0]:e},getRecipients:function(){var e,i=this.get("invitations");return e=_.map(i,function(e){return e.recipient_email})},getViews:function(){return this.get("events").filter(function(e){return"parcel_view"===e.event_type})},isActive:function(){return this.get("is_active")},getNumHits:function(){var e=this.countEventTypes();return e.parcel_view||0},countEventTypes:function(){var e;return e=_.reduce(this.get("invitations"),function(e,i){var t=i.event_counts;return t&&(e=_.reduce(t,function(e,i,t){return e.hasOwnProperty(t)||(e[t]=0),e[t]+=i,e},e)),e},{})},getSingleFileInfo:function(){var e=this.get("files");return e&&1===e.length?e[0]:void 0},getSingleFileId:function(){var e=this.getSingleFileInfo();return e?e.id:void 0},isSingleFileNotPreviewable:function(){var e,i=this.getSingleFileInfo();return i?(e=i.content_type,"application/zip"===e):!1}}),i.ParcelModel}),define("pdmplugins/unified-share/js/views/us-create-link-complete-view",["core/ac-core","pdmplugins/unified-share/js/ac-unified-share","pdmplugins/unified-share/js/templates/us-create-link-complete-template","i18n!pdmplugins/unified-share/js/nls/ui-strings","pdmplugins/unified-share/js/models/parcel-model","pdmplugins/unified-share/js/utils/ts-utils","pdmplugins/unified-share/js/utils/sc-constants","pdmplugins/unified-share/js/ops/close-app-op","pdmplugins/unified-share/js/views/us-cl-service-selector-view"],function(e,i,t,s,n,o,a){return i.CreateLinkCompleteView=e.View.extend({events:{"click #create-link-copy":"_onClickCopyLink","click #create-link-remove":"_onClickRemoveLink","click #create-link-url":"_onClickURL","click #create-link-close":"_onClickClose","click #cl-open-review":"_onClickOpenReview","click #cl-goto-sent-files":"_onClickSentLink"},initialize:function(){e.View.prototype.initialize.call(this),this._template=_.template(t),_.bind(this._onClickCopyLink,this),_.bind(this._onClickRemoveLink,this)},render:function(){e.View.prototype.render.call(this);this.$el;this._parcel=this.options.sendFilesUiModel.get("parcel");var i=this.options.sendFilesUiModel,t=i.get("cl_subject_text"),n=i.get("cl_message_text");this.$el.html(this._template({CREATE_LINK_MESSAGE_HEADING:s.CREATE_LINK_MESSAGE_HEADING,CREATE_LINK_MESSAGE_TEXT:s.CREATE_LINK_MESSAGE_TEXT,CREATE_LINK_ALLOW_COMMENTS:s.CREATE_LINK_ALLOW_COMMENTS,CREATE_LINK_COPY:s.CREATE_LINK_COPY,SHARE_INITIAL_SUBJECT_ARIA_LABEL:this._getSubjectInitialAriaLabel(),SHARE_INITIAL_SUBJECT:t,SHARE_MESSAGE_HEADING_ARIA_LABEL:this._getMessageInitialAriaLabel(),SHARE_MESSAGE_PROMPT:n,SHARE_MESSAGE_PROMPT_PLACEHOLDER:s.SHARE_MESSAGE_PROMPT_PLACEHOLDER,CREATE_LINK_REMOVE:s.CREATE_LINK_REMOVE,CREATE_LINK_CLOSE:s.CLOSE_STRING,US_CL_LINK_MESSAGE:s.LINK_CREATED,CREATE_LINK_OPEN_REVIEW:s.OPEN_REVIEW_FILE,GO_TO_SENT_FILES:s.TRACK_DOCS,LINK_COPIED:s.CREATE_LINK_COPIED})),this._initWrappers(),this.$clOpenReviewBtn.hide(),this.$clGoToSentFilesBtn.hide(),i.get("allow_comments")?this.$clOpenReviewBtn.show():this.$clGoToSentFilesBtn.show(),this.$usCLURL.val(this._getPublicUrl(this._parcel.invitations)),this.options.sendFilesUiModel.set("enable_add_files",!1),this._centerVertically()},_initWrappers:function(){this.$clSuccessViewContainer=this.$("#cl-success-view-container"),this.$usCLCopyLink=this.$("#create-link-copy"),this.$usCLRemove=this.$("#create-link-remove"),this.$usCLURL=this.$("#create-link-url"),this.$subAndMessageContainer=this.$("#cl-sub-and-message"),this.$clOpenReviewBtn=this.$("#cl-open-review"),this.$clGoToSentFilesBtn=this.$("#cl-goto-sent-files"),this.$linkCopiedToast=this.$(".link-copied-toast")},_renderChildViews:function(){this._renderChildView("_usClModeSelectorView",i.USCLServiceSelectorView,this.$usClModeSelector),this._disableServiceSelector()},_disableServiceSelector:function(){this.options.sendFilesUiModel.get("allow_comments")&&this.$("#cl_review").addClass("checked").attr("checked","checked"),this.$usClModeSelector.addClass("disabled").attr("disabled","disabled"),this.$("#cl_send_file").addClass("disabled").attr("disabled","disabled"),this.$("#cl_review").addClass("disabled").attr("disabled","disabled")},_onClickURL:function(){this.$usCLURL.select()},_onClickCopyLink:function(){console.log("Copy Link");var e=this.options.sendFilesUiModel.get("ShareVariant"),i=a.SUCCESS,t="Copy Link";this.options.appApi.siteCatalystApi.logScEvent([e,i,t]),this._onClickURL(),this.$usCLURL.focus(),this.options.appApi.rnaApi.done(_.bind(function(e){e.cefBrowserApi({methodName:"handleViewEvent",parameters:["CopyEvent",{}]}).then(_.bind(function(){this._showLinkCopiedToast(),setTimeout(_.bind(this._hideLinkCopiedToast,this),2e3)},this),_.bind(function(){var e=this.options.appApi.dialogApi;e.displayTextAlert(e.SEVERITY_ERROR,s.SHARE_COPY_LINK_ERROR_DLG_TITLE,s.SHARE_COPY_LINK_ERROR_DLG_MSG)},this))},this))},_showLinkCopiedToast:function(){this.$linkCopiedToast.addClass("show")},_hideLinkCopiedToast:function(){this.$linkCopiedToast.removeClass("show")},_onClickRemoveLink:function(){console.log("Remove Link");var e=o.extractRootUrl(this.options.appApi.baseFilesUrisApi.getSendApiUri()),i=new n({parcel_id:this._parcel.parcel_id},{rootUrl:e});i.destroy({wait:!1}).then(_.bind(function(){console.log("Delete Success"),this.$usCLURL.val(""),this.$usCLCopyLink.prop("disabled",!0),this.$usCLRemove.prop("disabled",!0),_.delay(_.bind(function(){this.options.sendFilesUiModel.set("cl_active_view","welcome"),this.options.sendFilesUiModel.set("resetFileList",!0)},this),1e3)},this),function(){console.log("Delete Failed")})},_onClickOpenReview:function(){var e=this.options.sendFilesUiModel.get("openEurekaFileArgs");this.options.appApi.rnaApi.done(function(i){i.assetApi({methodName:"openEurekaFile",methodArgs:e})})},_onClickSentLink:function(){var i="sentfiles";this.options.appApi.rnaApi.done(_.bind(function(t){if(t.isRunningInBrowser())this.options.appApi.sessionApi.ensureSignedIn().done(_.bind(function(){e.opFactory.create("GettingSsoUriOp",this.options).run(i).done(function(e){e&&window.open(e.uri)})},this));else{var s={};s.op="setHighlightWorkflowId",s.workflowID=this.options.sendFilesUiModel.attributes.parcel.parcel_id,s.sourcePlugin="unifiedShare",s.assetFileName="",s.assetWorkflowId="",t.stApi.updateInAppDMStateAPI(s),t.selectLeftRailItem("sentfiles")}},this))},_getPublicUrl:function(e){var i,t;return t=_.find(e,function(e){return"PARCEL_PUBLIC_SHARING"===e.recipient_email}),t&&(i=t.preview_url),i},_toggleSubAndMsgVisibility:function(){var e=this.options.sendFilesUiModel.get("allow_comments");e?this.$subAndMessageContainer.show():this.$subAndMessageContainer.hide()},_getSubjectInitialAriaLabel:function(){return this._getAriaLabelForDesktop(s.SHARE_SUBJECT_MSG_HEADING,s.SHARE_INITIAL_SUBJECT)},_getMessageInitialAriaLabel:function(){return this._getAriaLabelForDesktop(s.SHARE_MESSAGE_HEADING,s.SHARE_MESSAGE_PROMPT2)},_getAriaLabelForDesktop:function(e,i){return _.template(s.GENERIC_ARIA_LABEL_STRING,{prefix:e,suffix:i})},_onClickClose:function(){var e=new i.CloseAppOp(this.options);e.run()},_centerVertically:function(){var e,i=$("#unified-share-container").height();console.log("the height is  : "+i),e=.3*i,this.$clSuccessViewContainer.css("margin-top",e)}}),i.CreateLinkCompleteView}),define("pdmplugins/unified-share/js/views/us-create-link-tab-view",["core/ac-core","pdmplugins/unified-share/js/ac-unified-share","pdmplugins/unified-share/js/templates/us-create-link-template","pdmplugins/unified-share/js/views/us-create-link-welcome-view","pdmplugins/unified-share/js/views/us-create-link-working-view","pdmplugins/unified-share/js/views/us-create-link-complete-view"],function(e,i,t){return i.CreateLinkTabView=e.View.extend({initialize:function(){e.View.prototype.initialize.call(this),this._template=_.template(t),this.options.sendFilesUiModel.set("cl_active_view","welcome"),this._addUiModelEventListeners()},render:function(){e.View.prototype.render.call(this);this.$el;this.$el.html(this._template({})),this._initWrappers(),this._renderChildViews()},_renderChildViews:function(){this._renderChildView("_welcome",i.CreateLinkWelcomeView,this.$usCLWelcome)},_hideAllChildViews:function(){_.each(this.getChildViews(),function(e){console.log(e),e.$el.hide()})},_initWrappers:function(){this.$usCLContent=this.$("#create-link-content"),this.$usCLWelcome=this.$("#create-link-welcome-view"),this.$usCLWorking=this.$("#create-link-working-view"),this.$usCLComplete=this.$("#create-link-complete-view")},_addUiModelEventListeners:function(){this.listenTo(this.options.sendFilesUiModel,"change:cl_active_view",this.onActiveViewChange)},onActiveViewChange:function(){var e=this.options.sendFilesUiModel.get("cl_active_view");"welcome"!==e?this.$usCLWelcome.hide():this.$usCLWelcome.show()}}),i.CreateLinkTabView}),define("pdmplugins/unified-share/js/views/us-tab-container-view",["core/ac-core","files/ac-files","pdmplugins/unified-share/js/ac-unified-share","pdmplugins/unified-share/js/templates/us-tab-container-template","i18n!pdmplugins/unified-share/js/nls/ui-strings","pdmplugins/unified-share/js/views/us-share-tab-view","pdmplugins/unified-share/js/views/us-create-link-tab-view"],function(e,i,t,s,n){return t.TabCollection=e.Collection.extend({select:function(e){this.each(function(i){i.set("selected",e===i)})}}),t.TabView=e.View.extend({initialize:function(){this.render(),this.model.on("change:selected",function(){this.render()},this)},select:function(){this.model.collection.select(this.model)},render:function(){e.View.prototype.render.call(this),this.$el.toggleClass("active",this.model.get("selected"))}}),t.USTabContainerView=e.View.extend({events:{"click .us-tab":"openTab"},tabContentViews:{},tabViews:{},initialize:function(){_.bind(this.openTab,this),_.bind(this.initialize,this),e.View.prototype.initialize.call(this),this._template=_.template(s);this.$el;0===this.$el.children().length&&this.$el.html(this._template({share_tab_head:n.SHARE_TAB_HEADER,create_link_tab_head:n.CREATE_LINK_TAB_HEADER}));var i=new t.TabCollection;t.tabCollection=i;var o=$("#us-tab-selector"),a=$("#us-tab-selector").find(".us-tab");_.each(a,function(e){i.add({id:$(e).attr("id"),selected:!1});var s=new t.TabView({model:i.last(),el:e});o.append(s.$el)}),i.select(i.at(0)),console.log(i.at(0).get("id")),this.openTab({currentTarget:"#"+i.at(0).get("id")})},render:function(){this.$el;e.View.prototype.render.call(this)},openTab:function(e){var i=$(e.currentTarget);switch($("#us-tab-content-container").children().detach(),this.tabContentViews[i.attr("id")]||(this.tabContentViews[i.attr("id")]=this.createTabContentViewForEl(i)),_.each(t.tabCollection.models,function(e){e.get("id")===i.attr("id")&&e.collection.select(e)}),$("#us-tab-content-container").append(this.tabContentViews[i.attr("id")].$el),this.tabContentViews[i.attr("id")].render(),i.attr("id")){case"share-tab":this.options.sendFilesUiModel.set("US_tab_open","share");break;case"create-link-tab":this.options.sendFilesUiModel.set("US_tab_open","createLink")}},createTabContentViewForEl:function(e){var i,s=_.extend(this.options,{el:$("#us-tab-content-container")});switch(e.attr("id")){case"share-tab":i=new t.ShareTabView(s);break;case"create-link-tab":i=new t.CreateLinkTabView(s)}return i}}),t.USTabContainerView}),define("pdmplugins/unified-share/js/templates/us-accordians-view-template",[],function(){return'<div class="share-accordian accordian ui-theme theme-share-border"><div class = "share-accordian-heading accordian-heading ui-theme theme-text" id = "share_individual"><div><%= SHARE_ACCORDIAN %><button class="accordian-arrow share-accordian-arrow core-remove-x" role="accordian" aria-label = "<%= INVITE_PEOPLE_LABEL %>"></button></div></div><div class = "accordian-content share-accordian-content" id = "share_individual_content"></div></div><div class="get-link-accordian accordian ui-theme theme-share-border"><div class = "get-link-accordian-heading accordian-heading ui-theme theme-text" id ="share_public"><div><%= GET_LINK_ACCORDIAN %><button class="accordian-arrow get-link-accordian-arrow core-remove-x" role="accordian" aria-label = "<%= GET_LINK_LABEL %>"></button></div><div class = "get-link-accordian-summary accordian-summary ui-theme theme-text"><%= GET_LINK_ACCORDIAN_SUMMARY %></div></div><div class = "accordian-content get-link-accordian-content" id ="share_public_content"></div></div><div class="send-mail-accordian accordian ui-theme theme-share-border"><div class = "send-mail-accordian-heading accordian-heading ui-theme theme-text" id ="attachToEmail"><div><%= SEND_MAIL_ACCORDIAN %><button class="accordian-arrow send-mail-accordian-arrow core-remove-x" role="accordian" aria-label = "<%= SEND_MAIL_LABEL %>"></button></div></div><div class = "accordian-content send-mail-accordian-content" id ="attachToEmail_content"></div></div>'}),define("pdmplugins/unified-share/js/templates/us-send-mail-accordian-view-template",[],function(){return'<div class = "sm-accordian-content-container"><div class = "sm-mode-selector"></div><div class = "sm-profile-selector"></div><div class = "sm-button-bar" ><button class="sm-button control-button button-grey ui-theme theme-share-grey-button" id="sm-continue"><%= SM_CONTINUE %></div></div>'}),define("pdmplugins/unified-share/js/templates/us-sm-service-selector-view-template",[],function(){return'<div><table class="us-table"><tr class="us-row"><td class="us-radio-cell us-sm-radio-cell"><input class = "service-selector sm-service-selector" type="radio" id="sm_default_mail" name = "sm_mode" checked></td><td><label for="sm_default_mail" id = "sm_default_mail_label" class="sm-service-selector-label ui-theme theme-text"><%= DEFAULT_EMAIL %></label></td></tr><tr class="us-row"><td class="us-radio-cell us-sm-radio-cell"><input class = "service-selector sm-service-selector" type="radio" id="sm_webmail" name = "sm_mode"></td><td><label for="sm_webmail" id = "sm_webmail_label" class="sm-service-selector-label ui-theme theme-text"><%= USE_WEBMIAL %></label></tr></table></div>'}),define("pdmplugins/unified-share/js/views/us-sm-service-selector-view",["core/ac-core","pdmplugins/unified-share/js/ac-unified-share","pdmplugins/unified-share/js/templates/us-sm-service-selector-view-template","i18n!pdmplugins/unified-share/js/nls/ui-strings"],function(e,i,t,s){return i.USSMServiceSelectorView=e.View.extend({events:{"click .sm-service-selector":"_selectService"},initialize:function(){e.View.prototype.initialize.call(this),this.mouseUp=!1},render:function(){this.$el;e.View.prototype.render.call(this),this._template=_.template(t),0===this.$el.children().length&&(this.$el.html(this._template({DEFAULT_EMAIL:s.DEFAULT_EMAIL_APP,USE_WEBMIAL:s.USE_WEBMAIL,DEFAULT_EMAIL_TITLE:s.DEFAULT_EMAIL_APP,USE_WEBMIAL_TITLE:s.USE_WEBMAIL})),this._initWrappers(),this._addEventListeners()),this._addUiModelEventListeners(),this._setEmailClientName(),this._selectModeFromServiceSelected()},_initWrappers:function(){this.$SmDefaultMailLabel=this.$("#sm_default_mail_label"),this.$SmWebmailLabel=this.$("#sm_webmail_label"),this.$smWebmail=this.$("#sm_webmail")},_addUiModelEventListeners:function(){var e=this.options.SendMailUiModel;e.on("change:send_mail_mode",this._onSendMailModeChange)},_onSendMailModeChange:function(){this.render()},_addEventListeners:function(){$(document).mouseup(_.bind(function(e){e.target.className.includes("service-selector-label")&&(this.mouseUp=!0)},this))},_selectService:function(e){var i=this.options.SendMailUiModel,t=$(e.currentTarget),s=t.attr("id");i.set("send_mail_mode",s),this.mouseUp&&t.blur(),this.mouseUp=!1},_setEmailClientName:function(){var e=s.DEFAULT_EMAIL_APP+" ("+this.options.SendMailUiModel.get("default_email_client")+")";this.$SmDefaultMailLabel.text(e)},_selectModeFromServiceSelected:function(){var e=this.options.SendMailUiModel.get("send_mail_mode");this.$("#"+e).attr("checked",!0)},_hideDisableWebmailUI:function(){this.$smWebmail.attr("disabled",!0),this.$smWebmail.addClass("disabled"),this.$SmWebmailLabel.addClass("disabled")}}),i.USSMServiceSelectorView}),define("pdmplugins/unified-share/js/templates/us-sm-webmail-profile-selector-template",[],function(){return'<div class = "ui-theme theme-text webmail-advisory" ><%= WEBMAIL_ADVISORY %></div><div class = "custom-select"><select class = " ui-theme theme-text theme-container theme-border webmail-profile-select"></select></div>'}),define("pdmplugins/unified-share/js/views/us-sm-webmail-profile-selector",["core/ac-core","pdmplugins/unified-share/js/ac-unified-share","pdmplugins/unified-share/js/templates/us-sm-webmail-profile-selector-template","i18n!pdmplugins/unified-share/js/nls/ui-strings"],function(e,i,t,s){return i.USSMProfileSelector=e.View.extend({events:{"change .webmail-profile-select":"_onProfileSelect"},initialize:function(){e.View.prototype.initialize.call(this)},render:function(){this.$el;e.View.prototype.render.call(this),this._template=_.template(t),0===this.$el.children().length&&(this.$el.html(this._template({WEBMAIL_ADVISORY:s.WEBMAIL_ADVISORY})),this._initWrappers()),this._addUiModelEventListeners(),this._updateProfilesListUI(),this.updateSelectedProfileInUI()},_initWrappers:function(){this.$WebmailProfileSelect=this.$(".webmail-profile-select")},_addUiModelEventListeners:function(){var e=this.options.SendMailUiModel;e.on("change:email_addresses",this._updateProfilesListUI),e.on("change:selected_profile",this.updateCssOnProfileSelected)},updateCssOnProfileSelected:function(){var e=this.options.SendMailUiModel.get("selected_profile");""===e||e===s.SELECT_OPTION?this.$WebmailProfileSelect.css("font-style","italic"):this.$WebmailProfileSelect.css("font-style","normal")},_updateProfilesListUI:function(){var e=this.options.SendMailUiModel,i=_.clone(e.get("email_addresses")),t=Object.getOwnPropertyNames(i);t.reverse(),this.resetProfilesListUiToDefault();for(var s=0;s<t.length;s++)this.$WebmailProfileSelect.children("option").eq(1).before($("<option></option>").val(t[s]).text(t[s]));this.$WebmailProfileSelect.children("option").addClass("ui-theme theme-text profile-option"),this.$WebmailProfileSelect.children("option").first().hide()},_onProfileSelect:function(){var e=this.$WebmailProfileSelect.find("option:selected").text();this.options.SendMailUiModel.set("selected_profile",e)},resetProfilesListUiToDefault:function(){this.$WebmailProfileSelect.empty(),this.$WebmailProfileSelect.append($("<option></option>").val(s.SELECT_OPTION).text(s.SELECT_OPTION)),this.$WebmailProfileSelect.append($("<option></option>").val(s.ADD_GMAIL).text(s.ADD_GMAIL)),this.$WebmailProfileSelect.children("option").addClass("ui-theme theme-text profile-option"),this.$WebmailProfileSelect.children("option").first().hide()
},updateSelectedProfileInUI:function(){var e=this.options.SendMailUiModel.get("selected_profile");this.$WebmailProfileSelect.val(""===e?s.SELECT_OPTION:e)}}),i.USSMProfileSelector}),define("pdmplugins/unified-share/js/models/ui/send-mail-ui-model",["core/ac-core","pdmplugins/unified-share/js/ac-unified-share","core/utils/action-ids","i18n!pdmplugins/unified-share/js/nls/ui-strings","core/models/ui/ui-model"],function(e,i){i.SendMailUiModel=e.UiModel.extend({recognized:{send_mail_mode:{type:"string",optional:!1,choices:["sm_default_mail","sm_outlook","sm_webmail","invalid"]},default_email_client:{type:"string",optional:!1},email_addresses:{type:"object",optional:!0},selected_profile:{type:"string",optional:!1},default_mail_set:{type:"boolean",optional:!0},show_outlook_option:{type:"boolean",optional:!0}},defaults:{send_mail_mode:"sm_default_mail",default_email_client:"",email_addresses:{},selected_profile:"",default_mail_set:!1,show_outlook_option:!1},initialize:function(){},resetTodefaults:function(){this.resetElementsTodefaults(),this.resetArrays()},resetArrays:function(){this.set("email_addresses",{},{silent:!0})},resetElementsTodefaults:function(){this.set({send_mail_mode:"sm_default_mail",default_email_client:"",selected_profile:"",default_mail_set:!1,show_outlook_option:!1})}})}),define("pdmplugins/unified-share/js/views/us-send-mail-accordian-view",["core/ac-core","pdmplugins/unified-share/js/ac-unified-share","pdmplugins/unified-share/js/templates/us-send-mail-accordian-view-template","i18n!pdmplugins/unified-share/js/nls/ui-strings","pdmplugins/unified-share/js/utils/sc-constants","pdmplugins/unified-share/js/views/us-sm-service-selector-view","pdmplugins/unified-share/js/views/us-sm-webmail-profile-selector","pdmplugins/unified-share/js/models/ui/send-mail-ui-model"],function(e,i,t,s,n){return i.USSendMailAccView=e.View.extend({events:{"click .sm-button":"_onContinueClick"},initialize:function(){e.View.prototype.initialize.call(this),this.options.SendMailUiModel=new i.SendMailUiModel},render:function(){this.$el;e.View.prototype.render.call(this),this._template=_.template(t),0===this.$el.children().length&&(this.$el.html(this._template({SM_CONTINUE:s.READER_FILESELECT_CONTINUE_BUTTON})),this._initWrappers()),this._getDefaultEmailClient(),this._addUiModelEventListeners(),this._renderChildViews(),this.toggleProfileSelectorVisibility(),this.toggleProceedButton(),this.fetchAllProfiles(!1),this.getLastUsedChoices()},teardown:function(){this.setLastUsedchoices()},_initWrappers:function(){this.$smModeSelector=this.$(".sm-mode-selector"),this.$smButton=this.$(".sm-button"),this.$smProfileSelector=this.$(".sm-profile-selector")},_addUiModelEventListeners:function(){var e=this.options.SendMailUiModel;e.on("change:send_mail_mode",this._onSendMailModeChange),e.on("change:selected_profile",this._onProfileSelected)},_renderChildViews:function(){this._renderChildView("_smModeSelector",i.USSMServiceSelectorView,this.$smModeSelector),this._renderChildView("_smProfileSelector",i.USSMProfileSelector,this.$smProfileSelector)},_getDefaultEmailClient:function(){this.options.appApi.rnaApi.then(_.bind(function(e){e.stApi.getDefaultEmailClient().then(_.bind(function(e){this.options.SendMailUiModel.set("default_email_client",this._getEmailClientName(e)),this._smModeSelector.render()},this),_.bind(function(){return $.Deferred().reject().promise()},this))},this),_.bind(function(){return $.Deferred().reject().promise()},this))},_onSendMailModeChange:function(){this.toggleProfileSelectorVisibility(),this.toggleProceedButton()},_onProfileSelected:function(){this.toggleProceedButton();var e=this.options.SendMailUiModel,i=e.get("selected_profile");i===s.ADD_OTHER?(console.log("configure email"),this._configureProfile(n.BASICMAIL)):i===s.ADD_GMAIL&&(console.log("configure GMAIL"),this._configureProfile(n.GMAIL))},toggleProfileSelectorVisibility:function(){var e=this.options.SendMailUiModel,i=e.get("send_mail_mode");"sm_default_mail"===i?this.$smProfileSelector.hide():"sm_webmail"===i&&this.$smProfileSelector.show()},toggleProceedButton:function(){var e=this.options.SendMailUiModel,i=e.get("send_mail_mode"),t=e.get("selected_profile");"sm_default_mail"===i||t!==s.SELECT_OPTION&&""!==t&&t!==s.ADD_OTHER&&t!==s.ADD_GMAIL&&t!==s.ADD_YAHOO?this.$smButton.removeClass("disabled").removeAttr("disabled"):this.$smButton.addClass("disabled").attr("disabled","disabled")},_onContinueClick:function(){var e=this.options.SendMailUiModel,i=e.get("send_mail_mode"),t=e.get("selected_profile"),o=e.get("email_addresses")[t];if("sm_default_mail"===i){var a=this.options.sendFilesUiModel.get("ShareVariant"),l=n.USE,r="default email attachment";this.options.appApi.siteCatalystApi.logScEvent([a,l,r]),this._sendMail(!1,"none")}else{if(t===s.SELECT_OPTION||""===t||t===s.ADD_OTHER||t===s.ADD_GMAIL||t===s.ADD_YAHOO)return;var a=this.options.sendFilesUiModel.get("ShareVariant"),l=n.USE,r="webmail attachment";this.options.appApi.siteCatalystApi.logScEvent([a,l,r]),this._sendMail(!0,o)}},_sendMail:function(e,i){if(this.options.sendFilesUiModel.isMultipleFilesSelected()||"contentPlusRHP"===this.options.sendFilesUiModel.get("layout")){var t=[],s={},n=this.options.sendFilesUiModel.get("local_file_objects"),o=this.options.sendFilesUiModel.get("metadata_collection"),a=this.options.sendFilesUiModel.get("connector_file_objects"),l=a.length+o.length;_.each(n,_.bind(function(e){e.get("assetId")?(t.push(e.get("assetId")),++l):t.push(e._proxy)},this)),_.each(o.models,_.bind(function(e){t.push(e.get("id"))},this)),s.selectedFileIds=t,s.useWebmailObj=e,s.profileObj=i,s.filesToDownloadLengthObj=l,this.options.appApi.rnaApi.then(_.bind(function(e){e.stApi.attachToEmail(s).then(_.bind(function(){this.setLastUsedchoices()},this),_.bind(function(){return $.Deferred().reject().promise()},this))},this),_.bind(function(){return $.Deferred().reject().promise()},this))}else this.options.appApi.rnaApi.then(_.bind(function(t){var s={useWebmail:e,profile:i};t.stApi.sendMailWithoutFLD(s).then(_.bind(function(){this.setLastUsedchoices()},this),_.bind(function(){return $.Deferred().reject().promise()},this))},this),_.bind(function(){return $.Deferred().reject().promise()},this))},fetchAllProfiles:function(e){this.options.appApi.rnaApi.then(_.bind(function(i){i.stApi.getAllWebmailProfiles().then(_.bind(function(i){e&&this._updateSelectedProfile(i,!0),this._updateProfilesInUiModel(i),this._smProfileSelector.updateSelectedProfileInUI()},this),_.bind(function(){return $.Deferred().reject().promise()},this))},this),_.bind(function(){return $.Deferred().reject().promise()},this))},_configureProfile:function(e){this.options.appApi.rnaApi.then(_.bind(function(i){i.stApi.configureProfile(e).then(_.bind(function(){this.fetchAllProfiles(!0)},this),_.bind(function(e){return this._updateSelectedProfile(e,!1),this._smProfileSelector.updateSelectedProfileInUI(),$.Deferred().reject().promise()},this))},this),_.bind(function(){return $.Deferred().reject().promise()},this))},_updateProfilesInUiModel:function(e){for(var i={},t=Object.getOwnPropertyNames(e),s=0;s<t.length;s++){var n=e[t[s]],o=n.EmailAddress;i[o]=t[s]}Object.keys(i).length>0&&this.options.SendMailUiModel.set("email_addresses",i)},_updateSelectedProfile:function(e,i){var t,s=Object.getOwnPropertyNames(e),n=this.options.SendMailUiModel.get("email_addresses");if(i)for(var o=0;o<s.length;o++){var a=e[s[o]],l=a.EmailAddress;if(!n[l]){t=l,this.options.SendMailUiModel.set("selected_profile",t);break}}else this.options.SendMailUiModel.set("selected_profile","")},_getEmailClientName:function(e){switch(e){case 0:return s.EMAIL_CLIENT_OTHER;case 1:return s.EMAIL_CLIENT_EUDORA;case 2:return s.EMAIL_CLIENT_LOTUS_NOTES;case 3:return s.EMAIL_CLIENT_NETSCAPE;case 4:return s.EMAIL_CLIENT_OUTLOOK;case 5:return s.EMAIL_CLIENT_OUTLOOK_EXPRESS;case 6:return s.EMAIL_CLIENT_ENTOURAGE;case 7:return s.EMAIL_CLIENT_MAIL;case 8:return s.UNKNOWN;default:return s.UNKNOWN}},setLastUsedchoices:function(){var e=this.options.SendMailUiModel,i=e.get("selected_profile"),t=!0,n=e.get("default_mail_set"),o="sm_webmail"===e.get("send_mail_mode");(""!==i||i!==s.SELECT_OPTION)&&(i=e.get("email_addresses")[i]),this.options.appApi.rnaApi.then(_.bind(function(e){e.stApi.setLastUsedPreferences([t,o,i,n])},this))},getLastUsedChoices:function(){this.options.appApi.rnaApi.then(_.bind(function(e){e.stApi.getLastUsedPreferences().then(_.bind(function(e){this.updateLastUsedChoices(e),this._smProfileSelector.updateSelectedProfileInUI()},this),_.bind(function(){return $.Deferred().reject().promise()},this))},this),_.bind(function(){return $.Deferred().reject().promise()},this))},updateLastUsedChoices:function(e){var i,t,s,n,o,a,l=this.options.SendMailUiModel;e&&(i=e.didLastUsedWebmail,o=e.defaultSet,a=e.webmailDisabled,l.set("default_mail_set",o),a?(l.set("send_mail_mode","sm_default_mail"),this._hideOrDisableWebmailUI()):i&&(t=e.useWebmail,t?(l.set("send_mail_mode","sm_webmail"),s=e.selectedProfile,n=this._convertEncodedToSimpleProfile(s),l.set("selected_profile",n)):l.set("send_mail_mode","sm_default_mail")))},_hideOrDisableWebmailUI:function(){this._smModeSelector._hideDisableWebmailUI()},_convertEncodedToSimpleProfile:function(e){for(var i=this.options.SendMailUiModel,t=i.get("email_addresses"),s=Object.getOwnPropertyNames(t),n=0;n<s.length;n++)if(t[s[n]]===e)return s[n];return""}}),i.USSendMailAccView}),define("pdmplugins/unified-share/js/views/us-accordians-view",["core/ac-core","files/ac-files","pdmplugins/unified-share/js/ac-unified-share","pdmplugins/unified-share/js/templates/us-accordians-view-template","i18n!pdmplugins/unified-share/js/nls/ui-strings","pdmplugins/unified-share/js/utils/sc-constants","pdmplugins/unified-share/js/views/us-share-tab-view","pdmplugins/unified-share/js/views/us-create-link-tab-view","pdmplugins/unified-share/js/views/us-send-mail-accordian-view"],function(e,i,t,s,n,o){var a={share_individual:"Send Invitation Selected",share_public:"Get Link Selected",attachToEmail:"Attachment Selected"},l={share_individual:"share",share_public:"createLink",attachToEmail:"attachToEmail"},r={share_individual:n.SHARE_INDIVIDUAL,share_public:n.SHARE_PUBLIC,attachToEmail:n.SHARE_ATTACH};return t.USAccordiansView=e.View.extend({events:{"click .accordian-heading":"_selectAccordian"},initialize:function(){e.View.prototype.initialize.call(this),this._template=_.template(s),0===this.$el.children().length&&(this.$el.html(this._template({SHARE_ACCORDIAN:n.SHARE_INDIVIDUAL,GET_LINK_ACCORDIAN:n.SHARE_PUBLIC,SHARE_ACCORDIAN_SUMMARY:n.SHARE_ACCORDIAN_SUMMARY,GET_LINK_ACCORDIAN_SUMMARY:this.options.sendFilesUiModel.get("isReviewVisible")?n.GET_LINK_ADVISORY_MSG:n.GET_LINK_ADVISORY_MSG_READER,SEND_MAIL_ACCORDIAN:n.SHARE_ATTACH,INVITE_PEOPLE_LABEL:n.INVITE_PEOPLE_ACCORDIAN_LABEL,GET_LINK_LABEL:n.SHARE_PUBLIC,SEND_MAIL_LABEL:n.SHARE_ATTACH})),this._initWrappers()),this.$(".accordian-content").hide()},render:function(){e.View.prototype.render.call(this),this._renderChildViews(),this._addUiModelEventListeners(),this._selectDefaultAccordian()},_initWrappers:function(){this.$usShareAccordian=this.$(".share-accordian-content"),this.$accordianContent=this.$(".accordian-content"),this.$usGetLinkAccordian=this.$(".get-link-accordian-content"),this.$usSendMailAccordian=this.$(".send-mail-accordian-content")},_renderChildViews:function(){this._renderChildView("_usShareIndividual",t.ShareTabView,this.$usShareAccordian),this._renderChildView("_usSharePublic",t.CreateLinkTabView,this.$usGetLinkAccordian),this._renderChildView("_usAttachToEmail",t.USSendMailAccView,this.$usSendMailAccordian),this.options.sendFilesUiModel.get("isSnTenabled")||(this.options.sendFilesUiModel.get("isAdobeSignVisible")?this.options.sendFilesUiModel.setUSMode("#sign-mode"):$(".share-accordian").hide(),$(".get-link-accordian").hide(),this.options.sendFilesUiModel.set("US_tab_open","attachToEmail"))},_addUiModelEventListeners:function(){var e=this.options.sendFilesUiModel;e.on("change:cl_active_view",this._onClActiveViewChanged)},_selectAccordian:function(e){var i=$(e.currentTarget);this._setAccordianSelected(i.attr("id"))},_setAccordianSelected:function(e,i){var t,s=$("#"+e);if(i=i?i:200,0==this._checkIfAccordianSelectionPossible(e)){var o=this.options.appApi.dialogApi,a=n.SHARE_TOO_MANY_FILES_DLG_TITLE,d=_.template(n.US_TAB_SWITCH_MULTI_FILE_ERROR,{TAB_NAME:r[e]});return o.displayHtmlAlert(o.SEVERITY_INFORMATIONAL,a,d,n.SHARE_SUCCESS_CLOSE),!1}$(".accordian-content:visible").not(s.next(".accordian-content")).slideToggle(i),s.next(".accordian-content").slideToggle(i),$(".accordian-summary:visible").not(s.find(".accordian-summary")).slideToggle(i),s.find(".accordian-summary").slideToggle(i),$(".accordian-heading.active").not(s).toggleClass("active"),s.toggleClass("active"),$(".accordian-arrow.active").not(s.find(".accordian-arrow")).toggleClass("active"),s.find(".accordian-arrow").toggleClass("active"),t=l[e],this.options.sendFilesUiModel.get("US_tab_open")!==t&&(this._logAccordianSelection(e),this.options.sendFilesUiModel.set("US_tab_open",t),"attachToEmail"===t&&this._ShowOptimizePDFBezel())},_checkIfAccordianSelectionPossible:function(e){var i=this.options.sendFilesUiModel,t=!0;return i.get("multipleFilesSupported")||"attachToEmail"===l[e]?t=!0:i.isMultipleFilesSelected()&&(t=!1),t},_ShowOptimizePDFBezel:function(){this.options.appApi.rnaApi.done(_.bind(function(e){e.stApi.invokeMethod({methodName:"showOptimizePDFBezel"})}))},_logAccordianSelection:function(e){var i=this.options.sendFilesUiModel.get("ShareVariant"),t=o.DISCOVER,s=a[e];this.options.appApi.siteCatalystApi.logScEvent([i,t,s])},_selectDefaultAccordian:function(){var e,i={share_individual_content:"share",share_public_content:"createLink",attachToEmail_content:"attachToEmail"},t={share:"share_individual",createLink:"share_public",attachToEmail:"attachToEmail"},s=this.options.sendFilesUiModel.get("US_tab_open");if($(".accordian-content:visible").length&&(e=$(".accordian-content:visible")[0].id),!e||s!==i[e]){var n=this.options.sendFilesUiModel.get("ShareVariant"),l=o.DISCOVER,r=a[t[s]]+" by default";this.options.appApi.siteCatalystApi.logScEvent([n,l,r]),this._setAccordianSelected(t[s],50)}},_onClActiveViewChanged:function(){{var e=this.options.sendFilesUiModel;e.get("US_tab_open"),e.get("cl_active_view")}}}),t.USAccordiansView}),define("pdmplugins/unified-share/js/templates/us-share-success-template",[],function(){return'<div id="us-success-view-container"><button class="share-success-close core-remove-x" id= "close-share-cross-icon"></button><button class="us-cl-success-view-image"/><div class="doc-sent-container"><div class="review-generated-heading theme-text"><%= REVIEW_GENERATED_MSG %></div><div class="doc-sent-text-heading theme-text"><%= DOC_SENT_HEADING %></div><div class="doc-sent-text-summary theme-text"><%= DOC_SENT_SUMMARY %></div></div><div id="us-track-sent-doc"><button class="control-button button-grey ui-theme theme-share-grey-button" id="success-goto-sent-files"><%= GO_TO_SENT_FILES %></button></div><div id="success-close-share-container"><button class="ui-theme theme-text" id="success-close-share"><%=SUCCESS_CLOSE %></button></div></div>'}),define("pdmplugins/unified-share/js/views/us-share-success-view",["core/ac-core","pdmplugins/unified-share/js/ac-unified-share","pdmplugins/unified-share/js/templates/us-share-success-template","i18n!pdmplugins/unified-share/js/nls/ui-strings","pdmplugins/unified-share/js/ops/close-app-op"],function(e,i,t,s){return i.ShareSuccessView=e.View.extend({events:{"click #success-goto-sent-files":"_onClickSentLink","click #close-share-cross-icon":"_onClickClose","click #success-close-share":"_onClickClose"},initialize:function(){e.View.prototype.initialize.call(this),this._template=_.template(t)},render:function(){if(e.View.prototype.render.call(this),0===this.$el.children().length){var i=this.options.sendFilesUiModel.get("us_mode"),t=this.options.sendFilesUiModel.isMultipleFilesSelected(),n=this.options.sendFilesUiModel.getRecipientsArray().length>1,o="#send-mode"==i?t?s.DOCS_SENT_SUMMARY:s.DOC_SENT_SUMMARY:s.DOC_SENT_SUMMARY_REVIEW,a=n?s.INVITES_SENT:s.INVITE_SENT,l=t?s.TRACK_FILES:s.TRACK_FILE;this.$el.html(this._template({SUCCESS_CLOSE:s.CLOSE_STRING,GO_TO_SENT_FILES:l,DOC_SENT_HEADING:a,DOC_SENT_SUMMARY:o,REVIEW_GENERATED_MSG:s.REVIEW_GENERATED_MSG})),this._initWrappers(),"#review-mode"===i?(this.$sentHeading.hide(),this.$sentSuccessSummary.hide(),this.$ManageFilesButton.hide()):this.$reviewHeading.hide()}this._centerVertically()},_initWrappers:function(){this.$ManageFilesButton=this.$("#success-goto-sent-files"),this.$usSuccessViewContainer=this.$("#us-success-view-container"),this.$sentSuccessSummary=this.$(".doc-sent-text-summary"),this.$sentHeading=this.$(".doc-sent-text-heading"),this.$reviewHeading=this.$(".review-generated-heading")},_onSendAgainClick:function(){var e=this.options.sendFilesUiModel;e.setShareState("preShare")},_onClickSentLink:function(){var t="sentfiles";this.options.appApi.rnaApi.done(_.bind(function(s){if(s.isRunningInBrowser())this.options.appApi.sessionApi.ensureSignedIn().done(_.bind(function(){e.opFactory.create("GettingSsoUriOp",this.options).run(t).done(function(e){e&&window.open(e.uri)})},this));else{var n={};if(n.op="setHighlightWorkflowId",n.workflowID=this.options.sendFilesUiModel.attributes.parcel.parcel_id,n.sourcePlugin="unifiedShare",n.assetFileName="",n.assetWorkflowId="",s.stApi.updateInAppDMStateAPI(n),s.selectLeftRailItem("sentfiles"),"contentPlusRHP"===this.options.sendFilesUiModel.get("layout")){var o=new i.CloseAppOp(this.options);o.run()}}},this))},_onClickClose:function(){var e=new i.CloseAppOp(this.options);e.run()},_centerVertically:function(){var e,i=$("#unified-share-container").height();console.log("the height is  : "+i),e=.3*i,e>15&&(e-=15),this.$usSuccessViewContainer.css("margin-top",e)}}),i.ShareSuccessView}),define("pdmplugins/unified-share/js/templates/us-share-working-template",[],function(){return'<div class = "share-upload-modal"></div>'}),define("pdmplugins/unified-share/js/views/us-modal-view",["core/ac-core","pdmplugins/unified-share/js/ac-unified-share","pdmplugins/unified-share/js/templates/us-share-working-template","i18n!pdmplugins/unified-share/js/nls/ui-strings"],function(e,i,t){return i.UsModalView=e.View.extend({initialize:function(){e.View.prototype.initialize.call(this),this._template=_.template(t)},render:function(){e.View.prototype.render.call(this),0===this.$el.children().length&&(this.$el.html(this._template({})),this._initWrappers())},_initWrappers:function(){}}),i.UsModalView}),define("pdmplugins/unified-share/js/views/us-rhp-content-view",["core/ac-core","files/ac-files","pdmplugins/unified-share/js/ac-unified-share","pdmplugins/unified-share/js/templates/us-rhp-content-template","i18n!pdmplugins/unified-share/js/nls/ui-strings","pdmplugins/unified-share/js/utils/sc-constants","core/utils/file-types","pdmplugins/unified-share/js/ops/desktop-add-files-op","pdmplugins/unified-share/js/views/us-file-list-view","pdmplugins/unified-share/js/models/ui/selector-ui-model","pdmplugins/unified-share/js/views/us-tab-container-view","pdmplugins/unified-share/js/views/us-accordians-view","pdmplugins/unified-share/js/views/us-share-success-view","pdmplugins/unified-share/js/views/us-modal-view","pdmplugins/unified-share/js/views/us-create-link-working-view","pdmplugins/unified-share/js/views/us-create-link-complete-view","pdmplugins/unified-share/js/ops/close-app-op"],function(e,i,t,s,n){return t.RhpContentView=e.View.extend({events:{"click .share-close":"_onClickClose"},initialize:function(){e.View.prototype.initialize.call(this),this._template=_.template(s)},render:function(){e.View.prototype.render.call(this),0===this.$el.children().length&&(this.$el.html(this._template({SHARE:n.SHARE_HEADING,CLOSE:n.CLOSE_SHARE_PANE})),this._initWrappers()),this._renderChildViews(),this.$usWelcomeView.show(),this._updateEscKeyHandler(),this._addUiModelEventListeners(),this._addKeyEventListener(),this._adjustUniShareContainerHeight()},_addUiModelEventListeners:function(){var e=this.options.sendFilesUiModel;e.on("change:us_share_state",this._onUsShareStateChange),e.get("email_addr_collection").on("all",this._onRecipientsChange),e.on("change:share_loader_text",this._updateLoaderText),e.on("change:cl_active_view",this._onClActiveViewChange)},_addKeyEventListener:function(){this.options.appApi.keyApi.pushKeyHandler(this),$(window).resize(this._adjustUniShareContainerHeight)},_onKeyDown:function(e){var i=e.which;return 27===i?(this._onClickClose(),this._consumeEvent(e),!0):void 0},_adjustUniShareContainerHeight:function(){var e=$("#unified-share-container").height(),i=this.$usClose.height(),t=this.$usRhpContainer.css("padding-bottom");$("#unified-share-rhp-view").height(e),this.$usRhpContainer.height(e-i-parseInt(t))},_initWrappers:function(){this.$usRhpContainer=this.$("#unified-share-rhp-container"),this.$usWelcomeView=this.$("#us-share-welcome-view"),this.$usFileListContainer=this.$("#us-file-list-container"),this.$usTabSelector=this.$("#us-tab-selector"),this.$usTabContent=this.$("#us-tab-content-container"),this.$usSuccessView=this.$("#us-success-view"),this.$usModalView=this.$("#us-modal-view"),this.$usAccordianViewContainer=this.$("#us-accordians-view-container"),this.$shareLoader=this.$(".share-loader"),this.$Loadertext=this.$("#uploading-text"),this.$modeText=this.$("#mode-text"),this.$usClWorkingView=this.$("#us-cl-working-view"),this.$usClSuccessView=this.$("#us-cl-success-view"),this.$usClose=this.$("#us-close")},_onRecipientsChange:function(){this._processRecipients(!0)},_processRecipients:function(){},_onClickClose:function(){var e=new t.CloseAppOp(this.options);e.run()},_renderChildViews:function(){this._renderChildView("_unisharefilelistview",t.UniShareFileListView,this.$usFileListContainer);var e=this.options.sendFilesUiModel.get("fetchDocPromise");_.isUndefined(e)?this._renderChildView("_usAccordianContainerView",t.USAccordiansView,this.$usAccordianViewContainer):e.then(_.bind(function(){this.options.sendFilesUiModel.set("fetchDocPromise",void 0),this._renderChildView("_usAccordianContainerView",t.USAccordiansView,this.$usAccordianViewContainer)},this))},_onUsShareStateChange:function(){console.log("on share state changed");var e=this.options.sendFilesUiModel,i=e.get("us_share_state");this.$usWelcomeView.show(),this.$shareLoader.hide(),"preShare"===i?(this.$usSuccessView.hide(),this.$usWelcomeView.show(),this.$usModalView.hide(),this.$shareLoader.hide(),this.render()):"postShare"===i?(this._renderChildView("_shareSuccessView",t.ShareSuccessView,this.$usSuccessView),this.$usSuccessView.show(),this.$usWelcomeView.hide(),this.$usModalView.hide(),this.$shareLoader.hide()):(this._renderChildView("_shareWorkingView",t.UsModalView,this.$usModalView),this.$usModalView.hide(),this.$shareLoader.show(),this._makeLoaderCenterVertically(),this._setLoaderText(),this.$usWelcomeView.hide())},_setLoaderText:function(){var e=this.options.sendFilesUiModel,i=e.get("us_mode");this.$Loadertext.text(""),"#review-mode"===i?(this.$modeText.text(n.SHARE_LOADER_UPLOAD_REVIEW2),this.$Loadertext.text("")):"#sign-mode"===i?(this.$modeText.text(n.SHARE_LOADER_UPLOAD_SIGN),this.$Loadertext.text("")):(this.$modeText.text(e.isMultipleFilesSelected()?n.SENDING_FILES_MULTIPLE:n.SENDING_FILES),this.$Loadertext.text(""))},_updateLoaderText:function(){var e=this.options.sendFilesUiModel,i=e.get("us_mode");"#send-mode"===i&&this.$Loadertext.text(e.get("share_loader_text"))},_updateEscKeyHandler:function(){this.options.appApi.rnaApi.then(_.bind(function(e){e.stApi.handleEscKeyAtCef()},this),_.bind(function(){return $.Deferred().reject().promise()},this))},_onClActiveViewChange:function(){var e=this.options.sendFilesUiModel,i=e.get("cl_active_view");switch(this._renderChildView("_shareWorkingView",t.UsModalView,this.$usModalView),this.$usModalView.hide(),this.$usClWorkingView.hide(),this.$usClSuccessView.hide(),this.$usWelcomeView.show(),i){case"working":this._renderChildView("_usClWorkingView",t.CreateLinkWorkingView,this.$usClWorkingView),this.$usClWorkingView.show(),this.$usWelcomeView.hide();break;case"complete":this._renderChildView("_usClSuccessView",t.CreateLinkCompleteView,this.$usClSuccessView),this.$usClSuccessView.show(),this.$usWelcomeView.hide()}},_makeLoaderCenterVertically:function(){var e,i=$("#unified-share-container").height();console.log("the height is  : "+i),e=.3*i,this.$shareLoader.css("margin-top",e)}}),t.RhpContentView}),define("pdmplugins/unified-share/js/modalView/templates/us-modal-view-content-template",[],function(){return'<div id="us-modal-view-container"><div id="us-modal-close" class ="ui-theme theme-share-modal-container theme-share-border"><div id="modal-share-heading" class ="ui-theme theme-text theme-share-modal-container"><%= USM_SHARE_DIALOG_HEADING %></div><button id = "share-modal-close" class="share-modal-close share-close core-remove-x" aria-label ="<%= CLOSE %>" title="<%= CLOSE %>"></button></div><div id="us-success-view" class ="ui-theme"></div><div id="us-subscribe-now-view" class ="ui-theme theme-share-modal-container"></div><div id="us-modal-view" tabindex = "-1" class ="ui-theme theme-share-modal-container"></div><div class="share-modal-loader"><div class="loader" id="modal-loader"></div><div id="mode-text" class= "us-modal-mode-text ui-theme theme-text"></div><div id="uploading-text" class= "us-modal-uploading-text ui-theme theme-text"></div></div><div id="us-modal-share-welcome-view" class ="ui-theme theme-share-modal-container"><table class="us-modal-view-table" cellspacing="0" cellpadding="0"><tr class="us-modal-view-table-row"><td class="us-modal-view-table-column-left ui-theme theme-share-grey-container"><div id="us-modal-tab-view-container" class ="ui-theme theme-share-grey-container"></div></td><td class="us-modal-view-table-column-right ui-theme theme-share-modal-container"><div id="us-modal-expansion-view-container" class ="ui-theme theme-share-modal-container"></div></td></tr></table><div class = "us-modal-error-dialog-container us-modal-file-list-error-dialog ui-theme theme-share-border"><span class = "us-modal-error-dialog-arrow us-modal-error-dialog-file-list-arrow"></span><div class="us-modal-error-dialog-content"><div class= "us-modal-error-dialog-content-text"></div></div></div><button class= "us-modal-manage-files ui-theme theme-share-add-files theme-share-grey-container"aria-label ="<%= MANAGE_FILES %>" title="<%= MANAGE_FILES %>"><%= MANAGE_FILES %></button><div id="us-modal-file-list-container" class ="ui-theme theme-share-modal-container"></div></div></div>'}),define("pdmplugins/unified-share/js/modalView/templates/us-modal-tab-view-template",[],function(){return'<div id="us-modal-tab-view" class="ui-theme theme-share-grey-container"><div id="get-link-tab" class ="modal-view-tab ui-theme theme-tab-button cb-active-text-theme" aria-label ="<%= GET_LINK %>" tabindex= "0"><button class="get-link-icon-img modal-tab-icon" tabindex="-1"></button><div class="modal-view-tab-text ui-theme theme-text cb-active-text-theme" id="" tabindex="-1"><%= GET_LINK %></div></div><div id="share-tab" class ="modal-view-tab ui-theme theme-tab-button cb-active-text-theme" aria-label ="<%= INVITE_PEOPLE %>" tabindex= "0"><button class="invite-people-icon-img modal-tab-icon" tabindex="-1"></button><div class="modal-view-tab-text ui-theme theme-text cb-active-text-theme" id="" tabindex="-1"><%= INVITE_PEOPLE%></div></div><div id="send-attachment-tab" class ="modal-view-tab ui-theme theme-tab-button cb-active-text-theme" aria-label ="<%= SEND_ATTACHMENT %>" tabindex= "0"><button class="send-mail-icon-img modal-tab-icon" tabindex="-1"></button><div class="modal-view-tab-text ui-theme theme-text cb-active-text-theme" id="" tabindex="-1"><%= SEND_ATTACHMENT%></div></div><div id="sign-tab" class ="modal-view-tab ui-theme theme-tab-button cb-active-text-theme" aria-label ="<%= SEND_SIGNATURE %>" tabindex= "0"><button class="get-sign-icon-img modal-tab-icon" tabindex="-1"></button><div class="modal-view-tab-text ui-theme theme-text cb-active-text-theme" id="" tabindex="-1"><%= SEND_SIGNATURE%></div></div></div>'}),define("pdmplugins/unified-share/js/modalView/views/us-modal-tab-view",["core/ac-core","files/ac-files","pdmplugins/unified-share/js/ac-unified-share","pdmplugins/unified-share/js/modalView/templates/us-modal-tab-view-template","i18n!pdmplugins/unified-share/js/nls/ui-strings","pdmplugins/unified-share/js/utils/sc-constants"],function(e,i,t,s,n,o){var a={"share-tab":"Send Invitation Selected","get-link-tab":"Get Link Selected","send-attachment-tab":"Attachment Selected","sign-tab":"Get Signature Selected"},l={"share-tab":"share","get-link-tab":"createLink","send-attachment-tab":"attachToEmail","sign-tab":"sendForSignature"},r={"share-tab":n.USM_INVITE_PEOPLE_TAB_TEXT,"get-link-tab":n.USM_GET_LINK_TAB_TEXT,"send-attachment-tab":n.USM_ATTACH_EMAIL_TAB_TEXT,"sign-tab":n.SFS_TAB_HEADING};return t.UsModalTabView=e.View.extend({events:{"click .modal-view-tab":"_selectTab","click .modal-view-add-file":"_onAddFileClick"},initialize:function(){e.View.prototype.initialize.call(this),this._template=_.template(s)},render:function(){e.View.prototype.render.call(this),0===this.$el.children().length&&(this.$el.html(this._template({GET_LINK:this.getPublicShareLabel(),INVITE_PEOPLE:this.getPrivateShareLabel(),SEND_ATTACHMENT:n.USM_ATTACH_EMAIL_TAB_TEXT,SEND_SIGNATURE:n.SFS_TAB_HEADING})),this._initWrappers()),this._renderChildViews(),this._addKeyEventListener(),this._updateTabVisibilty(),this._selectDefaultTab()},_initWrappers:function(){this.$GetLinkTab=this.$("#get-link-tab"),this.$ShareTab=this.$("#share-tab"),this.$SendAttachmentTab=this.$("#send-attachment-tab"),this.$GetSignatureTab=this.$("#sign-tab")},_renderChildViews:function(){},_selectTab:function(e){var i=$(e.currentTarget),t=i.attr("id"),s=$("#"+t),d=_.isUndefined(e.default)?!1:e.default;if(0==this._checkIfTabSwitchPossible(t)){var p=n.SHARE_TOO_MANY_FILES_DLG_TITLE,h=_.template(n.US_TAB_SWITCH_MULTI_FILE_ERROR,{TAB_NAME:r[t]});return"attachToEmail"===this.options.sendFilesUiModel.get("US_tab_open")&&this.showErrorBubble(o.FILE_LIST_ERROR,p,h),void $(".modal-view-tab.selected").focus()}$(".modal-view-tab.selected").children(".modal-view-tab-text").toggleClass("selected"),$(".modal-view-tab.selected").toggleClass("selected"),s.toggleClass("selected"),s.children(".modal-view-tab-text").toggleClass("selected"),$(".modal-view-tab.selected").attr("tabindex","0"),$(".modal-view-tab").not($(".modal-view-tab.selected")).attr("tabindex","-1");var c=this.options.sendFilesUiModel.get("ShareVariant"),u=o.DISCOVER,m="Get Link Selected",E=this.options.sendFilesUiModel.get("US_tab_open");E!==l[t]&&(this.options.sendFilesUiModel.set("US_tab_open",l[t]),m=a[t],"sign-tab"===t&&$("#modal-add-signatures").focus(),d||this.options.appApi.siteCatalystApi.logScEvent([c,u,m]))},_selectDefaultTab:function(){var e=this.options.sendFilesUiModel.get("default_modal_view_tab"),i=this.options.sendFilesUiModel.get("US_tab_open"),t={share:"share-tab",createLink:"get-link-tab",attachToEmail:"send-attachment-tab",sendForSignature:"sign-tab"},s=this.options.sendFilesUiModel.get("ShareVariant"),n=o.DISCOVER,l=a[t[e]]+" by default";this.options.appApi.siteCatalystApi.logScEvent([s,n,l]),e===i&&this._selectTab({currentTarget:"#"+t[e],"default":!0})},_updateTabVisibilty:function(){this.options.sendFilesUiModel.get("isSnTenabled")||(this.$GetLinkTab.hide(),this.$ShareTab.hide(),this.options.sendFilesUiModel.set("default_modal_view_tab","attachToEmail"),this.options.sendFilesUiModel.set("US_tab_open","attachToEmail")),"onlyRHP"!==this.options.sendFilesUiModel.get("layout")?(this.options.appApi.siteCatalystApi.logScEvent([o.GET_SIG,o.UNSUPPORTED_FILES]),this.$GetSignatureTab.hide()):this.$GetSignatureTab.show(),this.options.appApi.rnaApi.done(_.bind(function(e){e.esApi.isSendForSignEnabled()||this.$GetSignatureTab.hide()
},this))},_checkIfTabSwitchPossible:function(e){var i=this.options.sendFilesUiModel,t=!0;return i.get("multipleFilesSupported")||"attachToEmail"===l[e]?t=!0:i.isMultipleFilesSelected()&&(t=!1),t},_addKeyEventListener:function(){this.options.appApi.keyApi.pushKeyHandler(this)},_onKeyDown:function(e){if(0==$(".modal-view-tab:focus").length)return!1;var i=!1,t=e.which;switch(t){case 13:case 32:this.makeChoice(),i=!0;break;case 40:this.selectDown(),i=!0;break;case 38:this.selectUp(),i=!0}return i},makeChoice:function(){var e=$(".modal-view-tab:focus").attr("id");this._selectTab({currentTarget:"#"+e})},selectUp:function(){var e=$(".modal-view-tab:focus").prev();e.length&&e.focus()},selectDown:function(){var e=$(".modal-view-tab:focus").next();e.length&&e.focus()},showErrorBubble:function(e,i,t,s){return e==o.FILE_LIST_ERROR&&($(".us-modal-file-list-error-dialog").show(),s===!0?$(".us-modal-file-list-error-dialog").find(".us-modal-error-dialog-content-text").html(t):$(".us-modal-file-list-error-dialog").find(".us-modal-error-dialog-content-text").text(t)),$("#us-modal-view").addClass("modal-for-error-dialog"),$.Deferred().resolve().promise()},getPublicShareLabel:function(){var e=this.options.sendFilesUiModel.get("ShareVariant");return"ShareModal_Default_GetLink_AddComment_Enabled"===e||"ShareModal_Default_GetLink"===e?n.USM_CREATE_LINK_LABEL:n.USM_GET_LINK_TAB_TEXT},getPrivateShareLabel:function(){var e=this.options.sendFilesUiModel.get("ShareVariant");return"ShareModal_Default_GetLink_AddComment_Enabled"===e||"ShareModal_Default_GetLink"===e?n.USM_SHARE_LINK_LABEL:n.USM_INVITE_PEOPLE_TAB_TEXT}}),t.UsModalTabView}),define("pdmplugins/unified-share/js/modalView/templates/us-modal-expansion-view-template",[],function(){return'<div id="us-modal-expansion-view"><div id="get-link-view" class ="ui-theme theme-share-modal-container"></div><div id="share-view" class ="ui-theme theme-share-modal-container"></div><div id="sign-view" class ="modal-sfs-sign-view ui-theme theme-share-modal-container"></div><div id="send-attachment-view" class ="ui-theme theme-share-modal-container"></div></div>'}),define("pdmplugins/unified-share/js/modalView/templates/us-modal-share-tab-template",[],function(){return'<div id = "us-modal-tab-view-container">	<div id="modal-invite-heading" class="ui-theme theme-text"><%= INVITE_PEOPLE_MESSAGE_HEADING %></div>	<div id="modal-invite-summary" class="modal-tab-summary ui-theme theme-text">		<div id="modal-invite-summary-text" class="ui-theme theme-header-text"><%= INVITE_PEOPLE_MESSAGE_SUMMARY %>		</div>	</div>   <div id= "email-address-template-container" class ="ui-theme theme-share-modal-container"></div>   <div id="upsell-container-invite-tab"></div>   <div id="modal-ip-options-row">       <div class="us-checkbox-cell">           <input type="checkbox" id="modal-ip-allow-comments-checkbox" aria-label ="<%= CREATE_LINK_ALLOW_COMMENTS %>" class="share-checkbox">           <label for="modal-ip-allow-comments-checkbox" class="us-modal-allow-comments-label ui-theme theme-text"><%= CREATE_LINK_ALLOW_COMMENTS %></label>           <div id="deadline-modal-selector-container" class ="ui-theme theme-share-modal-container"></div>       </div>   </div>   <div class="share-modal-button-bar ui-theme theme-share-modal-container">   <div class = "us-modal-error-dialog-container us-modal-share-error-dialog ui-theme theme-share-border">       <span class = "us-modal-error-dialog-arrow us-modal-error-dialog-share-arrow"></span>       <div class="us-modal-error-dialog-content us-modal-share-error-dialog-content">           <div class= "us-modal-error-dialog-content-text"></div>       </div>   </div>       <button class="share-files-button control-button theme-button theme-button-label"            aria-describedby="share-files-button" aria-label="<%= SEND_INVITATIONS %>"><%= SHARE_BUTTON %></button>       <button class = "ui-theme theme-text" id= "close-share-button"><%= SHARE_CLOSE %></button>   </div></div>'}),define("pdmplugins/unified-share/js/modalView/templates/us-modal-free-user-upsell-template",[],function(){return'<div class="us-floating-dialog"><span class="us-modal-upsell-arrow ui-theme theme-share-container theme-share-border"></span><div class="us-floating-upsell-container ui-theme theme-share-container theme-share-border"><div class="ui-theme"><div class="modal-file-list-heading ui-theme theme-text"><%= USM_SEND_FOR_REVIEW %></div><ul class="us-upsell-modal-info-list"><li class="ui-theme theme-header-text"> <%= USM_REVIEW_UPSELL_1 %> </li><li class="ui-theme theme-header-text"> <%= USM_REVIEW_UPSELL_2 %> </li><li class="ui-theme theme-header-text"> <%= USM_REVIEW_UPSELL_3 %> </li><li class="ui-theme theme-header-text"> <%= USM_REVIEW_UPSELL_4 %> </li><li class="us-no-bullet-row"><span id="us-upsell-learn-more-btn" class="ui-theme theme-text theme-share-add-files us-floating-dialog-learn-more-focus"> <%= LEARN_MORE %> </span></li></ul></div><div class="us-upsell-btn-container"><button class="us-upsell-close-btn control-button button-grey ui-theme theme-text"><%= CLOSE %></button><button class="us-upsell-get-started-btn control-button theme-button theme-button-label"><%= US_SHARE_SFS_CTA %></button></div></div></div></div>'}),define("pdmplugins/unified-share/js/modalView/templates/us-modal-email-addr-view-template",[],function(){return'<div class="us-share-modal-address-input-container">        <div class = "share-modal-tool-frame ui-theme theme-share-border theme-share-modal-container">            <button id="us-modal-search-email-img" tabindex="-1"/>            <div class="share-modal-email-list" role="grid" aria-labelledby="share-heading">                <div class = "us-modal-email-input-box">                   <input type="text" class="us-share-modal-address-input ui-theme theme-share-modal-container theme-share-input-text"                           placeholder="<%= SHARE_ADDRESS_PROMPT %>"                           id="us-share-modal-address-input"                           aria-autocomplete="list"                           aria-label="<%= SHARE_ADDRESS_PROMPT %>"                           aria-owns="us-share-auto-c-list" autocomplete="false" />                </div>                <button class="us-share-modal-address-book" aria-label ="<%= ADDRESS_BOOK_LABEL %>" title="<%= ADDRESS_BOOK %>"                     aria-describedby="us-share-modal-address-book" id="us-modal-address-book-img"/>            </div>         </div></div><div class="us-share-modal-autocomplete-box-parent ui-theme theme-share-container"><div class="us-share-modal-autocomplete-box ui-theme theme-share-border theme-share-container theme-text"></div></div><div><input type="text" maxlength="1000" class="us-share-modal-subject-input ui-theme theme-share-modal-container theme-share-input-text theme-share-border" aria-label = "<%= SHARE_INITIAL_SUBJECT_ARIA_LABEL %>" id="us-share-modal-subject-input"/><textarea autoresize type="text" maxlength="1000" class="us-share-modal-message-input ui-theme theme-share-modal-container theme-share-input-text theme-share-border" id="us-share-modal-message-input" aria-label="<%= SHARE_MESSAGE_HEADING_ARIA_LABEL %>"placeholder = "<%= SHARE_MESSAGE_PROMPT_PLACEHOLDER %>"></textarea></div>'}),define("pdmplugins/unified-share/js/modalView/templates/us-modal-email-list-item-template",[],function(){return'    <div class="share-modal-email-list-item  theme-hoverable ui-theme theme-share-modal-container" title="<%= email %>">       <div class="share-email-list-name theme-text" tabindex="-1"><%= name %></div>       <div           aria-labelledby="share-email-list-name">           <button class="share-email-list-close core-remove-x"                title="<%= remove %>" tabindex="0"                 data-asset-id="<%= asset_id %>"                aria-label="<%= ariaRemoveLabel %>"></button>       </div>   </div> '}),define("pdmplugins/unified-share/js/modalView/templates/us-modal-autocomplete-template",[],function(){return' <div class="us-share-auto-c-list us-modal-auto-c-list"     role="listbox" id="us-share-auto-c-list"></div><div class="us-ms-graph-get-contacts-banner ui-theme theme-list-item theme-share-container">   <button id="us-get-ms-graph-contacts-message" class= "ui-theme theme-share-add-files" tabindex="0" aria-label ="<%= GET_MS_GRAPH_CONTACTS_MSG %>" title="<%= GET_MS_GRAPH_CONTACTS_MSG %>"><%= GET_MS_GRAPH_CONTACTS_MSG %></button></div>'}),define("pdmplugins/unified-share/js/modalView/templates/us-modal-autocomplete-item-template",[],function(){return'<div class="us-share-auto-address <%=specialClass%> ui-theme theme-list-item" aria-label = "<%-email %>" role="option" tabindex="-1" title="<%-email %>" name="<%-name%>"><div id="email-list-name" class= "ui-theme theme-text" title="<%-email %>" name="<%-name%>"><%-name%></div><div id="email-list-email" class= "ui-theme theme-text" title="<%-email %>" name="<%-name%>"><%-email%></div></div>'}),define("pdmplugins/unified-share/js/modalView/views/us-modal-autocomplete-view",["core/ac-core","pdmplugins/unified-share/js/ac-unified-share","pdmplugins/unified-share/js/modalView/templates/us-modal-autocomplete-template","pdmplugins/unified-share/js/modalView/templates/us-modal-autocomplete-item-template","pdmplugins/unified-share/js/utils/sc-constants","i18n!pdmplugins/unified-share/js/nls/ui-strings"],function(e,i,t,s,n,o){return i.AutocompleteView=e.View.extend({events:{"mousedown .us-share-auto-address":"_onAddressClick","mousedown .us-ms-graph-get-contacts-banner":"_onGetMSGraphContactsClick"},initialize:function(){var i,n=this.options,o=n.autoCCollection;e.View.prototype.initialize.call(this),this._template=_.template(t),this._localAddressTemplate=_.template(s),this._addressTemplate=_.template("<div class='us-share-auto-address <%=specialClass%> ui-theme theme-list-item theme-hoverable'title='<%-email %>' role='option' tabindex='-1' aria-label ='<%-email %>' name='<%-name%>'><div id='email-list-email-only' class= 'ui-theme theme-text' title='<%-email %>' name='<%-name%>'><span title='<%-email %>'><%-email%></span></div></div>"),this._editControl=n.emailView,this.isMSGraphBannerInFocus=!1,i=new Backbone.Collection,this.filteredCollection=i,i.on("all",_.debounce(_.bind(this._onFilteredCChange,this),50)),o.on("all",_.debounce(_.bind(this._onCollectionChange,this),300))},render:function(){return e.View.prototype.render.call(this),0===this.$el.children().length&&(this.$el.html(this._template({GET_MS_GRAPH_CONTACTS_MSG:o.GET_MS_GRAPH_CONTACTS_MSG_1+"Office"+o.GET_MS_GRAPH_CONTACTS_MSG_2+"Outlook"+o.GET_MS_GRAPH_CONTACTS_MSG_3})),this._initWrappers(),this.$autoCList.on("scroll",this._onAddressScroll),this.$getMSGraphContacts.hide(),e.Util.isCEF()&&this.$autoCList.css("overflow","auto")),this._renderAddressList(),this},setFilter:function(e){e&&(e=$.trim(e.toLowerCase()),e.length<1&&(e=void 0)),e||(this.selectedID=void 0),this.fragment=e,this._updateFilteredCollection()},makeChoice:function(e){console.log("make choice");{var i,t,s;this.options,this.options.sendFilesUiModel}return this.isMSGraphBannerInFocus?this._onGetMSGraphContactsClick():(e?this.selectedID&&(i=this.filteredCollection.get(this.selectedID)):i=this.selectedID?this.filteredCollection.get(this.selectedID):this.filteredCollection.at(0),i&&(t=i.get("email"),s=i.get("name"),this._insertEmail(t,s),this._editControl.clear())),i},selectDown:function(){var i,t,s,n=this.filteredCollection,o=this.selectedID,a=this.$autoCList.scrollTop(),l=$(".us-share-auto-address").outerHeight(),r=6,d=6;e.Util.isCEF&&(r=n.length),s=this.options.sendFilesUiModel.get("enable_autoc_arrows"),s&&(o?(r>n.length&&(r=n.length),t=n.get(o),i=n.indexOf(t),-1===i?o=void 0:(r>i&&(i+=1,r>d&&this._keyboardScrollTo(a+l)),i>=r?(o=void 0,this.$getMSGraphContacts.is(":visible")&&!this.isMSGraphBannerInFocus&&(this.isMSGraphBannerInFocus=!0)):(t=n.at(i),o=t?t.id:void 0))):this.isMSGraphBannerInFocus?this.isMSGraphBannerInFocus=!1:(t=n.at(0),t?(o=t.id,this._keyboardScrollTo(0)):o=void 0),this.selectedID=o,this._renderAddressList())},selectUp:function(){var i,t,s,n=this.filteredCollection,o=this.selectedID,a=this.$autoCList.scrollTop(),l=6,r=6,d=$(".us-share-auto-address").outerHeight();e.Util.isCEF&&(l=n.length),s=this.options.sendFilesUiModel.get("enable_autoc_arrows"),s&&(o?(t=n.get(o),i=n.indexOf(t),-1===i?o=void 0:(i>=0&&(i-=1,l>r&&this._keyboardScrollTo(a-d)),0>i?o=void 0:(t=n.at(i),o=t?t.id:void 0))):this.$getMSGraphContacts.is(":visible")&&!this.isMSGraphBannerInFocus?(o=void 0,this.isMSGraphBannerInFocus=!0):(this.isMSGraphBannerInFocus=!1,l>n.length&&(l=n.length),l-=1,t=n.at(l),t?(o=t.id,l>=r&&this._keyboardScrollTo(l*d)):o=void 0),this.selectedID=o,this._renderAddressList())},_keyboardScrollTo:function(i){e.Util.isCEF()&&(this.$autoCList.stop(!0,!0),this.$autoCList.animate({scrollTop:i},1))},_initWrappers:function(){this.$autoCList=this.$(".us-share-auto-c-list"),this.$getMSGraphContacts=this.$(".us-ms-graph-get-contacts-banner")},_renderAddressList:function(){var e,i,t=this.filteredCollection,s=this.$autoCList,n=this.selectedID;e=this._localAddressTemplate,i=this._addressTemplate,t.length&&this.$el.show(),s.empty(),t.each(function(t){var o,a="";t.id===n&&(a="selected"),o=_.isUndefined(t.get("name"))||""===t.get("name")?i({email:t.get("email"),specialClass:a,id:_.uniqueId("us-share-auto-address-"),ariaSelected:""===a?"false":"true"}):e({name:t.get("name"),email:t.get("email"),specialClass:a,id:_.uniqueId("us-share-auto-address-"),ariaSelected:""===a?"false":"true"}),s.append(o)}),this._renderGetMSGraphBanner(),t.length||this.$el.hide()},_renderGetMSGraphBanner:function(){this.options.appApi.rnaApi.done(_.bind(function(e){e.rnaMicrosoftGraphAPI.isMicrosoftGraphEnabled().then(_.bind(function(){this.options.appApi.sessionApi.isSignedInReader()&&e.rnaMicrosoftGraphAPI.isSignedInMicrosoftGraph().then(_.bind(function(e){e?this.$getMSGraphContacts.hide():(this.$getMSGraphContacts.show(),this.isMSGraphBannerInFocus?this.$getMSGraphContacts.addClass("selected"):this.$getMSGraphContacts.removeClass("selected"))},this),_.bind(function(){this.$getMSGraphContacts.hide()},this))},this),_.bind(function(){this.$getMSGraphContacts.hide()},this))},this))},_updateFilteredCollection:function(){var e,i=this.options.autoCCollection,t=this.filteredCollection,s=[],n="",o="",a=!1,l=this.options.sendFilesUiModel.get("pgcSuggestionsCollection");return l&&i.add(l.toJSON(),{merge:!0}),e=this.fragment,e&&e.length&&(s=i.filter(function(i){if(o=i.get("email"),a=0===o.indexOf(e),a===!1&&(n=i.get("name"),void 0!==n&&(n=n.toLowerCase(),a=0===n.indexOf(e.toLowerCase()),a===!1)))for(var t=n.split(" "),s=0;s<t.length&&(a=0===t[s].indexOf(e.toLowerCase()),a!==!0);++s);return a})),t.set(s),s},_onFilteredCChange:function(){if(this.filteredCollection.length>0){var e=this.filteredCollection.at(0);this.selectedID=e.id,this.isMSGraphBannerInFocus=!1}this._renderAddressList()},_onCollectionChange:function(){this._renderAddressList()},_onAddressClick:function(e){var i,t,s=$(e.target),o=this.options,a=this.options.sendFilesUiModel;i=s.attr("title"),t=s.attr("name"),this._insertEmail(i,t),this._editControl.clear(),a.get("autocomplete_eventual_click")||(o.appApi.siteCatalystApi.logScEvent([n.TOOLS,this.options.sendFilesUiModel.get("ShareVariant"),n.EMAIL,n.AUTOCOMPLETE,n.EVENTUAL_CLICK]),a.set("autocomplete_eventual_click",!0),a.set("autocomplete_avoided",!0)),a.get("autocomplete_immediate_click")||(o.appApi.siteCatalystApi.logScEvent([n.TOOLS,this.options.sendFilesUiModel.get("ShareVariant"),n.EMAIL,n.AUTOCOMPLETE,n.IMMEDIATE_CLICK]),a.set("autocomplete_immediate_click",!0))},_onGetMSGraphContactsClick:function(){this.options.appApi.rnaApi.done(_.bind(function(i){var t=this.options.sendFilesUiModel.get("ShareVariant"),s=n.USE,o="Sign In to MSGraph";this.options.appApi.siteCatalystApi.logScEvent([t,s,o]),i.rnaMicrosoftGraphAPI.loginToMicrosoftGraph().then(_.bind(function(){var i=e.opFactory.create("MicrosoftGraphOutlookContactsOp",this.options),t=this.options.sendFilesUiModel.get("ShareVariant"),s=n.USE,o="Get MSGraph Contacts After Sign In";this.options.appApi.siteCatalystApi.logScEvent([t,s,o]),i.run().then(_.bind(function(e){var i=this.options.autoCCollection;i.add(e.toJSON(),{merge:!0}),this._renderGetMSGraphBanner()},this),_.bind(function(){},this))},this),_.bind(function(){this.isMSGraphBannerInFocus=!1},this))},this))},_onAddressScroll:function(){var e=this.options,i=this.options.sendFilesUiModel;i.get("autocomplete_scroll")||(e.appApi.siteCatalystApi.logScEvent([n.TOOLS,this.options.sendFilesUiModel.get("ShareVariant"),n.EMAIL,n.AUTOCOMPLETE,n.SCROLL]),i.set("autocomplete_scroll",!0),i.set("autocomplete_immediate_click",!0),i.set("autocomplete_avoided",!0))},_insertEmail:function(e,i){this.options.emailView.abortPGCRequest();this.options.autoCCollection.findWhere({email:e});this.options.emailView._setRecipientsFromText(e,i),this.setFilter(void 0),_.delay(_.bind(function(){this._editControl.focus(!0)},this),10)}}),i.AutocompleteView}),define("pdmplugins/unified-share/js/modalView/views/us-modal-email-addr-view",["core/ac-core","core/utils/view-util","pdmplugins/unified-share/js/ac-unified-share","pdmplugins/unified-share/js/modalView/templates/us-modal-email-addr-view-template","pdmplugins/unified-share/js/modalView/templates/us-modal-email-list-item-template","i18n!pdmplugins/unified-share/js/nls/ui-strings","pdmplugins/unified-share/js/modalView/views/us-modal-autocomplete-view","pdmplugins/unified-share/js/utils/sc-constants","core/utils/truncate","pdmplugins/unified-share/js/ops/get-from-addressbook-op","pdmplugins/unified-share/js/ops/get-from-addressbook-op","core/views/input-placeholder-view"],function(e,i,t,s,n,o,a,l,r,d){return t.UsModalEmailAddrView=e.View.extend({events:{"input .us-share-modal-address-input":"_onRecipientsInput","paste .us-share-modal-address-input":"_onRecipientsPaste","blur  .us-share-modal-address-input":"_onRecipientsBlur","click .share-modal-tool-frame":"_onShareAddressClick","click .share-email-list-close":"_onEmailListClose","focus .us-share-modal-address-input":"_onInputFocus","blur .us-share-modal-address-input":"_onInputBlur","click .us-share-modal-address-book":"_onAddressBookClick","click .share-email-list-name":"_onInputFocus"},initialize:function(){e.View.prototype.initialize.call(this),this._template=_.template(s),this._localAddressTemplate=_.template(n);var i=_.extend({},this.options,{searchString:""});this.PGCOp=e.opFactory.create("GettingPGCSuggestionsOp",i)},render:function(){var i;e.View.prototype.render.call(this);var t=this.options.sendFilesUiModel;if(!t.get("is_message_user_input")){var s="#send-mode"==t.get("us_mode")?o.SHARE_MESSAGE_PROMPT2:o.SHARE_MESSAGE_PROMPT_REVIEW_4;t.set("us_message_text",s)}var n=t.get("us_subject_text"),s=t.get("us_message_text");return 0===this.$el.children().length&&(this.$el.html(this._template({SHARE_ADDRESS_HEADING:o.SHARE_ADDRESS_HEADING,SHARE_ADDRESS_PROMPT:o.USM_EMAIL_BOX_PLACEHOLDER,SHARE_INDIVIDUAL_HELP:o.SHARE_INDIVIDUAL_HELP,CLOSE:o.CLOSE,SHARE_INITIAL_SUBJECT_ARIA_LABEL:this._getSubjectInitialAriaLabel(),SHARE_INITIAL_SUBJECT:n,SHARE_MESSAGE_HEADING_ARIA_LABEL:this._getMessageInitialAriaLabel(),SHARE_MESSAGE_PROMPT:s,SHARE_MESSAGE_PROMPT_PLACEHOLDER:o.USM_IP_MESSAGE_BOX_PLACEHOLDER,ADDED_MEMBERS:o.ADDED_RECIPIENT,SHARE_SUBTEXT:o.SHARE_SUBTEXT,USER_ADVISORY_MSG:o.USER_ADVISORY_MSG,ADDED_MEMBERS_MSG:o.SHARE_ACCORDIAN_SUMMARY_2,SUBJECT_TITLE:o.NAME_STRING,MESSAGE_TITLE:o.SHARE_MESSAGE_HEADING,ADDRESS_BOOK:o.ADDRESS_BOOK,ADDRESS_BOOK_LABEL:o.ADDRESS_BOOK_LABEL})),this._initWrappers(),this.$shareSubjectinput.one("input",this._onSubjectInputOnce),this.$shareSubjectinput.one("paste",this._onSubjectInputOnce),this.$shareMessageInput.one("input",this._onMessageInputOnce),this.$shareMessageInput.one("paste",this._onMessageInputOnce),i=document.createElement("input"),void 0!==i.placeholder?this.$addressHeading.hide():this.$addressHeading.show(),e.Util.isCEF()&&(this.$addressHelpMsg.css("z-index","1000"),this.$autocompleteBox.css("z-index","1001"))),this._addUiModelEventListeners(),this._addKeyEventListener(),this._renderChildViews(),$(".us-share-modal-address-input").one("focus",this._initialiseEmailAddFetching),this._updateEmailFields(),this._processRecipients(!0,!1),this},stopListening:function(i,t,s){e.View.prototype.stopListening.call(this,i,t,s),this.applyMethodRecursively("undelegateEvents"),this._removeUiModelEventListeners()},_initWrappers:function(){this.$addressHeading=this.$(".share-address-heading"),this.$emailErrorBubble=this.$(".sharing-email-error"),this.$addressHelpMsg=this.$(".share-address-help-msg"),this.$autocompleteBox=this.$(".us-share-modal-autocomplete-box"),this.$shareModalEmailList=this.$(".share-modal-email-list"),this.$shareUserAdvisoryMessage=this.$("#share-user-advisory-message"),this.$addedMembers=this.$("#added-members"),this.$addedMembersMessage=this.$("#share-added-members-message"),this.$addedMembersListContainer=this.$("#added-members-list-container"),this.$removeButton=this.$(".share-email-list-close"),this.$usModeSelector=this.$("#us-mode-selector"),this.$shareSubjectinput=this.$(".us-share-modal-subject-input"),this.$shareMessageInput=this.$(".us-share-modal-message-input"),this.$usModeContentContainer=this.$("#us-mode-content-container"),this.$inputContainer=this.$(".us-share-modal-address-input-container"),this.$input=this.$(".us-share-modal-address-input"),this.$inputMask=this.$(".share-address-input-mask"),this.$searchEmailImg=this.$("#us-modal-search-email-img"),this.$usModalEmailInputBox=this.$(".us-modal-email-input-box")},_renderChildViews:function(){var i,t=this.options.sendFilesUiModel;this._renderChildView("_input",e.InputPlaceholderView,this.$input),t.get("enable_autocomplete")?(i=_.extend({},this.options,{emailView:this}),this.$autocompleteBox.show(),this._renderChildView("_autocompleteControl",a,this.$autocompleteBox,i)):(this._autocompleteControl&&this.removeChildView(this._autocompleteControl),this.$autocompleteBox.hide())},_detachChildViewsAndClear:function(){this._autocompleteControl&&this.removeChildView(this._autocompleteControl);var e=this.options.sendFilesUiModel.get("email_addr_collection");e.length>0&&e.reset()},_updateEmailFields:function(){{var e=this.options.sendFilesUiModel;"share"===e.get("US_tab_open")}this.$el.removeClass("disabled"),this.$addressHeading.removeAttr("disabled"),this.enable(!0)},_onEmailListClose:function(e){var i,t,s=$(e.target),n=this.options.sendFilesUiModel.get("email_addr_collection"),o=this.options.sendFilesUiModel.get("ShareVariant"),a=l.USE,r="Remove User";this.options.appApi.siteCatalystApi.logScEvent([o,a,r]),i=s.data("asset-id"),i&&(t=n.get(i),n.remove(t)),this._updateAddedMembersText(n.length)},_processRecipients:function(e,i){var t=this.options.sendFilesUiModel.get("email_addr_collection");t.length>0?(this.$shareUserAdvisoryMessage.show(),this._toggleSubjectAndMessageVisibility(!0),this.$searchEmailImg.hide(),this.$input.css("margin-left","4px"),this._input.enablePrompt(!1).render()):(this.$shareUserAdvisoryMessage.hide(),this.$searchEmailImg.show(),this.$input.css("margin-left","20px"),this._input.enablePrompt(!0).render()),this._updateSubjectFromModel(),i===!0&&this.focus(!0),this._renderEmailList(t),this._updateInputEmailTextAreaWidth()},_renderEmailList:function(i){var t,s,n,a,l,d=this.$shareModalEmailList,p=this.options.sendFilesUiModel,h=(p.get("view_mode"),this.options,this._computeMaxAvailWidth());e.Util.isCEF()&&d.show(),d.children(".share-modal-email-list-item").remove(),i.each(_.bind(function(e){s=e.get(e.get("name")?"name":"email"),n=e.get("email"),l=e.get("valid"),a=this._localAddressTemplate({name:s,email:n,remove:o.SHARE_EMAIL_REMOVE,asset_id:e.cid,ariaRemoveLabel:this._getRemoveAriaLabel(s)}),s&&l?0==d.children(".share-modal-email-list-item").length?d.prepend(a):d.children(".share-modal-email-list-item").last().after(a):l||i.remove(e)},this)),_.each(this.$(".share-email-list-name"),function(e){t=$(e);var i={truncateFromRight:!0,truncateFromExt:!1,ellipsis:"...",maxIterations:10};r.truncateElementText(t,h-$(".share-email-list-close").width(),i)}),this._updateAddedMembersText(i.length);var c=this.$(".us-modal-email-input-box").last().offset().top;d.scrollTop(c)},_updateAddedMembersText:function(e){void 0!=e&&e>=0&&this.$addedMembers.html(o.ADDED_RECIPIENT_NO_COUNT+" ("+e+")")},_updateSubjectFromModel:function(){var e=this.options.sendFilesUiModel;0==e.get("is_subject_user_input")&&this.updateDefaultSubjectTextWithUserIdentity()},_updateMessageFromModel:function(){var e=this.options.sendFilesUiModel;this.setMessage(e.get("us_message_text"))},_getRemoveAriaLabel:function(e){return _.template(o.GENERIC_ARIA_LABEL_STRING,{prefix:e,suffix:o.SHARE_EMAIL_REMOVE})},_initialiseEmailAddFetching:function(){var i=this.options,s=i.sendFilesUiModel,n=(i.limitsModel,this._getResolvedPromise());this._displayIPMToUser=!1,s.set({is_individual:!0}),e.Util.isCEF()&&s.get("autocomplete_local_contacts_imported")===!1&&(n=this._importLocalEmailContacts(),n.then(_.bind(function(){s.set({autocomplete_local_contacts_imported:!0})},this))),e.Util.isCEF()&&s.get("autocomplete_cloud_contacts_imported")===!1&&this.options.appApi.sessionApi.isSignedInReader()&&t.opFactory.create("DesktopFetchingAutocompleteListOp",this.options).run().then(_.bind(function(){s.set({autocomplete_cloud_contacts_imported:!0})},this)),e.Util.isCEF()&&s.get("autocomplete_msgraph_contacts_imported")===!1&&this.options.appApi.rnaApi.done(_.bind(function(i){i.rnaMicrosoftGraphAPI.isMicrosoftGraphEnabled().done(_.bind(function(){i.rnaMicrosoftGraphAPI.isSignedInMicrosoftGraph().done(_.bind(function(i){if(i){var t=e.opFactory.create("MicrosoftGraphOutlookContactsOp",this.options),n=this.options.sendFilesUiModel.get("ShareVariant"),o=l.USE,a="Get MSGraph Contacts for SignedIn User";this.options.appApi.siteCatalystApi.logScEvent([n,o,a]),t.run().then(_.bind(function(e){var i=this.options.autoCCollection;i.add(e.toJSON(),{merge:!0}),s.set({autocomplete_msgraph_contacts_imported:!0})},this),_.bind(function(){},this))}},this))},this))},this))},_toggleSubjectAndMessageVisibility:function(e){e?(this.$shareSubjectinput.show(),this.$shareMessageInput.show(),this.$addedMembers.show(),this.$addedMembersMessage.hide(),this.$addedMembersListContainer.show()):(this.$shareSubjectinput.hide(),this.$shareMessageInput.hide(),this.$addedMembers.hide(),this.$addedMembersMessage.hide(),this.$addedMembersListContainer.hide())},_importLocalEmailContacts:function(){return this.options.appApi.rnaApi.then(_.bind(function(e){return e.stApi.getOutlookAutoCompleteListAtIdleAPI().then(_.bind(function(e){return e._addEventListener("custom:onOutlookAddressesFetchComplete",_.bind(function(e,i){var t=i.params,s=t.split(";"),n="",o="",a=-1,l=this.options.autoCCollection;s.pop(),_.each(s,function(e){a=_.lastIndexOf(e,"<"),-1===a?(o=e,n=""):(o=e.substring(a+1),n=e.substring(0,a)),">"===_.last(o)&&(o=o.slice(0,-1))," "===_.last(n)&&(n=n.slice(0,-1)),l.get(o)&&l.remove(o),l.add({email:o,name:n,isLocalContact:!0})})},this)),$.Deferred().resolve().promise()},this),_.bind(function(){return $.Deferred().reject().promise()},this))},this),_.bind(function(){return $.Deferred().reject().promise()},this))},_addUiModelEventListeners:function(){var e=this.options.sendFilesUiModel;e.get("email_addr_collection").on("all",this._onRecipientsChange),e.on("change:enable_autocomplete",this._onEnableAutocompleteChange),e.on("change:us_subject_text",this._updateSubjectFromModel),e.on("change:us_message_text",this._updateMessageFromModel)},_removeUiModelEventListeners:function(){var e=this.options.sendFilesUiModel;e.get("email_addr_collection").off("all",this._onRecipientsChange),e.off("change:enable_autocomplete",this._onEnableAutocompleteChange)},_onViewEvent:function(i,t){"CHICKLET_REMOVED"===i&&this._onChickletRemoved(),e.View.prototype._onViewEvent.call(this,i,t)},_onRecipientsChange:function(){this._onDebouncedRecipientsChange()},_onDebouncedRecipientsChange:function(){this._processRecipients(!0,!0)},_getSubjectInitialAriaLabel:function(){return this._getAriaLabelForDesktop(o.NAME_STRING,this.options.sendFilesUiModel.get("us_subject_text"))},_getMessageInitialAriaLabel:function(){return this._getAriaLabelForDesktop(o.SHARE_MESSAGE_HEADING,this.options.sendFilesUiModel.get("us_message_text"))},_getAriaLabelForDesktop:function(e,i){return _.template(o.GENERIC_ARIA_LABEL_STRING,{prefix:e,suffix:i})},_onEnableAutocompleteChange:function(){this._renderChildViews()},_addKeyEventListener:function(){this.options.appApi.keyApi.pushKeyHandler(this);this.options.appApi.localeApi.getLocale()},_removeKeyEventListener:function(){this.options.appApi.keyApi.popKeyHandler(this)},_onKeyDown:function(e){var i=!1,t=e.which,s=!1,n=this.$input;return this._input._hasFocus()?(this._updateInputEmailTextAreaWidth(),13===t?this._autocompleteControl&&(this._autocompleteControl.makeChoice(!1)||_.defer(_.bind(function(){this.abortPGCRequest(),this._setRecipientModels()},this))):9===t?this._autocompleteControl&&!e.shiftKey&&this._autocompleteControl.makeChoice()&&(i=!0):8===t?this.hasText()||(this.removeLastRecipient(),i=!0):40===t?this._autocompleteControl&&(this._autocompleteControl.selectDown(),s=!0,i=!0):38===t?this._autocompleteControl&&(this._autocompleteControl.selectUp(),s=!0,i=!0):27===t&&this._autocompleteControl&&(this._autocompleteControl.filteredCollection.length?(this._autocompleteControl.setFilter(void 0),i=!0):i=!1),s?n.attr("aria-activedescendant",this._autocompleteControl.$(".selected").attr("id")):n.removeAttr("aria-activedescendant"),i&&this._consumeEvent(e),i):i},_onKeyup:function(e){var i=!1,t=e.which;return this._input._hasFocus()?(32===t&&(i=!0,_.defer(_.bind(function(){this._setRecipientModels(!0)},this))),i):i},_updateInputEmailTextAreaWidth:function(){var e=this.options.sendFilesUiModel.get("email_addr_collection");if(0==e.length)return void this.$usModalEmailInputBox.css("width","95%");var i,t=8*this.val().length+10,s=this.$usModalEmailInputBox.width(),n=this.$shareModalEmailList.width()-25;t=t?t:10,t>s&&n>t&&(i=t+32,i>n&&(i=n),this.$usModalEmailInputBox.css("width",i+"px"))},_restoreInputEmailTextAreaWidth:function(){var e=this.options.sendFilesUiModel.get("email_addr_collection");if(0==e.length)return void this.$usModalEmailInputBox.css("width","95%");{var i;this.$shareModalEmailList.width()}0==this.val().length&&(i=4,this.$usModalEmailInputBox.css("width",i+"px"))},_changeTextColor:function(e){e?($("#us-share-modal-address-input").removeClass("theme-share-input-text"),$("#us-share-modal-address-input").addClass("theme-text")):($("#us-share-modal-address-input").removeClass("theme-text"),$("#us-share-modal-address-input").addClass("theme-share-input-text"))},_setAutocompleteFilterValue:function(e){this._autocompleteControl&&(this.options.appApi.sessionApi.isSignedInReader()?""!==e?(this._autocompleteControl.setFilter(e),this.PGCOp.updateSearchString(e),this.PGCOp.run().then(_.bind(function(i){i.length>0&&(this.options.sendFilesUiModel.set("pgcSuggestionsCollection",i),this._autocompleteControl.setFilter(e))},this))):(this.abortPGCRequest(),this._autocompleteControl.setFilter(e)):this._autocompleteControl.setFilter(e))},abortPGCRequest:function(){this.options.appApi.sessionApi.isSignedInReader()&&(this.PGCOp.updateSearchString(""),this.PGCOp.run())},removeLastRecipient:function(){var e=this.options.sendFilesUiModel.get("email_addr_collection");e.pop()},_onRecipientsInput:function(){var e=this.val();this._changeTextColor(e),this._setAutocompleteFilterValue(e)},_onRecipientsPaste:function(){setTimeout(_.bind(function(){var e=this.val();this._changeTextColor(!0),this._setRecipientModels(),e=this.val(),this._setAutocompleteFilterValue(),this._updateInputEmailTextAreaWidth()},this),10)},_onRecipientsBlur:function(){return this._setRecipientModels(),this._autocompleteControl&&this._autocompleteControl.setFilter(void 0),!0},_setRecipientModels:function(e){var i=this.val();_.isUndefined(e)||!e||i.match(/.*@.*/)||(i+=" "),this._setRecipientsFromText(i)
},_setRecipientsFromText:function(i,t){var s,n,o=this.options,a=o.sendFilesUiModel;if(e.Util.isCEF()&&i.match(/.+\s$/)&&0!==this._autocompleteControl.filteredCollection.length&&!i.match(/.*@.*|.+\s\s$/))return void this.setValue(i);if(i=i.replace(/(\r\n|\n|\r)/gm,""),s=i.split(i.match(/(<\S+>)/)?/\s*[,;]+\s*/:/\s*[,;\s]+\s*/),n=a.parseEmailArray(s,t),n.length>0)if(console.log(n[0].get("valid")),0==n[0].get("valid"));else{a.addRecipientsToCollection(n),this.clear();var r=this.options.sendFilesUiModel.get("ShareVariant"),d=l.USE,p="Add user";o.appApi.siteCatalystApi.logScEvent([r,d,p]),o.appApi.siteCatalystApi.logScEvent([l.TOOLS,this.options.sendFilesUiModel.get("ShareVariant"),l.EMAIL,l.CHICKLET_ADDED]),a.get("autocomplete_avoided")||(o.appApi.siteCatalystApi.logScEvent([l.TOOLS,this.options.sendFilesUiModel.get("ShareVariant"),l.EMAIL,l.AUTOCOMPLETE,l.AVOIDED]),a.set("autocomplete_avoided",!0))}},_onInputFocus:function(){this.$input.addClass("focus"),this._updateInputEmailTextAreaWidth()},_onInputBlur:function(){this.$input.removeClass("focus"),this._restoreInputEmailTextAreaWidth()},_onAddressBookClick:function(){var e,i,t,s=this.options.sendFilesUiModel.get("ShareVariant"),n=l.USE,o="Select Address Book";this.options.appApi.siteCatalystApi.logScEvent([s,n,o]),t=_.extend({},this.options),i=new d(t),e=i.run(),e.then(_.bind(function(e){this._setRecipientsFromText(e)},this),_.bind(function(){},this))},_onSubjectInputOnce:function(){var e=this.options.sendFilesUiModel.get("ShareVariant"),i=l.USE,t="Add subject";this.options.appApi.siteCatalystApi.logScEvent([e,i,t]),this.options.sendFilesUiModel.set("is_subject_user_input",!0),this.$shareSubjectinput.removeClass("theme-share-input-text"),this.$shareSubjectinput.addClass("theme-text")},_onMessageInputOnce:function(){var e=this.options.sendFilesUiModel.get("ShareVariant"),i=l.USE,t="Add message";console.log("_onMessageInputOnce"),this.options.appApi.siteCatalystApi.logScEvent([e,i,t]),this.options.sendFilesUiModel.set("is_message_user_input",!0),this.$shareMessageInput.removeClass("theme-share-input-text"),this.$shareMessageInput.addClass("theme-text")},_getSubjectText:function(){var e=this.$shareSubjectinput.val();return e.toString().normalize("NFC")},setSubject:function(e){this.$shareSubjectinput.val(e),this.$shareSubjectinput.attr("aria-label",e)},_getMessageText:function(){var e=this.$shareMessageInput.val();return e.normalize("NFC")},setMessage:function(e){this.$shareMessageInput.val(e),this.$shareMessageInput.attr("aria-label",this._getMessageInitialAriaLabel())},updateDefaultSubjectTextWithUserIdentity:function(){var e=this.options.sendFilesUiModel.get("us_subject_text");this.setSubject(e)},_onShareAddrHelp:function(){var e=this.options.sendFilesUiModel;e.set({display_individual_help:!0})},_onShareAddrMsgClose:function(){var e=this.options.sendFilesUiModel;e.set({display_individual_help:!1}),this.focus(!0)},_onShareAddressClick:function(){this.focus(!0)},_onChickletRemoved:function(){this.focus(!0)},_computeMaxAvailWidth:function(){return 200},val:function(){return this.$input.val()||""},hasText:function(){return this._input.hasText()},setValue:function(e){this.$input.val(e)},enable:function(e){e?(this.$input.removeAttr("disabled"),this.$inputMask.hide()):(this.$input.attr({disabled:"disabled"}),this.$inputMask.show())},focus:function(){this.$input.addClass("focus"),this.$input.focus()},clear:function(){this.$input.val(""),this._restoreInputEmailTextAreaWidth()}}),t.UsModalEmailAddrView}),define("pdmplugins/unified-share/js/modalView/templates/us-modal-deadline-selector-template",[],function(){return'<div class = "us-modal-error-dialog-container us-modal-deadline-error-dialog ui-theme theme-share-border">           <span class = "us-modal-error-dialog-arrow us-modal-error-dialog-deadline-arrow"></span>           <div class="us-modal-error-dialog-content us-modal-deadline-error-dialog-content">               <div class= "us-modal-error-dialog-content-text"></div>           </div>       </div>       <div class="us-modal-checkbox-cell" id="deadline-selector">           <div  id="modal-select-deadline" class=" modal-select-deadline-text  ui-theme theme-text" tabindex="-1"></div>           <span class = "modal-select-date ui-theme theme-share-add-files" id= "deadline-selected" tabindex="-1"><%= SELECT_DEADLINE %></span>       </div>		<div class = "modal-date-selector-container modal-deadline-selector-container"></div>       <div class = "us-modal-error-dialog-container us-modal-reminder-error-dialog ui-theme theme-share-border">           <span class = "us-modal-error-dialog-arrow us-modal-error-dialog-reminder-arrow"></span>           <div class="us-modal-error-dialog-content us-modal-reminder-error-dialog-content">               <div class= "us-modal-error-dialog-content-text"></div>           </div>       </div> 		<div class="us-modal-checkbox-cell" id="reminder-selector">           <div  id="modal-select-reminder" class=" modal-select-reminder-text  ui-theme theme-text" tabindex="-1"></div>           <span class = "modal-select-date ui-theme theme-share-add-files" id= "reminder-selected" tabindex="-1"><%= SELECT_REMINDER %></span>       </div>		<div class = "modal-date-selector-container modal-reminder-selector-container"></div>'}),define("pdmplugins/unified-share/js/modalView/templates/us-modal-date-selector-template",[],function(){return'<div class="ui-theme theme-text date-calender modal-date-calendar" id="us-date-calender"><div><button class="dialog-close-btn" tabindex="0"><span class="hidden-accessible"><%- close %></span></button></div><table><tr><td><div class ="date-calender-left-div"><div class="dateLabelFrom"><label for="from-date"><%- from %></label><span class="invalid-from-date-error hide">*<%- invalidDate %></span></div><input class="dateInput ui-theme theme-share-container theme-text" type="text" id="from-date" placeholder="MM/DD/YYYY" tabindex="0"/><div class="dateLabelTo"><label for="to-date"><%- to %></label><span class="invalid-to-date-error hide">*<%- invalidDate %></span></div><input class="dateInput ui-theme theme-share-container theme-text" type="text" id="to-date" placeholder="MM/DD/YYYY" tabindex="0"/><div class="date-div-go" ><button class = "date-calender-action-go" tabindex="0"><%- go %></button><span class="invalid-date-range-error hide">*<%- invalidDateRange %></span></div></div></td><td><div id="date-calender-month-view"><div class="header"><button class="left navButton usNavButton core-down-triangle" id="prev" style="font-size: 8px;" tabindex="0" title = "<%- prevMonth %>" aria-label = "<%- prevMonth %>" ></button><span class="left hook"></span><span class="month-year"></span><span class="right hook" id=""></span><button class="right navButton usNavButton core-down-triangle" id="next" style="font-size: 8px;" tabindex="0" title = "<%- nextMonth %>" aria-label = "<%- nextMonth %>" ></button></div><table id="week-days"><tr class = "day-labels"><td class = "sunday-label">Su</td><td class = "monday-label">Mo</td><td class = "tuesday-label">Tu</td><td class = "wednesday-label">We</td><td class = "thursday-label">Th</td><td class = "friday-label">Fr</td><td class = "saturday-label">Sa</td></tr></table><div class="month-dates"><table class="curr"><tr class="week"><td class="day"></td><td class="day"></td><td class="day"></td><td class="day"></td><td class="day"></td><td class="day"></td><td class="day"></td></tr><tr class="week"><td class="day"></td><td class="day"></td><td class="day"></td><td class="day"></td><td class="day"></td><td class="day"></td><td class="day"></td></tr><tr class="week"><td class="day"></td><td class="day"></td><td class="day"></td><td class="day"></td><td class="day"></td><td class="day"></td><td class="day"></td></tr><tr class="week"><td class="day"></td><td class="day"></td><td class="day"></td><td class="day"></td><td class="day"></td><td class="day"></td><td class="day"></td></tr><tr class="week"><td class="day"></td><td class="day"></td><td class="day"></td><td class="day"></td><td class="day"></td><td class="day"></td><td class="day"></td></tr><tr class="week"><td class="day"></td><td class="day"></td><td class="day"></td><td class="day"></td><td class="day"></td><td class="day"></td><td class="day"></td></tr></table></div></div></td></tr></table><div class="react-spectrum-Datepicker-clockContainer"><div class="react-spectrum-Clock "><input type="number" class="spectrum-Textfield clock-hour ui-theme theme-text theme-share-container" aria-label= "<%= HOURS_LABEL %>" placeholder="HH" min="0" max="23" value=""/><span class="react-spectrum-Clock-divider">:</span><input type="number" class="spectrum-Textfield clock-minute ui-theme theme-text theme-share-container" aria-label= "<%= MINUTES_LABEL %>" placeholder="mm" min="0" max="59" value=""/></div></div><div class = "date-selector-button-bar"><button class="date-selector-del-button button-grey ui-theme theme-share-grey-button" aria-label= "<%= DONE %>" aria-describedby="date-selector-del-button" ><%= DELETE %></button><button class="date-selector-go-button button-grey ui-theme theme-share-grey-button" aria-label= "<%= DONE %>" aria-describedby="date-selector-go-button" ><%= DONE %></button></div></div>'}),define("pdmplugins/unified-share/js/modalView/views/us-modal-date-selector",["core/ac-core","core/utils/view-util","pdmplugins/unified-share/js/ac-unified-share","pdmplugins/unified-share/js/modalView/templates/us-modal-date-selector-template","i18n!pdmplugins/unified-share/js/nls/ui-strings","i18n!core/nls/ui-strings","pdmplugins/unified-share/js/utils/sc-constants","pdmplugins/unified-share/js/utils/us-utils","pdmplugins/unified-share/js/ops/check-deadline-reminder-error-op","pdmplugins/unified-share/js/views/us-date-selector"],function(e,i,t,s,n,o,a){return t.USModalDateSelector=t.USDateSelector.extend({initialize:function(){e.DialogView.prototype.initialize.call(this),this._template=_.template(s)({custom:o.CUSTOM,close:o.CLOSE,from:o.FROM,to:o.TO,go:o.GO,invalidDate:o.INVALID_DATE,invalidDateRange:o.INVALID_DATE_RANGE,prevMonth:o.PREVIOUS_MONTH,nextMonth:o.NEXT_MONTH,HOURS_LABEL:this._updateAccessibilityForHour(),MINUTES_LABEL:this._updateAccessibilityForMinutes(),DONE:o.DONE,DELETE:o.DELETE}),this._currentMonthView=null,this._currentYearView=null,this._currentActiveDateElement=1},_getAriaLabelForTime:function(e,i){return _.template(n.GENERIC_ARIA_LABEL_STRING,{prefix:e,suffix:i})},_updateAccessibilityForHour:function(){var e=this._getAriaLabelForTime(this.$(".clock-hour").val(),o.HOUR);return this.$(".clock-hour").attr("aria-label",e),e},_updateAccessibilityForMinutes:function(){var e=this._getAriaLabelForTime(this.$(".clock-minute").val(),o.MINUTES);return this.$(".clock-minute").attr("aria-label",e),e},render:function(){return e.DialogView.prototype.render.call(this),this._appendToDialog(this._template),this._initWrappers(),this._initAdditionalWrappers(),this._fillCurrentMonthCalender(),this._updateLocalDates(),this._setCss(),this._updateTimeInUI(),this._setDefaultDate(),this._addUiEventListeners(),this._goToSetDateMonth(),this.__toggleButtonsVisibilityAndText(),this.$usModalView.addClass("modal-for-calendar"),this},_initAdditionalWrappers:function(){this.$clockHour=this.$(".clock-hour"),this.$clockMinute=this.$(".clock-minute"),this.$usModalView=$("#us-modal-view"),this.$day=this.$(".day"),this.$dateSelectorGoButton=this.$(".date-selector-go-button"),this.$dateSelectorDELButton=this.$(".date-selector-del-button"),this.$spectrumTextField=this.$(".spectrum-Textfield")},_setCss:function(){this.$dlg.width("280px"),this.$dlg.css("min-width","280px"),this.$dlg.css("margin-left","-300px"),this.$dlg.css("margin-top","-425px"),this.$dlg.css("padding","10px 10px 18px 10px"),this.$dlg.css("font-size","12px"),this.$dlg.css("box-shadow","0px 1px 4px rgba(0, 0, 0, 0.15)"),this.$titleBar.hide()},_updateCss:function(){"deadline"===this.options.mode&&"checkbox"===this.options.origin&&this.$dlg.css("margin-left","-300%")},_updateTimeInUI:function(e){var i,t="deadline"===this.options.mode?"23":"18",s="deadline"===this.options.mode?"59":"00",n=this.options.mode,o=this.options.origin;("hyperlink"===o||e)&&(i=this.getLocalDate(n),t=this._prefixZero(i.getHours()),s=this._prefixZero(i.getMinutes())),this.$clockHour.val(t),this.$clockMinute.val(s)},_addUiEventListeners:function(){$("#modal-mask").on("click",this._onCalCloseClick),$("#us-modal-view").on("click",this._onCalCloseClick),$(".clock-hour").on("change",this._updateAccessibilityForHour),$(".clock-minute").on("change",this._updateAccessibilityForMinutes),this.$spectrumTextField.on("input",this._onTimeInput),this.$day.hover(this._onDateHover,void 0),this.$dateSelectorGoButton.on("click",this._updateDateBeenSelected),this.$dateSelectorDELButton.on("click",this._onDeleteClick)},_onDeleteClick:function(){"deadline"===this.options.mode?(this.options.sendFilesUiModel.set("set_reminder",!1),this.options.sendFilesUiModel.set("set_deadline",!1),this.options.sendFilesUiModel.set("reminder",""),this.options.sendFilesUiModel.set("deadline","")):(this.options.sendFilesUiModel.set("set_reminder",!1),this.options.sendFilesUiModel.set("reminder","")),this.clearLocalDate(),this._onCalCloseClick()},_updateDateBeenSelected:function(){"deadline"===this.options.mode?(this.options.sendFilesUiModel.set("set_deadline",!0),this.options.sendFilesUiModel.set("deadline",this.deadline)):(this.options.sendFilesUiModel.set("set_reminder",!0),this.options.sendFilesUiModel.set("reminder",this.reminder)),this._setSelectedTime(),this._onCalCloseClick()},__toggleButtonsVisibilityAndText:function(){"checkbox"===this.options.origin?(this.$dateSelectorGoButton.text(o.DONE),this.$dateSelectorDELButton.hide()):(this.$dateSelectorGoButton.text(n.USM_UPDATE),this.$dateSelectorDELButton.show())},_goToSetDateMonth:function(){var e=this.getLocalDate(this.options.mode);this._createMonthCalender(e.getMonth(),e.getFullYear())},_showSelection:function(){var e,i,t=this.deadline,s=this.reminder,n=this._currentYearView,o=this._currentMonthView,a=this.options.mode,l=new Date,r=new Date(l.getFullYear(),l.getMonth(),l.getDate()),d=this._getTitleForDate;e="deadline"===a?t:s,e&&(isNaN(e)||$(".curr tr").each(function(){$("td",this).each(function(){var s=this;if($(this).removeClass("disabled"),$(this).removeClass("selected"),$(this).removeClass("today"),$(this).removeClass("ui-theme theme-calendar-day"),$(this).removeClass("theme-keyboard-focus"),""!=s.innerHTML){i=d(n,o,s.innerHTML),$(this).attr("aria-label",i),$(this).addClass("ui-theme theme-calendar-day");var l=new Date(n,o,s.innerHTML);l.valueOf()==r.valueOf()&&$(this).addClass("today"),l.getDate()==e.getDate()&&l.getMonth()==e.getMonth()&&l.getFullYear()==e.getFullYear()?($(this).addClass("selected"),$(this).focus()):r>l||"reminder"===a&&l>=t?($(this).addClass("disabled"),$(this).removeClass("ui-theme theme-calendar-day")):($(this).removeClass("disabled"),$(this).removeClass("selected"))}})}))},_onCalFrameDblClick:function(e){var i=e.target;i.className.includes("day")&&0==i.className.includes("disabled")&&this._updateDateBeenSelected()},_onCalCloseClick:function(){var e=new t.CheckDeadlineReminderErrorOp({uiModel:this.options.sendFilesUiModel,appApi:this.options.appApi,returnPromise:!1}),i=e.run();this.$usModalView.removeClass("modal-for-calendar"),$("#us-modal-view").off("click",this._onCalCloseClick),$("#modal-mask").off("click",this._onCalCloseClick),this.close(!1),i.isError&&this.showErrorBubble(i.errorType,i.errTitle,i.errMessage)},_setDefaultDate:function(){if("checkbox"===this.options.origin){var e=new Date;if("deadline"===this.options.mode)this._setTime(e),this.setLocalDate(this.options.mode,e);else{var i,t,s=6e4,n=this.options.sendFilesUiModel.get("deadline"),o=new Date(e.getFullYear(),e.getMonth(),e.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds());n>o||e.getHours()>=18||60*s>=n-e?(i=new Date(n.valueOf()-60*s),e>i&&(i=new Date(e.valueOf()+2e4)),this.setLocalDate(this.options.mode,i),this._updateTimeInUI(!0)):(t=new Date(n.getFullYear(),n.getMonth(),n.getDate()),this.setLocalDate(this.options.mode,t),this._setTime(t))}}this._updateAccessibilityForHour(),this._updateAccessibilityForMinutes(),this._showSelection()},_onCalFrameClick:function(e){var i=$(e.target);if(i.attr("title")){var t=new Date(this._currentYearView,this._currentMonthView,i.text()),s=new Date,n=new Date(s.getFullYear(),s.getMonth(),s.getDate());this._setTime(t),t>=n&&("deadline"===this.options.mode||t<=this.getLocalDate("deadline"))&&this.setLocalDate(this.options.mode,t),this._showSelection()}},setLocalDate:function(e,i){"deadline"===e?this.deadline=i:this.reminder=i},getLocalDate:function(e){return"deadline"===e?this.deadline:this.reminder},clearLocalDate:function(){this.deadline="",this.reminder=""},_updateLocalDates:function(){"checkbox"===this.options.origin&&"deadline"===this.options.mode?this.clearLocalDate():"checkbox"===this.options.origin&&"reminder"===this.options.mode?(this.deadline=this.options.sendFilesUiModel.get("deadline"),this.reminder=""):(this.deadline=this.options.sendFilesUiModel.get("deadline"),this.reminder=this.options.sendFilesUiModel.get("reminder"))},showErrorBubble:function(e,i,t){return $("#us-modal-view").on("click",this.hideErrorBubble),e==a.DEADLINE_ERROR?($(".us-modal-deadline-error-dialog").show(),$(".us-modal-deadline-error-dialog").find(".us-modal-error-dialog-content-text").text(t)):e==a.REMINDER_ERROR&&($(".us-modal-reminder-error-dialog").show(),$(".us-modal-reminder-error-dialog").find(".us-modal-error-dialog-content-text").text(t)),$("#us-modal-view").addClass("modal-for-error-dialog"),$.Deferred().resolve().promise()},hideErrorBubble:function(){$("#us-modal-view").off("click",this.hideErrorBubble),$(".us-modal-error-dialog-container:visible").hide(),$("#us-modal-view").removeClass("modal-for-error-dialog")}}),t.USModalDateSelector}),define("pdmplugins/unified-share/js/modalView/views/us-modal-date-selector-container-view",["core/ac-core","core/utils/view-util","pdmplugins/unified-share/js/ac-unified-share","i18n!pdmplugins/unified-share/js/nls/ui-strings","pdmplugins/unified-share/js/modalView/views/us-modal-date-selector"],function(e,i,t){return t.USModalDateSelectorContainer=e.View.extend({initialize:function(){e.View.prototype.initialize.call(this)},render:function(){e.View.prototype.render.call(this),this._showCalender()},_showCalender:function(){var i=e.uiModelFactory.create("DialogsUiModel"),s=_.extend({},this.options,{dialogsUiModel:i,parentView:this}),n=new t.USModalDateSelector(s);n.open(s.parentView)}}),t.USModalDateSelectorContainer}),define("pdmplugins/unified-share/js/modalView/views/us-modal-deadline-selector",["core/ac-core","core/utils/view-util","pdmplugins/unified-share/js/ac-unified-share","pdmplugins/unified-share/js/modalView/templates/us-modal-deadline-selector-template","i18n!pdmplugins/unified-share/js/nls/ui-strings","pdmplugins/unified-share/js/utils/us-utils","pdmplugins/unified-share/js/utils/sc-constants","pdmplugins/unified-share/js/modalView/views/us-modal-date-selector-container-view"],function(e,i,t,s,n,o,a){return t.ModalDeadlineSelector=e.View.extend({events:{"click .modal-select-date":"_opencalendar"},initialize:function(){e.View.prototype.initialize.call(this),this._template=_.template(s)},render:function(){e.View.prototype.render.call(this),0===this.$el.children().length&&(this.$el.html(this._template({SELECT_DEADLINE:n.USM_ADD_DEADLINE,SELECT_REMINDER:n.USM_ADD_REMINDER})),this._initWrappers()),this._processRecipients(),this._addUiModelEventListeners(),this._addKeyEventListeners()},_initWrappers:function(){this.$modalDeadlineSelectorContainer=this.$(".modal-deadline-selector-container"),this.$modalReminderSelectorContainer=this.$(".modal-reminder-selector-container"),this.$deadlineSelector=this.$("#deadline-selector"),this.$reminderSelector=this.$("#reminder-selector"),this.$modalSelectDeadlineText=this.$(".modal-select-deadline-text"),this.$modalSelectReminderText=this.$(".modal-select-reminder-text"),this.$deadlineSelected=this.$("#deadline-selected"),this.$reminderSelected=this.$("#reminder-selected"),this.$modalSelectDate=this.$(".modal-select-date"),this.$dateSelected=this.$(".date-selected")},_processRecipients:function(){this._toggleDeadlineSelector(),this._toggleReminderSelector()},_addUiModelEventListeners:function(){var e=this.options.sendFilesUiModel;e.get("email_addr_collection").on("all",this._processRecipients),e.on("change:us_mode",this._onModeChange),e.on("change:set_deadline",this._checkUncheckDeadlineSelector),e.on("change:deadline",this._onDeadlineChange),e.on("change:reminder",this._onReminderChange)},_addKeyEventListeners:function(){this.$modalSelectDate.keypress(this._onKeyPress),this.$dateSelected.keypress(this._onKeyPress)},_showCalendar:function(e,i){var s=_.extend({},{origin:i,mode:e,sendFilesUiModel:this.options.sendFilesUiModel});this.removeAllChildViews(),"deadline"===e?this._renderChildView("_modalDeadlineSelectorContainer",t.USModalDateSelectorContainer,this.$modalDeadlineSelectorContainer,s):this._renderChildView("_modalReminderSelectorContainer",t.USModalDateSelectorContainer,this.$modalReminderSelectorContainer,s)},_setDeadline:function(){var e=this.options.sendFilesUiModel.get("set_deadline")?"hyperlink":"checkbox";this._showCalendar("deadline",e);var i=this.options.sendFilesUiModel.get("ShareVariant"),t=a.USE,s="Add deadline";this.options.appApi.siteCatalystApi.logScEvent([i,t,s])},_setReminder:function(){var e=this.options.sendFilesUiModel.get("set_reminder")?"hyperlink":"checkbox";this._showCalendar("reminder",e);var i=this.options.sendFilesUiModel.get("ShareVariant"),t=a.USE,s="Setup reminder";this.options.appApi.siteCatalystApi.logScEvent([i,t,s])},_onKeyPress:function(e){var i=$(e.currentTarget);e&&13==e.which&&i.trigger("click")},_opencalendar:function(e){var i=$(e.currentTarget),t=i.attr("id");"deadline-selected"===t||"modal-select-deadline"===t?this._setDeadline():this._setReminder()},_onModeChange:function(){setTimeout(_.bind(this._toggleDeadlineReminderSelector,this),100)},_toggleDeadlineReminderSelector:function(){this._toggleDeadlineSelector(),this._toggleReminderSelector()},_toggleDeadlineSelector:function(){var e=(this.options.sendFilesUiModel.get("email_addr_collection"),this.options.sendFilesUiModel.get("us_mode"));"#review-mode"===e?(this.$deadlineSelector.slideDown(200),this.$deadlineSelected.attr("tabindex","0")):(this.$deadlineSelector.slideUp(200),this.$deadlineSelected.attr("tabindex","-1"))},_toggleReminderSelector:function(){var e=this.options.sendFilesUiModel,i=(e.get("email_addr_collection"),e.get("us_mode")),t=e.get("deadline");"#review-mode"===i&&t?(this.$reminderSelector.slideDown(200),this.$reminderSelected.attr("tabindex","0")):(this.$reminderSelector.slideUp(200),this.$reminderSelected.attr("tabindex","-1"))},_checkUncheckDeadlineSelector:function(){},_onDeadlineChange:function(){var e=this.options.sendFilesUiModel,i=e.get("deadline");i?(this.$modalSelectDeadlineText.text(n.DUE_BY),this.$deadlineSelected.text(this._formatdate(i))):(this.$deadlineSelected.text(n.USM_ADD_DEADLINE),this.$modalSelectDeadlineText.text("")),this._toggleReminderSelector(),this._onReminderChange()},_onReminderChange:function(){var e=this.options.sendFilesUiModel,i=e.get("reminder");i?(this.$modalSelectReminderText.text(n.REMIND_BY),this.$reminderSelected.text(this._formatdate(i))):(this.$reminderSelected.text(n.USM_ADD_REMINDER),this.$modalSelectReminderText.text(""))},_reset:function(){this._resetDeadline(),this._resetReminder()},_resetDeadline:function(){var e=this.options.sendFilesUiModel;this.$modalSelectDeadlineText.text(n.USM_ADD_DEADLINE),e.set("deadline",""),e.set("set_deadline",!1)},_resetReminder:function(){var e=this.options.sendFilesUiModel;this.$modalSelectReminderText.text(n.USM_REMINDER),e.set("reminder",""),e.set("set_reminder",!1)},_formatdate:function(e){var i=this.options.appApi.localeApi.getLocale(),t={day:"numeric"},s=e.toLocaleDateString(i,t),n=this._getMonth(e.getMonth()),o=(e.getFullYear(),e.getHours()),a=e.getMinutes();return 10>o&&(o="0"+o),10>a&&(a="0"+a),s+" "+n+", "+o+":"+a},_getMonth:function(e){return o.getMonthName(e)}}),t.ModalDeadlineSelector}),define("pdmplugins/unified-share/js/modalView/views/us-modal-share-tab-view",["core/ac-core","files/ac-files","core/utils/file-types","core/utils/util","pdmplugins/unified-share/js/ac-unified-share","pdmplugins/unified-share/js/modalView/templates/us-modal-share-tab-template","pdmplugins/unified-share/js/modalView/templates/us-modal-free-user-upsell-template","i18n!pdmplugins/unified-share/js/nls/ui-strings","pdmplugins/unified-share/js/utils/sc-constants","pdmplugins/unified-share/js/utils/ts-utils","pdmplugins/unified-share/js/ops/desktop-do-upload-op","pdmplugins/unified-share/js/ops/finding-upload-folder-op","pdmplugins/unified-share/js/ops/begin-desktop-upload-op","pdmplugins/unified-share/js/modalView/views/us-modal-email-addr-view","pdmplugins/unified-share/js/ops/share-files-op","pdmplugins/unified-share/js/ops/close-app-op","pdmplugins/unified-share/js/ops/upload-and-run-sfs-op","pdmplugins/unified-share/js/ops/check-deadline-reminder-error-op","pdmplugins/unified-share/js/modalView/views/us-modal-deadline-selector"],function(e,i,t,s,n,o,a,l,r,d){return n.UsModalShareTabView=e.View.extend({events:{"click .share-files-button":"_onShareClickDebounced","click #close-share-button":"_onClickClose","input  #us-share-modal-subject-input":"_onSubjectInput","input  #us-share-modal-message-input":"_onMessageInput","paste  #us-share-modal-subject-input":"_onSubjectPaste","paste  #us-share-modal-message-input":"_onMessagePaste","blur  #us-share-modal-subject-input":"_onSubjectBlur","blur  #us-share-modal-message-input":"_onMessageBlur","click #modal-ip-allow-comments-checkbox":"_onAllowComments","click #modal-invite-summary-learn-more":"_launchLearnMoreInvite","click .us-upsell-close-btn":"_onUpsellCloseClicked","click .us-upsell-get-started-btn":"_onUpsellGetStartedClicked","click #us-upsell-learn-more-btn":"_onUpsellLearnMoreClicked","click #get-link-hyperlink":"redirectToGetLink"},initialize:function(){e.View.prototype.initialize.call(this),this._template=_.template(o),this._templateUpsell=_.template(a)},render:function(){e.View.prototype.render.call(this),0===this.$el.children().length&&(this.$el.html(this._template({SHARE_BUTTON:l.SHARE_BUTTON,SEND_INVITATIONS:l.SEND_BUTTON_TOOLTIP,SHARE_CLOSE:l.SHARE_SUCCESS_CLOSE,INVITE_PEOPLE_MESSAGE_HEADING:l.USM_INVITE_PEOPLE_HEADIN,INVITE_PEOPLE_MESSAGE_SUMMARY:l.USM_INVITE_PEOPLE_INFO_2,LEARN_MORE:l.LEARN_MORE,CREATE_LINK_ALLOW_COMMENTS:l.USM_ALLOW_COMMENTS})),this._initUpsellDialog(),this._initWrappers()),this._addUiModelEventListeners(),this._renderChildViews(),this._processRecipients(!0),this._toggleAddFilesButton(),this._checkUncheckAllowComments(),this._addUiEventListeners(),this._addKeyEventListener(),this._toggleAllowCommentsVisibility(),this._toggleMessage(),this._updateDefaultSubjectTextWithUserIdentity()},_initUpsellDialog:function(){var e=this._templateUpsell({USM_SEND_FOR_REVIEW:l.USM_SEND_FOR_REVIEW,USM_REVIEW_UPSELL_1:l.USM_REVIEW_UPSELL_1,USM_REVIEW_UPSELL_2:l.USM_REVIEW_UPSELL_2,USM_REVIEW_UPSELL_3:l.USM_REVIEW_UPSELL_3,USM_REVIEW_UPSELL_4:l.USM_REVIEW_UPSELL_4,LEARN_MORE:l.LEARN_MORE,US_SHARE_SFS_CTA:l.US_SHARE_SFS_CTA,CLOSE:l.SHARE_SUCCESS_CLOSE});this.$("#upsell-container-invite-tab").append(e),this.$(".us-modal-upsell-arrow").addClass("us-modal-upsell-bottom-arrow"),this.$(".us-floating-upsell-container").addClass("us-floating-upsell-container-bottom-arrow");var i=this.$(".us-floating-upsell-container").innerHeight(),t=this.$(".us-floating-upsell-container-bottom-arrow").css("margin-top");t=parseInt(t),t=t-i+274,console.log(" innerHeight and top margin "+i+"  "+t),this.$(".us-floating-upsell-container-bottom-arrow").css("margin-top",t+"px"),this.$(".us-floating-dialog").hide()},_initWrappers:function(){this.$emailAddressView=this.$("#email-address-template-container"),this.$shareButton=this.$(".share-files-button"),this.$closeShareButton=this.$("#close-share-button"),this.$shareModalButtonBar=this.$(".share-modal-button-bar"),this.$deadlineSelectorContainer=this.$("#deadline-modal-selector-container"),this.$ModalIpAllowCommentsCheckBox=this.$("#modal-ip-allow-comments-checkbox"),this.$ModalIpOptionsRow=this.$("#modal-ip-options-row"),this.$GetLinkTab=$("#get-link-tab")},_renderChildViews:function(){this._renderChildView("_emailAddressView",n.UsModalEmailAddrView,this.$emailAddressView),this._renderChildView("_deadlineSelectorContainer",n.ModalDeadlineSelector,this.$deadlineSelectorContainer)},_addUiModelEventListeners:function(){var e=this.options.sendFilesUiModel;e.get("email_addr_collection").on("all",this._onRecipientsChange),e.on("change:local_file_objects",this._onFilesChange),e.get("metadata_collection").on("all",this._onFilesChange),e.on("change:connector_file_objects",this._onFilesChange),e.on("change:ccloud_file_objects",this._onFilesChange),e.on("change:us_mode",this._onModeChange),e.on("change:US_tab_open",this._onUsTabChanged),this.options.canSignUiModel.on("change:can_sign_state",this._onCanSignStateChanged),this.options.canSignUiModel.on("change:advancedSignClick",this._onAdvancedSignOptionsClickDebounced)},_addUiEventListeners:function(){$("#us-modal-view").on("click",this.hideErrorBubble)},_processRecipients:function(){this.options.sendFilesUiModel.get("email_addr_collection");this._toggleSendButton()},_onRecipientsChange:function(){this._onDebouncedRecipientsChange()},_onFilesChange:function(){var e=this.options.sendFilesUiModel,i=e.get("local_file_objects"),t=e.get("metadata_collection");this._toggleSendButton(),i.length+t.length==1&&this._checkReviewPossible()},_onModeChange:function(){this._toggleAddFilesButton(),this._checkMaximumFiles(),this._toggleMessage(),this._toggleBetweenSendAndNext(),this._checkReviewPossible()},_onUsTabChanged:function(){console.log("us-share-tab-view : _onUsTabChanged"),this._toggleAddFilesButton(),this._toggleBetweenSendAndNext(),this._checkMaximumFiles(),this._toggleMessage()},_onCanSignStateChanged:function(){var e=this.options.canSignUiModel.get("can_sign_state");switch(console.log("state changed to : "+e),e){case"authorising":break;case"authorised":var i=this.options.esAuthUiModel.get("access_token");console.log("Authorised , authToken generated : "+String(i));break;case"uploading":break;case"uploaded":console.log("uploaded : all files uploaded to echo sign server ");break;case"failed":console.log("uploading or authorising failed"),this.options.appApi.displayApi.showModal(!1),this._showShareButton()}},_toggleBetweenSendAndNext:function(){var e=this.options.sendFilesUiModel.get("us_mode");this.$shareButton.text("#sign-mode"==e?l.NEXT_BUTTON:l.SHARE_BUTTON)},_checkMaximumFiles:function(){var e=this.options.sendFilesUiModel,i=e.get("us_mode"),t=e.get("US_tab_open");if("share"===t){if("#review-mode"===i&&e.isMultipleFilesSelected()){var s=(this.options.appApi.dialogApi,l.SHARE_TOO_MANY_FILES_DLG_TITLE),n=l.ERROR_MULTIPLE_FILES_REVIEW1_MODAL+". "+l.ERROR_MULTIPLE_FILES_REVIEW2;e.setUSMode("#send-mode"),e.setCLMode("#send-mode");var o=this.options.sendFilesUiModel.get("ShareVariant"),a=r.ERROR,d="Multiple files selected for review";return this.options.appApi.siteCatalystApi.logScEvent([o,a,d]),this.showErrorBubble(r.FILE_LIST_ERROR,s,n),!1}var p,e=this.options.sendFilesUiModel,h=e.get("limits_model"),i=e.get("us_mode"),c=e.get("local_file_objects").length+e.get("metadata_collection").length;if(p=_.isUndefined(h)?50:h.get("#send-mode"===i?"max_files":"max_review_files"),c>p){var u=(this.options.appApi.dialogApi,l.SHARE_TOO_MANY_FILES_DLG_TITLE),m=_.template(l.SHARE_TOO_MANY_FILES_DLG_MSG,{maxNumber:p});return this.showErrorBubble(r.FILE_LIST_ERROR,u,m,!0),!1}}return!0},_checkUncheckAllowComments:function(){var e=this.options.sendFilesUiModel.get("us_mode");"#review-mode"==e?this.$ModalIpAllowCommentsCheckBox.attr("checked",!0):this.$ModalIpAllowCommentsCheckBox.attr("checked",!1)
},_toggleAllowCommentsVisibility:function(){var e=!0;this.options.appApi.rnaApi.done(_.bind(function(i){e=i.stApi.shouldAdobeReviewVisible()},this)),e?this.$ModalIpOptionsRow.show():this.$ModalIpOptionsRow.hide()},_updateDefaultSubjectTextWithUserIdentity:function(){var e=this.options.sendFilesUiModel;0==e.get("is_subject_user_input")&&this._emailAddressView.updateDefaultSubjectTextWithUserIdentity()},_checkNameLength:function(e){var i,t=this.options.sendFilesUiModel,s=t.get("limits_model");if(i=_.isUndefined(s)?1e3:s.get("max_subject_length"),e.length>i){var n=(this.options.appApi.dialogApi,l.SHARE_NAME_SIZE_ERROR_DLG_TITLE),o=_.template(l.SHARE_NAME_SIZE_ERROR_DLG_MSG,{maxNumber:i});return this.showErrorBubble(r.INVITE_PEOPLE_ERROR,n,o,!0),!1}return!0},_checkMessageLength:function(e){var i,t=this.options.sendFilesUiModel,s=t.get("limits_model");if(i=_.isUndefined(s)?1e3:s.get("max_message_length"),e.length>i){var n=(this.options.appApi.dialogApi,l.SHARE_MSG_SIZE_ERROR_DLG_TITLE),o=_.template(l.SHARE_MSG_SIZE_ERROR_DLG_MSG,{maxNumber:i});return this.showErrorBubble(r.INVITE_PEOPLE_ERROR,n,o,!0),!1}return!0},_toggleAddFilesButton:function(){{var e=this.options.sendFilesUiModel,i=(e.get("us_mode"),e.get("allow_comments"),e.get("US_tab_open"));e.get("cl_active_view")}"attachToEmail"===i?e.set("enable_add_files",!0):e.set("enable_add_files",!1),e.trigger("change:enable_add_files")},_toggleSubject:function(){var e=this.options.sendFilesUiModel,i=(e.get("us_mode"),e.get("is_subject_user_input")),t=this._getSubjectText(!1),s="";s=i?t:l.SHARE_INITIAL_SUBJECT,this._emailAddressView.setSubject(s),e.setSubjectText(s)},_toggleMessage:function(){var e=this.options.sendFilesUiModel,i=e.get("us_mode"),t=e.get("is_message_user_input"),s=this._getMessageText(),n="";t?n=s:(n="#review-mode"===i?l.SHARE_MESSAGE_PROMPT_REVIEW_4:l.SHARE_MESSAGE_PROMPT2,n="#sign-mode"===i?l.SHARE_MESSAGE_PROMPT_SIGN:n),this._emailAddressView.setMessage(n),e.setMessageText(n)},_toggleSendButton:function(){var e=this.options.sendFilesUiModel,i=e.get("local_file_objects"),t=this.options.sendFilesUiModel.get("email_addr_collection"),s=e.get("metadata_collection"),n=e.get("ccloud_file_objects");0===i.length&&0===s.length||0===t.length||n.length>0?this.$shareButton.addClass("disabled").attr("disabled","disabled"):this.$shareButton.removeClass("disabled").removeAttr("disabled")},_onUpsellCloseClicked:function(){this.$(".us-floating-dialog").hide()},_onUpsellLearnMoreClicked:function(){this.options.appApi.rnaApi.done(_.bind(function(e){e.openDecoratedUrl(l.REVIEW_LEARN_MORE_LINK_GO_URL)},this))},_onUpsellGetStartedClicked:function(){this.options.appApi.rnaApi.done(_.bind(function(e){e.openDecoratedUrl(this.options.limitsModel.get("upgrade_url"))},this)),e.Util.isCEF()&&this.options.appApi.sessionApi.ensureSignedIn(),this._onUpsellCloseClicked()},redirectToGetLink:function(){var e=this.options.sendFilesUiModel.get("ShareVariant"),i=r.USE,t="Redirect To Get Link on Send Limit reached.";this.options.appApi.siteCatalystApi.logScEvent([e,i,t]),this.hideErrorBubble(),this.$GetLinkTab.focus(),this.$GetLinkTab.click()},_onDebouncedRecipientsChange:function(){this._processRecipients(!0)},_onClickClose:function(){var e=new n.CloseAppOp(this.options);e.run()},_onAllowComments:function(){console.log("On share Allow Comments...");var e=this.options.sendFilesUiModel.get("ShareVariant"),i=r.USE,t="Invite People Allow Comment Clicked";if(this.options.appApi.siteCatalystApi.logScEvent([e,i,t]),this.options.sendFilesUiModel.get("isReviewVisible")){var s=this.options.sendFilesUiModel;s.get("allow_comments_enabled")===!0&&this.options.sendFilesUiModel.setUSMode(1==this.$ModalIpAllowCommentsCheckBox.is(":checked")?"#review-mode":"#send-mode"),this._toggleAddFilesButton(),this._checkMaximumFiles()}else this.$(".us-floating-dialog").show(),this.$ModalIpAllowCommentsCheckBox.attr("checked",!1)},_onShareClickDebounced:function(){this.options.appApi.rnaApi.done(function(e){e.logPerformance("ShareAFile","start")}),e.Util.isCEF()?(this._debouncedShareClick||(this._debouncedShareClick=_.debounce(this._onShareClick,1e3,!0)),this._debouncedShareClick()):this._onShareClick()},_reorderCollections:function(e){var i=[],t=$.Deferred(),s=0,n=[],o=this.options.sendFilesUiModel,a=o.get("limits_model"),l=0;if(!this.options.localFiles.length)return t.resolve().promise();if(this.avFlag=!1,this.formFlag=!1,_.each(this.options.localFiles,_.bind(function(t){var r;"postUpload"===e&&(t.id=this.options.assetIdarray[s],r=this.options.sendFilesUiModel.addFilesToCollection([t.id],void 0,o.get("share_collection"),!0,!0),i.push(r[0]),s++),"preUpload"===e&&(_.isUndefined(t.get("path"))||"\\\\www.adobe.com\\go\\homeacrordrunified18_2018"!==t.get("path")&&"http://www.adobe.com/go/homeacrordrunified18_2018"!==t.get("path")?_.isEmpty(t.get("ext"))?(this.options.sendFilesUiModel.removeLocalFile([t]),r=this._showErrorDialogMsg("noExtension"),i.push(r)):_.isEmpty(t.get("assetId"))||this.options.sendFilesUiModel.get("bHFileIsDirty")&&t.get("assetId")===this.options.sendFilesUiModel.get("openedFileAssetId")?!a.get("can_send_av")&&o.hasAudioVideoExt(t.get("ext"))?(this.avFlag=!0,n[l++]=t,r=$.Deferred().resolve().promise(),i.push(r)):o.get("enable_form_send")||"form"!==t.get("ext")?(r=$.Deferred().resolve().promise(),i.push(r)):(this.formFlag=!0,n[l++]=t,r=$.Deferred().resolve().promise(),i.push(r)):(this.options.sendFilesUiModel.removeLocalFile([t]),r=this.options.sendFilesUiModel.addFilesToCollection([t.get("assetId")]),i.push(r[0])):console.log("Welcome.pdf"))},this)),n.length){var d;this.options.appApi.siteCatalystApi.logScEvent([r.TOOLS,this.options.sendFilesUiModel.get("ShareVariant"),r.FILES_SHARED_DLG,r.DISALLOWED,r.WARNING,r.SHOWN]),d=this.options.isType2OR3?this._showErrorDialogMsg("type2or3",n):this.avFlag&&!this.formFlag?this._showErrorDialogMsg("avError",n):!this.avFlag&&this.formFlag?this._showErrorDialogMsg("fileTypeError",n,"formError"):this._showErrorDialogMsg("fileTypeError",n,"avFormError"),i.push(d)}return $.when.apply($,i).then(_.bind(function(){this.options.localFiles=this.options.sendFilesUiModel.get("local_file_objects"),this.options.files=this.options.sendFilesUiModel.get("metadata_collection"),t.resolve()},this),_.bind(function(){t.reject()},this)),t.promise()},_showErrorDialogMsg:function(e,i,t){{var s,n,o=this.options.appApi.dialogApi;this.options.sendFilesUiModel.get("limits_model")}if("noExtension"===e)return s=l.ADD_FILES_REJECTED_TITLE,n=l.ADD_FILES_REJECTED_MESSAGE,this.showErrorBubble(r.INVITE_PEOPLE_ERROR,s,n,l.SHARE_SUCCESS_CLOSE);if("avError"===e){var a=_.extend({},{okButtonClass:"us-upsell-learn-more",cancelButtonClass:"us-upsell-close"});s=l.SHARE_AV_UPSELL_TITLE,n=l.SHARE_AV_UPSELL_MSG;var d=o.displayHtmlAlert(o.SEVERITY_WARNING,s,n,l.LEARN_MORE,l.CLOSE_STRING,a);return $(".alert-dlg-buttons-rhp").css({"text-align":"right",direction:"rtl"}),$(".us-upsell-learn-more").css({"padding-left":"15px","padding-right":"15px","margin-left":"10px","margin-right":"5px"}),d.then(_.bind(function(){return this._onUpsell(),$.Deferred().reject().promise()},this),_.bind(function(){return _.each(i,_.bind(function(e){this.options.sendFilesUiModel.removeLocalFile([e])},this)),$.Deferred().reject().promise()},this)).always(_.bind(function(){$(".alert-dlg-buttons-rhp").css({"text-align":"center",direction:"ltr"})},this))}if("type2or3"===e){var s=l.COULD_NOT_SEND,n=l.ENTERPRISE_USERS_ACCESS_ERROR;return this.showErrorBubble(r.INVITE_PEOPLE_ERROR,s,n,l.SHARE_SUCCESS_CLOSE).then(_.bind(function(){return _.each(i,_.bind(function(e){this.options.sendFilesUiModel.removeLocalFile([e])},this)),$.Deferred().reject().promise()},this))}return"fileTypeError"===e?(s=l.SEND_UPSELL_UPGRADE_REQUIRED,"formError"===t?(n=l.SHARE_FORMS_ERROR_DESKTOP,this.options.appApi.siteCatalystApi.logScEvent([r.TOOLS,this.options.sendFilesUiModel.get("ShareVariant"),r.ATTEMPTED_TO_SHARE_FORM])):"avFormError"===t&&(n=l.SHARE_AV_FORMS_ERROR+l.SHARE_AV_UPGRADE_MESSAGE),this.showErrorBubble(r.INVITE_PEOPLE_ERROR,s,n,l.SHARE_SUCCESS_CLOSE).then(_.bind(function(){return _.each(i,_.bind(function(e){this.options.sendFilesUiModel.removeLocalFile([e])},this)),$.Deferred().reject().promise()},this))):void 0},_checkReviewPossible:function(){"#review-mode"===this.options.sendFilesUiModel.get("us_mode")?n.opFactory.create("CanSendForReviewOp",this.options).run().then(_.bind(function(){this.$ModalIpAllowCommentsCheckBox.prop("checked",!0)},this),_.bind(function(e){this.$ModalIpAllowCommentsCheckBox.prop("checked",!1),this.options.sendFilesUiModel.setUSMode("#send-mode"),this.options.appApi.displayApi.showModal(!1);var i=this.options.sendFilesUiModel.get("ShareVariant"),t=r.ERROR,s=e.analyticsEvent;this.options.appApi.siteCatalystApi.logScEvent([i,t,s]),this.showErrorBubble(r.INVITE_PEOPLE_ERROR,l.FILE_CANT_BE_SENT_REVIEW,e.msg)},this)):this.$ModalIpAllowCommentsCheckBox.prop("checked",!1)},_onUpsell:function(i){var t=this.options.limitsModel,s=t.get("upgrade_url");this.options.appApi.rnaApi.done(_.bind(function(e){e.openDecoratedUrl(s)},this)),e.Util.isCEF()&&this.options.appApi.sessionApi.ensureSignedIn()},_onShareClick:function(){var e=this.options.sendFilesUiModel;if(e.isAVSharingPermitted())if("onlyRHP"===this.options.sendFilesUiModel.get("layout")&&this.options.sendFilesUiModel.get("checkForSave"))this.options.appApi.rnaApi.done(_.bind(function(e){e.rnaServicesAPI.checkOpenedDocAndPromptForSaveApi().then(_.bind(function(){var e=this.options.sendFilesUiModel.get("us_mode");"#sign-mode"===e?this._onShareNextClick("AUTHORING"):this._onShareSendClick()},this))},this));else{var i=this.options.sendFilesUiModel.get("us_mode");"#sign-mode"===i?this._onShareNextClick("AUTHORING"):this._onShareSendClick()}else{if(s.isClassic())return void this.showErrorBubble(r.INVITE_PEOPLE_ERROR,l.ERROR_STRING,l.SHARE_ERROR_UNSUPPORTED_SHARING_MIME_TYPE);e.setShareState("avNotAllowed")}},_onShareNextClick:function(e){var i=new n.UploadAndRunSFSOp(this.options);if(this.options.appApi.sessionApi.isSignedIn()){var t=this.options.appApi.usersMeApi.getUserIdentity().email;_.isUndefined(t)||(this.options.sendFilesUiModel.isSenderOnlyRecipient(t)?this.showErrorBubble(r.INVITE_PEOPLE_ERROR,l.ERROR_STRING,l.ERROR_SINGLE_SIGNER_IS_SENDER):this.options.appApi.rnaApi.done(_.bind(function(t){t.esApi.isAnySFSWorkflowsRunning().then(_.bind(function(t){t?this.showErrorBubble(r.INVITE_PEOPLE_ERROR,l.ERROR_STRING,l.SFS_MULTIPLE_WORKFLOWS_DENIED):(this._setSFSWorkflowInProgress(),i.run().then(_.bind(function(){console.log("upload Success"),this._clearSFSWorkflowInProgress(),this._launchSFSWithData(e),this.options.appApi.displayApi.showModal(!1)},this),_.bind(function(e){console.log("upload failed"+e),this._clearSFSWorkflowInProgress(),this.options.appApi.displayApi.showModal(!1),this._onCanSignUploadError(e)},this)))},this))},this)))}},_onCanSignUploadError:function(){this._onShareError()},_onAdvancedSignOptionsClickDebounced:function(){e.Util.isCEF()?(this._debouncedAdvSign||(this._debouncedAdvSign=_.debounce(this._onAdvancedSignOptions,1e3,!0)),this._debouncedAdvSign()):this._onAdvancedSignOptions()},_onAdvancedSignOptions:function(){this.options.sendFilesUiModel.get("checkForSave")?this.options.appApi.rnaApi.done(_.bind(function(e){e.rnaServicesAPI.checkOpenedDocAndPromptForSaveApi().then(_.bind(function(){this._onShareNextClick("DRAFT")},this))},this)):this._onShareNextClick("DRAFT")},_acceptPGCRecipients:function(i){var t=[];i.map(_.bind(function(i){if(_.isUndefined(i.get("token"))){var s=_.extend({},this.options,{newContactEmail:i.get("email")});e.opFactory.create("AcceptingNewPGCSuggestionOp",s).run()}else t.push(i.get("token"))},this));var s=_.extend({},this.options,{tokens:t});e.opFactory.create("AcceptingPGCSuggestionsOp",s).run()},_onShareSendClick:function(){var i=this.options.appApi.rnaApi;i.done(_.bind(function(e){e._reviewAPI.invoke("EurekaLogPerformance",["StartReview"])}),this);var t,s,o,a,d,p,h,c,u,m,E,g,S,f,A,v,R,b,I=[],M=[];if(this.$shareButton.hasClass("disabled"))return void this.options.appApi.siteCatalystApi.logScEvent([r.TOOLS,this.options.sendFilesUiModel.get("ShareVariant"),r.SHARE_BUTTON,r.DISABLED]);if(0!=this._checkMaximumFiles()){var C=this.options.sendFilesUiModel.get("us_mode");if(this.options.appApi.siteCatalystApi.logScEvent([r.TOOLS,this.options.sendFilesUiModel.get("ShareVariant"),r.SHARE_BUTTON,r.CLICKED,C]),R=new n.CheckDeadlineReminderErrorOp({uiModel:this.options.sendFilesUiModel,appApi:this.options.appApi,returnPromise:!1}),b=R.run(),b.isError)return void this.showErrorBubble(b.errorType,b.errTitle,b.errMessage);if(o=this.options.sendFilesUiModel,a=o.get("metadata_collection"),h=o.get("local_file_objects"),d="createLink"===o.get("US_tab_open"),p="share"===o.get("US_tab_open"),m=o.get("customize_recipient_page"),p){I=o.getRecipientsArray();var L=_.clone(this.options.autoCCollection),T=this.options.autoCCollection.filter(function(e){return _.contains(I,e.get("email"))});L.reset(T),_.each(I,function(e){L.add({email:e})}),this._acceptPGCRecipients(L),v=!1}c=this._getSubjectText(!0),""===c.trim()&&(c=this.options.sendFilesUiModel.get("cl_subject_text")),u=this._getMessageText();var U="#review-mode"==o.get("us_mode");if(this._checkNameLength(c)&&this._checkMessageLength(u)&&(e.Util.isCEF()||this._checkMaximumRecipients(I)!==!1))if(t={uiModel:o,files:a,localFiles:h,recipients:I,is_public:d,is_individual:p,can_make_comments:v,email_subject:c,email_message:u,displayApi:this.options.appApi.displayApi,appApi:this.options.appApi,rootView:this.options.rootView,is_branding:m,sendFilesUiModel:this.options.sendFilesUiModel,assetIdarray:M,is_review:U},s=_.extend({},{filesModelBackup:a.clone(),localFilesBackup:h}),e.Util.isCEF()&&(t=_.extend({},t,{recipientsAreFinalized:!0})),E=_.bind(function(){var i,t,a=this.options;if(e.Util.isCEF())if(U){var d=o.get("deadline")?o.get("deadline").toISOString():"",p=o.get("reminder")?o.get("reminder").toISOString():"";this.options.appApi.rnaApi.done(_.bind(function(e){var i={email_message:u,email_subject:c,deadLineDate:d,reminderDate:p,participants:I};e.stApi.UnifiedShareInitiateAsyncReview(i),n.CloseAppOp(this.options).run()},this))}else{var m=this.options.appApi.rnaApi;m.done(_.bind(function(e){e._reviewAPI.invoke("EurekaLogPerformance",["Before Uploading"])}),this),this._reorderCollections("preUpload").then(_.bind(function(){a=this.options,i=new n.BeginDesktopUploadOp(a),A=new n.FindingUploadFolderOp(a),t=_.bind(function(){a.parentId=A.id,_.isUndefined(A.persistence)||(a.persistence=A.persistence),o.get("local_file_objects").length>0&&o.set("share_loader_text",l.SHARE_LOADER_UPLOAD3),i.run().then(_.bind(function(){this._onShareClickFinish(a,s)},this),_.bind(function(){this._onShareError(s,r.ERROR_UPLOAD),this._resetAfterError(s)},this))},this),h.length?A.run().then(t,_.bind(function(){this._onShareError(s,r.NO_CONNECTIVITY),this._resetAfterError(s)},this)):t()},this),_.bind(function(){this._resetAfterError(s)},this))}else i=new n.DoUploadOp(a),A=new n.FindingUploadFolderOp(a),t=_.bind(function(){a.parentId=A.id,_.isUndefined(A.persistence)||(a.persistence=A.persistence),i.run().then(_.bind(function(){this._onShareClickFinish(a)},this),_.bind(function(){this._onShareError(s,r.ERROR_UPLOAD),this._resetAfterError(s)},this))},this),h.length?A.run().then(t):t()},this),f=_.bind(function(){var e=(this.options.appApi.dialogApi,_.template('<div class = "learn-more-sharing"><%=LEARN_MORE%></div>')({LEARN_MORE:l.LEARN_MORE})),i=this.$ModalIpAllowCommentsCheckBox.prop("checked")?l.FILE_CANT_BE_SENT:l.FILE_CANT_BE_SENT_REVIEW,t=l.SHARE_ERROR_ENTERPRISE_SEND_DLG_MSG+e,n=this.options.sendFilesUiModel.get("ShareVariant"),o=r.USE,a="Sharing Restriction Error Prompt Shown";this.options.appApi.siteCatalystApi.logScEvent([n,o,a]),this.showErrorBubble(r.INVITE_PEOPLE_ERROR,i,t,!0),$(".learn-more-sharing").click(this._onSharingLearnMore),this._resetAfterError(s)},this),g=_.bind(function(e){if(e){var i=this.options.limitsModel.get("restrictions_white_list");if(-1!==$.inArray("all",i))E();else if(-1!==$.inArray("none",i))f();else{var t=this.options.sendFilesUiModel.getRecipientsArray(),s=_.find(t,function(e){var t=e.split("@").pop();return-1===$.inArray(t,i)?!0:!1});_.isUndefined(s)?E():f()}}else E()},this),S=_.bind(function(){o.setShareState("Sharing");var e=this.options.appApi.rnaApi;e.done(_.bind(function(e){g(e.isFeatRunning()?e.stApi.isSendTrackRestrictionsEnabled():this.options.limitsModel.get("restrictions"))},this))},this),this.options=_.extend({},this.options,t),e.Util.isCEF()){if(!this.options.appApi.networkConnectivityApi.isOnline())return this._renderOfflineView(),this._onShareError(s,r.NO_CONNECTIVITY),void this._resetAfterError(s);this.options.appApi.sessionApi.isSignedInReader()&&o.setShareState("Sharing"),this.options.appApi.sessionApi.ensureSignedIn().then(_.bind(function(){o.setShareState("Sharing"),setTimeout(_.bind(function(){this._resolveRecipientsAddressesList(this.options.recipients).always(_.bind(function(){this.options=_.extend({},this.options,this._postSignInFunction()),this.options.readRegistry=!1,n.opFactory.create("DesktopGettingSubscriptionLevels",this.options).run().then(_.bind(function(){return this._checkMaximumRecipients(this.options.recipients)===!1?void this._resetAfterError(s):void S()},this),_.bind(function(){this._onShareError(s,r.NO_CONNECTIVITY),this._resetAfterError(s)},this))},this))},this),100)},this),_.bind(function(e){e&&"NoAccessToPdfServices"===e.errorString&&this._displayNoAccessToUser(e.errorCode)},this))}else this.options.appApi.sessionApi.isSignedIn()?E():this.options.appApi.sessionApi.ensureSignedIn().then(_.bind(function(){n.opFactory.create("GettingAuthenticatedModelsOp",this.options).run().then(E)},this))}},_onShareClickFinish:function(i,t){{var s,o,a,d=this.options.sendFilesUiModel.get("share_collection"),p=this.options.sendFilesUiModel.get("metadata_collection");this.options.brandingModel}d.reset(),p.each(_.bind(function(e){var i=new n.FileMetadataModel;i.set(_.clone(e.attributes)),d.add(i)},this)),this.options=_.extend({},this.options,i),a=_.extend({shareFiles:d},i),this._reorderCollections("postUpload").then(_.bind(function(){a.shareFiles.length&&(s=new n.ShareFilesOp(a),s.run().then(_.bind(function(e){var i;if(i=_.bind(function(e){var i;e&&(i=$.trim(e.toLowerCase()),this.options.autoCCollection.add({email:i}));var t=this.options.sendFilesUiModel.get("ShareVariant"),s=r.USE,n="Share For View";"#review-mode"===this.options.sendFilesUiModel.get("us_mode")&&(n="Share For Review"),this.options.appApi.siteCatalystApi.logScEvent([t,s,n])},this),_.each(this.options.recipients,i),!this.options.is_review){var t={};t.op="addParcel",t.parcel=e.parcel,this.options.appApi.rnaApi.done(_.bind(function(e){e.stApi.updateInAppDMStateAPI(t)},this))}this.options.sendFilesUiModel.set({active_view:"success",parcel:e.parcel}),this._logFormShareSuccess();var s=this.options.sendFilesUiModel.get("ShareVariant"),n=r.SUCCESS,o="Send";this.options.appApi.siteCatalystApi.logScEvent([s,n,o]),this.options.appApi.displayApi.showModal(!1),this._drawNextPane(),this.$shareButton.show()},this),_.bind(function(i){function s(e){var i={Unauthorized:l.SHARE_UNVERIFIED_ID_MSG,PDFIsPortfolio:l.REVIEW_DISABLE_REASON_PORTFOLIO_MODAL,PDFIsPasswordProtected:l.REVIEW_DISABLE_PROTECTED_MODAL,PDFIsCertificateProtected:l.REVIEW_DISABLE_PROTECTED_MODAL,PDFIsUnknownProtected:l.REVIEW_DISABLE_PROTECTED_MODAL,PDFIsPolicyProtected:l.REVIEW_DISABLE_PROTECTED_MODAL,PDFIsPDFA:l.REVIEW_DISABLE_REASON_PDFA_MODAL,UnsupportedCommentsPDF:l.REVIEW_DISABLE_REASON_UNSUPPORTED_ANNOTS_MODAL,PDFIsSecure:l.REVIEW_DISABLE_PROTECTED_MODAL,PDFIsInvalid:l.REVIEW_DISABLE_REASON_INVALID_FILE_MODAL,InvalidComment:l.REVIEW_DISABLE_REASON_UNSUPPORTED_ANNOTS_MODAL,InvalidCommentBodyLength:l.REVIEW_DISABLE_INVALID_COMMENT_LENGTH_MODAL,CommentCountExceeded:l.REVIEW_DISABLE_COMMENT_COUNT_EXCEEDED_MODAL,CommentsExtractionSizeExceeded:l.REVIEW_DISABLE_COMMENT_EXTRACTION_ERROR,Unknown:l.REVIEW_DISABLE_UNKNOWN_ERROR};try{var t=JSON.parse(e.responseText);n=t.error.code}catch(s){}if(_.isUndefined(n))try{var t=JSON.parse(e.responseText);n=t.parcels[0].reason_for_failed_state}catch(s){}n&&(a=i[n])}var n,a;s(i);var d=this.options.appApi.dialogApi;if("SendLimitExceeded"===n){var p=this.options.limitsModel.get("can_upgrade_send");if(p)this._displayShareUpsellDialog(l.SHARE_LIMIT_EXCEEDED_DLG_TITLE,l.SHARE_UPSELL_MSG);else if(this.options.limitsModel.get("restrictions"))d.displayHtmlAlert(d.SEVERITY_ERROR,l.SHARE_LIMIT_EXCEEDED_DLG_TITLE,l.SHARE_LIMIT_EXCEEDED_DLG_MSG,l.CLOSE_STRING);else{var h=this.options.sendFilesUiModel.get("ShareVariant"),c=r.USE,u="Invite Send limit reached.";this.options.appApi.siteCatalystApi.logScEvent([h,c,u]);var m=_.template(l.SHARE_RECIPIENTS_LIMIT_PER_DAY_REACHED,{GET_LINK_HTML:_.template("<span id='get-link-hyperlink'><%=GET_LINK %></span>",{GET_LINK:l.SHARE_PUBLIC})});this.showErrorBubble(r.INVITE_PEOPLE_ERROR,l.SHARE_LIMIT_EXCEEDED_DLG_TITLE,m,!0)}}else if("UnsupportedSharingMimeType"===n)this.showErrorBubble(r.UNSUPPORTED_FILE_ERROR,l.SHARE_ERROR_UNSUPPORTED_DLG_TITLE,l.SHARE_ERROR_UNSUPPORTED_DLG_MSG);else if(_.isUndefined(a)){var E=this.options.sendFilesUiModel,g=E.get("local_file_objects").length+E.get("metadata_collection").length,S=g>1?l.SHARE_ERROR_SEND_MUL_DLG_MSG:l.SHARE_ERROR_SEND_DLG_MSG;this.showErrorBubble(r.INVITE_PEOPLE_ERROR,l.SHARE_ERROR_SEND_DLG_TITLE,S)}else this.showErrorBubble(r.INVITE_PEOPLE_ERROR,l.SHARE_ERROR_SEND_DLG_TITLE,a);try{o=JSON.parse(i.responseText).error.code}catch(f){}o&&0===o.indexOf("CannotConvertForm")&&this._logFormShareError(o),e.Util.isCEF()&&this._resetAfterError(t)},this)))},this),_.bind(function(){this._onShareError(t,r.NO_CONNECTIVITY),this._resetAfterError(t)},this))},_launchSFSWithData:function(e){return console.log("launching SFS app .... "),this.options.appApi.rnaApi.then(_.bind(function(i){var t=this.options.sendFilesUiModel.getRecipientsArray(),s=[{transientDocIds:this.options.canSignUiModel.get("transient_Doc_Ids"),esAccessToken:"Bearer "+this.options.esAuthUiModel.get("access_token"),emailSubject:this._getSubjectText(!0),emailMessage:this._getMessageText(),recipients:t,agreementStatus:e}];return i.stApi.launchSendForSignWithTransientDocIdsAPI(s).then(_.bind(function(){return $.Deferred().resolve().promise()},this),_.bind(function(){return $.Deferred().reject().promise()},this))},this),_.bind(function(){return $.Deferred().reject().promise()},this))},_showLoader:function(){this.$closeShareButton.hide()},_showShareButton:function(){this.$shareButton.show(),this._toggleSendButton()},_getSubjectText:function(e){var i=this._emailAddressView._getSubjectText();return e&&(i=i.replace(l.SHARE_INITIAL_SUBJECT_PREFIX,"")),i},_getMessageText:function(){var e=this._emailAddressView._getMessageText();return e},_onShareError:function(e,i){if(i===r.NO_CONNECTIVITY)this.showErrorBubble(r.INVITE_PEOPLE_ERROR,l.SHARE_NO_INTERNET_CONNECTION,l.SHARE_NO_INTERNET_CONNECTION_MSG);else if(i===r.REVIEW_NOT_PERMITTED){var t=this.options.sendFilesUiModel.get("ShareVariant"),s=r.USE,n="Review not supported";this.options.appApi.siteCatalystApi.logScEvent([t,s,n]),this.showErrorBubble(r.INVITE_PEOPLE_ERROR,l.SHARE_REVIEW_RESTRICTED,l.SHARE_REVIEW_RESTRICTED_MSG).done(_.bind(function(){this.options.sendFilesUiModel.setUSMode("#send-mode"),this.options.sendFilesUiModel.setCLMode("#send-mode")},this))}else this.showErrorBubble(r.INVITE_PEOPLE_ERROR,l.SHARE_UPLOAD_ERROR_TITLE,l.SHARE_UPLOAD_ERROR_MSG)},_onSharingLearnMore:function(){this.options.appApi.rnaApi.then(_.bind(function(e){e.stApi.launchSendTrackRestrictionsLearnMoreUrl()}))},_launchLearnMoreInvite:function(){this.options.appApi.rnaApi.done(_.bind(function(e){e.openDecoratedUrl(l.INVITE_LEARN_MORE_GO_URL)},this))},_resetAfterError:function(e){var i=this.options.sendFilesUiModel;i.setShareState("preShare"),this.$shareButton.show(),i.set("metadata_collection",e.filesModelBackup.clone()),i.set("local_file_objects",e.localFilesBackup)},_onSubjectInput:function(){console.log("_onSubjectInput us-share-tab-view");var e=this._getSubjectText(!1);this.options.sendFilesUiModel.setSubjectText(e)},_onSubjectPaste:function(){console.log("_onSubjectPaste us-share-tab-view"),_.delay(_.bind(function(){var e=this._getSubjectText(!1);this.options.sendFilesUiModel.setSubjectText(e)},this),100)},_onSubjectBlur:function(){console.log("_onSubjectBlur us-share-tab-view");var e=this._getSubjectText(!1);this._checkNameLength(e)},_onMessageInput:function(){console.log("_onMessageInput");var e=this._getMessageText();this.options.sendFilesUiModel.setMessageText(e)},_onMessagePaste:function(){console.log("_onMessagePaste");var e=$("#us-share-modal-message-input").scrollTop(),i=$("#us-share-modal-message-input").prop("scrollHeight");_.delay(_.bind(function(){var t=this._getMessageText();this.options.sendFilesUiModel.setMessageText(t);var s=$("#us-share-modal-message-input").prop("scrollHeight");$("#us-share-modal-message-input").scrollTop(e+(s-i))},this),100)},_onMessageBlur:function(){console.log("_onMessageBlur us-share-tab-view");var e=this._getMessageText();this._checkMessageLength(e)},_renderOfflineView:function(){console.log("Render offlineView")},_fetchingSubscriptionWait:function(e){e?(this.$fullOverlay=this.options.appApi.displayApi.showFullOverlay(!0),this.$fullOverlay.addClass("progress-fetch-subscription")):(this.$fullOverlay.removeClass("progress-fetch-subscription"),this.options.appApi.displayApi.showFullOverlay(!1))},_resolveRecipientsAddressesList:function(e){return this.options.appApi.rnaApi.then(_.bind(function(i){if(_.isUndefined(e)||0===e.length)return this._getResolvedPromise();var t=this.options.recipients;return i.stApi.getLastUsedPreferences().then(_.bind(function(s){return s&&1==s.remeberChoice?this._getResolvedPromise():i.stApi.getResolvedEmailAddressesListAPI(e).then(_.bind(function(e){var i;return 0===e.length?$.Deferred().reject().promise():(i=e.split(";"),i.pop(),this.options.recipients=[],i.every(_.bind(function(e){return-1!==e.indexOf("@")?(this.options.recipients.push(e),!0):(this.options.recipients=t,!1)},this)),$.Deferred().resolve().promise())},this),_.bind(function(){return $.Deferred().reject().promise()},this))},this),_.bind(function(){return $.Deferred().reject().promise()},this))},this),_.bind(function(){return $.Deferred().reject().promise()},this))},_postSignInFunction:function(){var e,i,t=this.options,s=this.options.is_public,n=this.options.recipients,o=this.options.is_individual;return i=this.options.appApi.baseFilesUrisApi.getAlternateUploadUri(),this.options.appApi.siteCatalystApi.logScEvent([r.TOOLS,this.options.sendFilesUiModel.get("ShareVariant"),r.SHARE_BUTTON,"async"]),this._logSharingParams(s,o,n),e=this.options.appApi.baseFilesUrisApi.getSendApiUri(),e=d.extractRootUrl(e),t={rootUrl:e,uploadUrl:i}},_resetPageToDefault:function(){console.log("Draw the success view for Create Link")},_drawNextPane:function(){console.log("Draw the success view for share");var e=this.options.sendFilesUiModel;e.setShareState("postShare")},_logSharingParams:function(e,i,t){var s,n,o,a,l=this.options.appApi.siteCatalystApi;e&&l.logScEvent([r.TOOLS,this.options.sendFilesUiModel.get("ShareVariant"),r.SHARE_WITH,r.PUBLIC]),a=r.DEFAULT,l.logScEvent([r.TOOLS,this.options.sendFilesUiModel.get("ShareVariant"),r.SUBJECT,a]),i&&(n=[r.TOOLS,this.options.sendFilesUiModel.get("ShareVariant"),r.SHARE_WITH,r.PERSONAL],l.logScEvent(n),s=t.length,o=1===s?r[1]:5>=s?r["2_TO_5"]:10>=s?r["6_TO_10"]:r["11_OR_MORE"],n.push(o),l.logScEvent(n),a=r.ENTERED,l.logScEvent([r.TOOLS,this.options.sendFilesUiModel.get("ShareVariant"),r.MESSAGE,a])),this._logFormShareStarted()},_logFormShareStarted:function(){var e,i,t=this.options.appApi.siteCatalystApi;this._parcelHasForms()&&(e=[r.TOOLS,r.FSS,r.FORM,r.OUTPUT,r.SAVE_TO_PDF,r["1_STARTED"],r.SEND_TAB],i=e.join(":"),t.logScEvent(e,{featureType:i}))},_logFormShareSuccess:function(){var e,i,t,s=this.options.appApi.siteCatalystApi;this._parcelHasForms()&&(e=[r.TOOLS,r.FSS,r.FORM,r.OUTPUT,r.SAVE_TO_PDF,r["2_COMPLETED"],r.SEND_TAB],i=e.join(":"),t=[r.TOOLS,r.FSS,r.FORM,r.COMPLETED].join(":"),s.logScEvent(e,{featureType:i,sectionName:t}))},_logFormShareError:function(e){var i,t,s,n=this.options.appApi.siteCatalystApi;if(this._parcelHasForms()){var o="ServerError";switch(e){case"CannotConvertFormTimeout":o="TimeOut";break;case"CannotConvertFormRestrictedEditPermission":o="PermSet"}i=[r.TOOLS,r.FSS,r.FORM,r.OUTPUT,r.SAVE_TO_PDF,r.ERROR,o,r.SEND_TAB],t=i.join(":"),s=[r.TOOLS,r.FSS,r.FORM,r.OUTPUT,r.SAVE_TO_PDF,r.ERROR].join(":"),n.logScEvent(i,{featureType:t,sectionName:s})}},_parcelHasForms:function(){var e,i,s,n=!1;return e=this.options.sendFilesUiModel,i=e.get("metadata_collection"),s=e.get("enable_form_send"),s&&(n=i.some(function(e){return t.isFormMimeType(e.get("content_type"))})),n},_displayShareUpsellDialog:function(e,i){var t=_.extend({},{okButtonClass:"us-upsell-learn-more",cancelButtonClass:"us-upsell-close"}),s=this.options.appApi.dialogApi,n=s.displayHtmlAlert(s.SEVERITY_WARNING,e,i,l.LEARN_MORE,l.CLOSE_STRING,t);return $(".alert-dlg-buttons-rhp").css({"text-align":"right",direction:"rtl"}),$(".us-upsell-learn-more").css({"padding-left":"15px","padding-right":"15px","margin-left":"10px","margin-right":"5px"}),n.then(_.bind(function(){this._onUpsell()},this)).always(_.bind(function(){$(".alert-dlg-buttons-rhp").css({"text-align":"center",direction:"ltr"})},this))},_checkMaximumRecipients:function(e){var i,t=this.options.sendFilesUiModel,s=t.get("limits_model"),n=!1,o=t.get("us_mode");if(e)if(i=_.isUndefined(s)?250:s.get("#send-mode"===o?"max_recipients":"max_review_recipients"),e.length>i){var a=s.get("can_upgrade_send"),r=s.get("can_send_to_individuals");r?(a?this._displayShareUpsellDialog(l.SHARE_LIMIT_EXCEEDED_DLG_TITLE,l.SHARE_UPSELL_MSG):this._displayTooManyRecipients(e.length,i),n=!1):n=!0}else n=!0;return n},_displayTooManyRecipients:function(e,i){console.log("Too many recipients");var t=(this.options.appApi.dialogApi,l.SHARE_TOO_MANY_RECIPIENTS_DLG_TITLE),s=_.template(l.SHARE_TOO_MANY_RECIPIENTS_DLG_MSG,{maxRecipients:i});this.showErrorBubble(r.INVITE_PEOPLE_ERROR,t,s,!0)},_displayNoAccessToUser:function(e){{var i,t;this.options.appApi.dialogApi}i=l.COULD_NOT_SEND,t="UserEncrypted"===e?l.ENCRYPTION_KEY_DISABLED_MESSAGE:l.ENTERPRISE_USERS_ACCESS_ERROR,this.showErrorBubble(r.INVITE_PEOPLE_ERROR,i,t)},_setSFSWorkflowInProgress:function(){this.options.appApi.rnaApi.done(_.bind(function(e){e.esApi.setSFSWorkflowInProgress(!0)},this))},_clearSFSWorkflowInProgress:function(){this.options.appApi.rnaApi.done(_.bind(function(e){e.esApi.setSFSWorkflowInProgress(!1)},this))},showErrorBubble:function(e,i,t,s){return"share"===this.options.sendFilesUiModel.get("US_tab_open")&&(e==r.FILE_LIST_ERROR?($(".us-modal-file-list-error-dialog").show(),s===!0?$(".us-modal-file-list-error-dialog").find(".us-modal-error-dialog-content-text").html(t):$(".us-modal-file-list-error-dialog").find(".us-modal-error-dialog-content-text").text(t)):e==r.INVITE_PEOPLE_ERROR?($(".us-modal-share-error-dialog").show(),s===!0?$(".us-modal-share-error-dialog").find(".us-modal-error-dialog-content-text").html(t):$(".us-modal-share-error-dialog").find(".us-modal-error-dialog-content-text").text(t)):e==r.DEADLINE_ERROR?($(".us-modal-deadline-error-dialog").show(),$(".us-modal-deadline-error-dialog").find(".us-modal-error-dialog-content-text").text(t)):e==r.REMINDER_ERROR&&($(".us-modal-reminder-error-dialog").show(),$(".us-modal-reminder-error-dialog").find(".us-modal-error-dialog-content-text").text(t)),$("#us-modal-view").addClass("modal-for-error-dialog")),$.Deferred().resolve().promise()},hideErrorBubble:function(){$(".us-modal-error-dialog-container:visible").hide(),$("#us-modal-view").removeClass("modal-for-error-dialog")},_addKeyEventListener:function(){this.options.appApi.keyApi.pushKeyHandler(this)},_onKeyDown:function(e){var i=!1,t=e.which;return $("#modal-invite-summary-learn-more").is(":focus")&&13==t&&(this._launchLearnMoreInvite(),i=!0),!$(".us-modal-error-dialog-container:visible").length||9!=t&&40!=t&&38!=t&&27!=t||(this.hideErrorBubble(),i=!0),i
}}),n.UsModalShareTabView}),define("pdmplugins/unified-share/js/modalView/templates/us-modal-create-link-tab-template",[],function(){return'<div id="modal-cl-heading" class="ui-theme theme-text"><%= CREATE_LINK_MESSAGE_HEADING %></div><div id="modal-cl-summary" class="modal-tab-summary ui-theme theme-text"><div id="modal-cl-summary-text" class="ui-theme theme-header-text"><%= CREATE_LINK_MESSAGE_TEXT %></div></div><div id="modal-cl-allow-comments-row"><div class="us-checkbox-cell" id="us-modal-cl-allow-comments"><input type="checkbox" id="modal-cl-allow-comments-checkbox" class="share-checkbox" aria-label ="<%= CREATE_LINK_ALLOW_COMMENTS %>"><label for="modal-cl-allow-comments-checkbox" class="us-modal-allow-comments-label ui-theme theme-text"><%= CREATE_LINK_ALLOW_COMMENTS %></label></div></div><div id="upsell-container-get-link"></div><div id="modal-cl-progress-view" class= "ui-theme" ><div id="modal-cl-loader"></div><div id="modal-cl-working-heading" class="ui-theme theme-header-text"><%= CREATE_LINK_WORKING_HEADING %></div><div id="modal-cl-uploading-text" class= "ui-theme theme-text"></div></div><div id="modal-cl-success-view" class="ui-theme"><div><textarea type="text" id="modal-cl-url" class="ui-theme theme-share-border theme-share-modal-input-container theme-text" tabindex="-1" readonly="readonly" /></div><div id="modal-cl-link-message" class ="ui-theme theme-text" tabindex="-1"><%= US_CL_LINK_MESSAGE %></div></div><div class="modal-cl-button-bar ui-theme theme-share-modal-container"><div class = "us-modal-error-dialog-container us-modal-cl-error-dialog ui-theme theme-share-border"><span class = "us-modal-error-dialog-arrow us-modal-error-dialog-cl-arrow"></span><div class="us-modal-error-dialog-content us-modal-cl-error-dialog-content"><div class= "us-modal-error-dialog-content-text"></div></div></div><button class="modal-create-link-button control-button theme-button theme-button-label" aria-label = "<%= CREATE_LINK_GENERATE %>" aria-describedby="modal-create-link-button" id="modal-create-link-generate"><%= CREATE_LINK_GENERATE %></button><button class="modal-copy-link-button control-button theme-button theme-button-label" aria-label = "<%= COPY_LINK %>" aria-describedby="modal-copy-link-button" id="modal-copy-link"><%= COPY_LINK %></button><button class="create-link-button control-button button-grey ui-theme theme-share-grey-button"id="cl-modal-open-review"><%= CREATE_LINK_OPEN_REVIEW %></button></div>'}),define("pdmplugins/unified-share/js/modalView/views/us-modal-create-link-tab-view",["core/ac-core","files/ac-files","core/utils/file-types","core/utils/util","pdmplugins/unified-share/js/ac-unified-share","pdmplugins/unified-share/js/modalView/templates/us-modal-create-link-tab-template","pdmplugins/unified-share/js/modalView/templates/us-modal-free-user-upsell-template","i18n!pdmplugins/unified-share/js/nls/ui-strings","pdmplugins/unified-share/js/utils/sc-constants","pdmplugins/unified-share/js/utils/ts-utils","pdmplugins/unified-share/js/ops/desktop-do-upload-op","pdmplugins/unified-share/js/ops/finding-upload-folder-op","pdmplugins/unified-share/js/ops/begin-desktop-upload-op","pdmplugins/unified-share/js/ops/share-files-op"],function(e,i,t,s,n,o,a,l,r,d){return n.UsModalCreateLinkTabView=e.View.extend({events:{"click #modal-create-link-generate":"_onGenerateLink","click #modal-cl-allow-comments-checkbox":"_onAllowComments","click #modal-copy-link":"_onClickCopyLink","click #modal-cl-url":"_onClickURL","click #modal-cl-summary-learn-more":"_launchLearnMoreCL","blur  #modal-cl-url":"_onBlurURL","click .us-upsell-close-btn":"_onUpsellCloseClicked","click .us-upsell-get-started-btn":"_onUpsellGetStartedClicked","click #us-upsell-learn-more-btn":"_onUpsellLearnMoreClicked","click #cl-modal-open-review":"_onClickOpenReview"},initialize:function(){e.View.prototype.initialize.call(this),this._template=_.template(o),this._templateUpsell=_.template(a)},render:function(){e.View.prototype.render.call(this),0===this.$el.children().length&&(this.$el.html(this._template({CREATE_LINK_MESSAGE_HEADING:l.USM_GET_LINK_HEADING,CREATE_LINK_MESSAGE_TEXT:l.USM_GET_LINK_INFO,LEARN_MORE:l.LEARN_MORE,CREATE_LINK_ALLOW_COMMENTS:l.USM_ALLOW_COMMENTS,CREATE_LINK_GENERATE:l.USM_GET_LINK_BUTTON,CREATE_LINK_CLOSE:l.CLOSE_STRING,COPY_LINK:l.USM_COPY_LINK,CREATE_LINK_WORKING_HEADING:l.USM_CREATING_LINK,US_CL_LINK_MESSAGE:l.USM_LINK_COPIED,CREATE_LINK_OPEN_REVIEW:l.GO_TO_REVIEW})),this._initUpsellDialog(),this._initWrappers()),this._renderChildViews(),this._addUiModelEventListeners(),this._onClActiveViewChange(),this._checkUncheckAllowComments(),this._toggleAddFilesButton(),this._addUiEventListeners(),this._addKeyEventListener(),this._onFilesChange(),this._toggleAllowCommentsVisibility()},_initUpsellDialog:function(){var e=this._templateUpsell({USM_SEND_FOR_REVIEW:l.USM_SEND_FOR_REVIEW,USM_REVIEW_UPSELL_1:l.USM_REVIEW_UPSELL_1,USM_REVIEW_UPSELL_2:l.USM_REVIEW_UPSELL_2,USM_REVIEW_UPSELL_3:l.USM_REVIEW_UPSELL_3,USM_REVIEW_UPSELL_4:l.USM_REVIEW_UPSELL_4,LEARN_MORE:l.LEARN_MORE,US_SHARE_SFS_CTA:l.US_SHARE_SFS_CTA,CLOSE:l.SHARE_SUCCESS_CLOSE});this.$("#upsell-container-get-link").append(e),this.$(".us-modal-upsell-arrow").addClass("us-modal-upsell-top-arrow"),this.$(".us-floating-upsell-container").addClass("us-floating-upsell-container-top-arrow"),this.$(".us-floating-dialog").hide()},_initWrappers:function(){this.$ModalClAllowCommentsRow=this.$("#modal-cl-allow-comments-row"),this.$ModalClProgressView=this.$("#modal-cl-progress-view"),this.$ModalClSuccessView=this.$("#modal-cl-success-view"),this.$ModalClLinkMessage=this.$("#modal-cl-link-message"),this.$ModalCreateLinkGenerate=this.$("#modal-create-link-generate"),this.$ModalCopyLink=this.$("#modal-copy-link"),this.$ModalCLAllowCommentsCheckBox=this.$("#modal-cl-allow-comments-checkbox"),this.$usCLGenerateLinkButton=this.$("#modal-create-link-generate"),this.$ModalClUrl=this.$("#modal-cl-url"),this.$clModalOpenReviewBtn=this.$("#cl-modal-open-review"),this.$UsModalCLAllowComments=this.$("#us-modal-cl-allow-comments")},_addUiModelEventListeners:function(){var e=this.options.sendFilesUiModel;e.on("change:cl_active_view",this._onClActiveViewChange),e.on("change:local_file_objects",this._onFilesChange),e.get("metadata_collection").on("all",this._onFilesChange),e.on("change:ccloud_file_objects",this._onFilesChange),e.on("change:cl_mode",this._onModeChange)},_addUiEventListeners:function(){$("#us-modal-view").on("click",this.hideErrorBubble)},_renderChildViews:function(){},_reorderCollections:function(e){var i=[],t=$.Deferred(),s=0,n=[],o=this.options.sendFilesUiModel,a=o.get("limits_model"),l=0;if(!this.options.localFiles.length)return t.resolve().promise();if(this.avFlag=!1,this.formFlag=!1,_.each(this.options.localFiles,_.bind(function(t){var r;"postUpload"===e&&(t.id=this.options.assetIdarray[s],r=this.options.sendFilesUiModel.addFilesToCollection([t.id],void 0,o.get("share_collection"),!0,!0),i.push(r[0]),s++),"preUpload"===e&&(!_.isUndefined(t.get("path"))&&"\\\\www.adobe.com\\go\\homeacrordrunified18_2018"===t.get("path")||"http://www.adobe.com/go/homeacrordrunified18_2018"===t.get("path")?console.log("Welcome.pdf"):_.isEmpty(t.get("ext"))?(this.options.sendFilesUiModel.removeLocalFile([t]),r=this._showErrorDialogMsg("noExtension"),i.push(r)):_.isEmpty(t.get("assetId"))||this.options.sendFilesUiModel.get("bHFileIsDirty")&&t.get("assetId")===this.options.sendFilesUiModel.get("openedFileAssetId")?!a.get("can_send_av")&&o.hasAudioVideoExt(t.get("ext"))?(this.avFlag=!0,n[l++]=t,r=$.Deferred().resolve().promise(),i.push(r)):o.get("enable_form_send")||"form"!==t.get("ext")?(r=$.Deferred().resolve().promise(),i.push(r)):(this.formFlag=!0,n[l++]=t,r=$.Deferred().resolve().promise(),i.push(r)):(this.options.sendFilesUiModel.removeLocalFile([t]),r=this.options.sendFilesUiModel.addFilesToCollection([t.get("assetId")]),i.push(r[0])))},this)),n.length){var d;this.options.appApi.siteCatalystApi.logScEvent([r.TOOLS,this.options.sendFilesUiModel.get("ShareVariant"),r.FILES_SHARED_DLG,r.DISALLOWED,r.WARNING,r.SHOWN]),d=this.options.isType2OR3?this._showErrorDialogMsg("type2or3",n):this.avFlag&&!this.formFlag?this._showErrorDialogMsg("avError",n):!this.avFlag&&this.formFlag?this._showErrorDialogMsg("fileTypeError",n,"formError"):this._showErrorDialogMsg("fileTypeError",n,"avFormError"),i.push(d)}return $.when.apply($,i).then(_.bind(function(){this.options.localFiles=this.options.sendFilesUiModel.get("local_file_objects"),this.options.files=this.options.sendFilesUiModel.get("metadata_collection"),t.resolve()},this),_.bind(function(){t.reject()},this)),t.promise()},_showErrorDialogMsg:function(e,i,t){{var s,n,o=this.options.appApi.dialogApi;this.options.sendFilesUiModel.get("limits_model")}if("noExtension"===e)return s=l.ADD_FILES_REJECTED_TITLE,n=l.ADD_FILES_REJECTED_MESSAGE,this.showErrorBubble(r.CREATE_LINK_ERROR,s,n);if("avError"===e){var a=_.extend({},{okButtonClass:"us-upsell-learn-more",cancelButtonClass:"us-upsell-close"});s=l.SHARE_AV_UPSELL_TITLE,n=l.SHARE_AV_UPSELL_MSG;var d=o.displayHtmlAlert(o.SEVERITY_WARNING,s,n,l.LEARN_MORE,l.CLOSE_STRING,a);return $(".alert-dlg-buttons-rhp").css({"text-align":"right",direction:"rtl"}),$(".us-upsell-learn-more").css({"padding-left":"15px","padding-right":"15px","margin-left":"10px","margin-right":"5px"}),d.then(_.bind(function(){return this._onUpsell(),$.Deferred().reject().promise()},this),_.bind(function(){return _.each(i,_.bind(function(e){this.options.sendFilesUiModel.removeLocalFile([e])},this)),$.Deferred().reject().promise()},this)).always(_.bind(function(){$(".alert-dlg-buttons-rhp").css({"text-align":"center",direction:"ltr"})},this))}if("type2or3"===e){var s=l.COULD_NOT_SEND,n=l.ENTERPRISE_USERS_ACCESS_ERROR;return this.showErrorBubble(r.CREATE_LINK_ERROR,s,n).then(_.bind(function(){return _.each(i,_.bind(function(e){this.options.sendFilesUiModel.removeLocalFile([e])},this)),$.Deferred().reject().promise()},this))}return"fileTypeError"===e?(s=l.SEND_UPSELL_UPGRADE_REQUIRED,"formError"===t?(n=l.SHARE_FORMS_ERROR_DESKTOP,this.options.appApi.siteCatalystApi.logScEvent([r.TOOLS,this.options.sendFilesUiModel.get("ShareVariant"),r.ATTEMPTED_TO_SHARE_FORM])):"avFormError"===t&&(n=l.SHARE_AV_FORMS_ERROR+l.SHARE_AV_UPGRADE_MESSAGE),this.showErrorBubble(r.CREATE_LINK_ERROR,s,n).then(_.bind(function(){return _.each(i,_.bind(function(e){this.options.sendFilesUiModel.removeLocalFile([e])},this)),$.Deferred().reject().promise()},this))):void 0},_checkReviewPossible:function(){var e=this.options.sendFilesUiModel;e.get("allow_comments_enabled")===!0&&"#review-mode"===e.get("cl_mode")?n.opFactory.create("CanSendForReviewOp",this.options).run().then(_.bind(function(){this.$ModalCLAllowCommentsCheckBox.prop("checked",!0)},this),_.bind(function(i){this.$ModalCLAllowCommentsCheckBox.prop("checked",!1),e.setCLMode("#send-mode"),e.set("allow_comments",!1),this.options.appApi.displayApi.showModal(!1);var t=this.options.sendFilesUiModel.get("ShareVariant"),s=r.ERROR,n=i.analyticsEvent;this.options.appApi.siteCatalystApi.logScEvent([t,s,n]),this.showErrorBubble(r.CREATE_LINK_ERROR,l.FILE_CANT_BE_SENT_REVIEW,i.msg)},this)):this.$ModalCLAllowCommentsCheckBox.prop("checked",!1)},_onUpsell:function(i){var t=this.options.limitsModel,s=t.get("upgrade_url");this.options.appApi.rnaApi.done(_.bind(function(e){e.openDecoratedUrl(s)},this)),e.Util.isCEF()&&this.options.appApi.sessionApi.ensureSignedIn()},_onUpsellCloseClicked:function(){this.$(".us-floating-dialog").hide()},_onUpsellLearnMoreClicked:function(){this.options.appApi.rnaApi.done(_.bind(function(e){e.openDecoratedUrl(l.REVIEW_LEARN_MORE_LINK_GO_URL)},this))},_onUpsellGetStartedClicked:function(){this.options.appApi.rnaApi.done(_.bind(function(e){e.openDecoratedUrl(this.options.limitsModel.get("upgrade_url"))},this)),e.Util.isCEF()&&this.options.appApi.sessionApi.ensureSignedIn(),this._onUpsellCloseClicked()},_onModeChange:function(){this._toggleAddFilesButton(),this._checkMaximumFiles(),this._checkReviewPossible()},_onAllowComments:function(){console.log("On Allow Comments...");var e=this.options.sendFilesUiModel.get("ShareVariant"),i=r.USE,t="Create Link Allow Comment Clicked";this.options.appApi.siteCatalystApi.logScEvent([e,i,t]),this.options.sendFilesUiModel.get("isReviewVisible")?this._allowComments():(this.$ModalCLAllowCommentsCheckBox.attr("checked",!1),this.$(".us-floating-dialog").show())},_allowComments:function(){var e=this.options.sendFilesUiModel;1==e.get("allow_comments_enabled")&&this.$ModalCLAllowCommentsCheckBox.is(":checked")?(e.set("allow_comments",!0),e.set("cl_mode","#review-mode")):(e.set("allow_comments",!1),e.set("cl_mode","#send-mode"))},_checkUncheckAllowComments:function(){{var e=this.options.sendFilesUiModel.get("cl_mode");this.options.sendFilesUiModel.get("allow_comments")}"#review-mode"==e?this.$ModalCLAllowCommentsCheckBox.attr("checked",!0):this.$ModalCLAllowCommentsCheckBox.attr("checked",!1),this._allowComments()},_toggleAllowCommentsVisibility:function(){var e=!0;this.options.appApi.rnaApi.done(_.bind(function(i){e=i.stApi.shouldAdobeReviewVisible()},this)),e?this.$UsModalCLAllowComments.show():this.$UsModalCLAllowComments.hide()},_toggleAddFilesButton:function(){},_checkMaximumFiles:function(){var e=this.options.sendFilesUiModel,i=e.get("US_tab_open");if("createLink"===i){if(e.get("allow_comments")&&e.isMultipleFilesSelected()){var t=(this.options.appApi.dialogApi,l.SHARE_TOO_MANY_FILES_DLG_TITLE),s=l.ERROR_MULTIPLE_FILES_REVIEW1_MODAL+". "+l.ERROR_MULTIPLE_FILES_REVIEW2;this.$ModalCLAllowCommentsCheckBox.prop("checked",!1),e.setCLMode("#send-mode"),e.set("allow_comments",!1);var n=this.options.sendFilesUiModel.get("ShareVariant"),o=r.ERROR,a="Multiple files selected for review";return this.options.appApi.siteCatalystApi.logScEvent([n,o,a]),this.showErrorBubble(r.FILE_LIST_ERROR,t,s),!1}var d,e=this.options.sendFilesUiModel,p=e.get("limits_model"),h=e.get("us_mode"),c=e.get("local_file_objects").length+e.get("metadata_collection").length;if(d=_.isUndefined(p)?50:p.get("#send-mode"===h?"max_files":"max_review_files"),c>d){var u=(this.options.appApi.dialogApi,l.SHARE_TOO_MANY_FILES_DLG_TITLE),m=_.template(l.SHARE_TOO_MANY_FILES_DLG_MSG,{maxNumber:d});return this.showErrorBubble(r.FILE_LIST_ERROR,u,m,!0),!1}}return!0},_onGenerateLink:function(){console.log("Generating link....");var e=this.options.sendFilesUiModel;if(e.isAVSharingPermitted())this._debouncedShareClick||(this._debouncedShareClick=_.debounce(this._onShareClick,1e3,!0)),"onlyRHP"===this.options.sendFilesUiModel.get("layout")&&this.options.sendFilesUiModel.get("checkForSave")?this.options.appApi.rnaApi.done(_.bind(function(e){e.rnaServicesAPI.checkOpenedDocAndPromptForSaveApi().then(_.bind(function(){this._debouncedShareClick()},this))},this)):this._debouncedShareClick();else{if(s.isClassic())return void this.showErrorBubble(r.CREATE_LINK_ERROR,l.ERROR_STRING,l.SHARE_ERROR_UNSUPPORTED_SHARING_MIME_TYPE);e.setShareState("avNotAllowed")}},_onShareClick:function(){var e,i,t,s,o,a,d,p,h,c,u,m,E,g,S,f=[],A=[];if(this._checkMaximumFiles()){if(this.options.appApi.siteCatalystApi.logScEvent([r.TOOLS,this.options.sendFilesUiModel.get("ShareVariant"),r.SHARE_BUTTON,r.CLICKED]),t=this.options.sendFilesUiModel,s=t.get("metadata_collection"),p=t.get("local_file_objects"),o="createLink"===t.get("US_tab_open"),a="share"===t.get("US_tab_open"),c=t.get("customize_recipient_page"),S=t.get("allow_comments"),d=t.get("allow_comments"),h=this._getSubjectText(!1),e={uiModel:t,files:s,localFiles:p,recipients:f,is_public:o,is_individual:a,can_make_comments:S,email_subject:h,displayApi:this.options.appApi.displayApi,appApi:this.options.appApi,rootView:this.options.rootView,is_branding:c,sendFilesUiModel:this.options.sendFilesUiModel,assetIdarray:A,recipientsAreFinalized:!0,is_review:S},i=_.extend({},{filesModelBackup:s.clone(),localFilesBackup:p}),u=_.bind(function(){var e,s,o=this.options;this._reorderCollections("preUpload").then(_.bind(function(){o=this.options,e=new n.BeginDesktopUploadOp(o),g=new n.FindingUploadFolderOp(o),s=_.bind(function(){o.parentId=g.id,_.isUndefined(g.persistence)||(o.persistence=g.persistence),"#send-mode"===t.get("cl_mode")&&t.get("local_file_objects").length>0&&t.set("share_loader_text",l.SHARE_LOADER_UPLOAD3),e.run().then(_.bind(function(){this._onShareClickFinish(o,i)},this),_.bind(function(){this._onShareError(i,r.ERROR_UPLOAD),this._resetAfterError(i)},this))},this),p.length?g.run().then(s,_.bind(function(){this._onShareError(i,r.NO_CONNECTIVITY),this._resetAfterError(i)},this)):s()},this),_.bind(function(){this._resetAfterError(i)},this))},this),m=_.bind(function(e){if(e){var t=(this.options.appApi.dialogApi,_.template('<div class = "learn-more-sharing"><%=LEARN_MORE%></div>')({LEARN_MORE:l.LEARN_MORE})),s=this.$ModalCLAllowCommentsCheckBox.prop("checked")?l.FILE_CANT_BE_SENT:l.FILE_CANT_BE_SENT_REVIEW,n=l.SHARE_ERROR_ENTERPRISE_SEND_DLG_MSG+t,o=this.options.sendFilesUiModel.get("ShareVariant"),a=r.USE,d="Sharing Restriction Error Prompt Shown";this.options.appApi.siteCatalystApi.logScEvent([o,a,d]),this.showErrorBubble(r.CREATE_LINK_ERROR,s,n,!0),$(".learn-more-sharing").click(this._onSharingLearnMore),this._resetAfterError(i)}else u()},this),E=_.bind(function(){var e=this.options.appApi.rnaApi;e.done(_.bind(function(e){m(e.isFeatRunning()?e.stApi.isSendTrackRestrictionsEnabled():this.options.limitsModel.get("restrictions"))},this))},this),this.options=_.extend({},this.options,e),!this.options.appApi.networkConnectivityApi.isOnline())return this._renderOfflineView(),this._onShareError(i,r.NO_CONNECTIVITY),void this._resetAfterError(i);this.options.appApi.sessionApi.isSignedInReader()&&this._setWorkingView(),this.options.appApi.sessionApi.ensureSignedIn().then(_.bind(function(){this._setWorkingView(),this._resolveRecipientsAddressesList(this.options.recipients).always(_.bind(function(){this.options=_.extend({},this.options,this._postSignInFunction()),this.options.readRegistry=!1,this._checkMaximumRecipients(this.options.recipients)!==!1&&n.opFactory.create("DesktopGettingSubscriptionLevels",this.options).run().then(_.bind(function(){E()},this),_.bind(function(){this.options.appApi.displayApi.showModal(!1),this._onShareError(i,r.NO_CONNECTIVITY),this._resetAfterError(i)},this))},this))},this),_.bind(function(e){e&&"NoAccessToPdfServices"===e.errorString&&this._displayNoAccessToUser(e.errorCode)},this))}},_onShareClickFinish:function(i,t){{var s,o,a,d=this.options.sendFilesUiModel.get("share_collection"),p=this.options.sendFilesUiModel.get("metadata_collection");this.options.brandingModel}d.reset(),p.each(_.bind(function(e){var i=new n.FileMetadataModel;i.set(_.clone(e.attributes)),d.add(i)},this)),this.options=_.extend({},this.options,i),a=_.extend({shareFiles:d},i),this._reorderCollections("postUpload").then(_.bind(function(){a.shareFiles.length&&(s=new n.ShareFilesOp(a),s.run().then(_.bind(function(e){this.options.sendFilesUiModel.set({active_view:"success",parcel:e.parcel}),this.options.appApi.displayApi.showModal(!1),this.options.sendFilesUiModel.set("cl_active_view","complete"),this._resetPageToDefault(),this._logFormShareSuccess();var i=this.options.sendFilesUiModel.get("ShareVariant"),t=r.USE,s="Create Link For View";if("#review-mode"===this.options.sendFilesUiModel.get("cl_mode")&&(s="Create Link For Review"),this.options.appApi.siteCatalystApi.logScEvent([i,t,s]),!this.options.is_review){var n={};n.op="addParcel",n.parcel=e.parcel,this.options.appApi.rnaApi.done(_.bind(function(e){e.stApi.updateInAppDMStateAPI(n)},this))}},this),_.bind(function(i){function s(e){var i={Unauthorized:l.SHARE_UNVERIFIED_ID_MSG,PDFIsPortfolio:l.REVIEW_DISABLE_REASON_PORTFOLIO_MODAL,PDFIsPasswordProtected:l.REVIEW_DISABLE_PROTECTED_MODAL,PDFIsCertificateProtected:l.REVIEW_DISABLE_PROTECTED_MODAL,PDFIsUnknownProtected:l.REVIEW_DISABLE_PROTECTED_MODAL,PDFIsPolicyProtected:l.REVIEW_DISABLE_PROTECTED_MODAL,PDFIsPDFA:l.REVIEW_DISABLE_REASON_PDFA_MODAL,UnsupportedCommentsPDF:l.REVIEW_DISABLE_REASON_UNSUPPORTED_ANNOTS_MODAL,PDFIsSecure:l.REVIEW_DISABLE_PROTECTED_MODAL,PDFIsInvalid:l.REVIEW_DISABLE_REASON_INVALID_FILE_MODAL,InvalidComment:l.REVIEW_DISABLE_REASON_UNSUPPORTED_ANNOTS_MODAL,InvalidCommentBodyLength:l.REVIEW_DISABLE_INVALID_COMMENT_LENGTH_MODAL,CommentCountExceeded:l.REVIEW_DISABLE_COMMENT_COUNT_EXCEEDED_MODAL,CommentsExtractionSizeExceeded:l.REVIEW_DISABLE_COMMENT_EXTRACTION_ERROR,Unknown:l.REVIEW_DISABLE_UNKNOWN_ERROR};try{var t=JSON.parse(e.responseText);n=t.error.code}catch(s){}if(_.isUndefined(n))try{var t=JSON.parse(e.responseText);n=t.parcels[0].reason_for_failed_state}catch(s){}n&&(a=i[n])}var n,a;s(i);this.options.appApi.dialogApi;_.isUndefined(a)?this.showErrorBubble(r.CREATE_LINK_ERROR,l.SHARE_CL_ERROR_DLG_TITLE,l.SHARE_CL_ERROR_DLG_MSG):this.showErrorBubble(r.CREATE_LINK_ERROR,l.SHARE_CL_ERROR_DLG_TITLE,a),this.options.appApi.displayApi.showModal(!1),this.options.sendFilesUiModel.set("cl_active_view","welcome");try{o=JSON.parse(i.responseText).error.code}catch(d){}o&&0===o.indexOf("CannotConvertForm")&&this._logFormShareError(o),e.Util.isCEF()&&this._resetAfterError(t)},this)))},this),_.bind(function(){this._onShareError(t,r.NO_CONNECTIVITY),this._resetAfterError(t)},this))},_onShareError:function(e,i){if(i===r.NO_CONNECTIVITY)this.showErrorBubble(r.CREATE_LINK_ERROR,l.SHARE_NO_INTERNET_CONNECTION,l.SHARE_NO_INTERNET_CONNECTION_MSG);else if(i===r.REVIEW_NOT_PERMITTED){var t=this.options.sendFilesUiModel.get("ShareVariant"),s=r.USE,n="Review not supported";this.options.appApi.siteCatalystApi.logScEvent([t,s,n]),this.showErrorBubble(r.CREATE_LINK_ERROR,l.SHARE_REVIEW_RESTRICTED,l.SHARE_REVIEW_RESTRICTED_MSG).done(_.bind(function(){this.options.sendFilesUiModel.setCLMode("#send-mode"),this.options.sendFilesUiModel.set("allow_comments",!1)},this))}else i===r.ERROR_UPLOAD&&this.showErrorBubble(r.CREATE_LINK_ERROR,l.SHARE_UPLOAD_ERROR_TITLE,l.SHARE_UPLOAD_ERROR_MSG)},_onSharingLearnMore:function(){this.options.appApi.rnaApi.then(_.bind(function(e){e.stApi.launchSendTrackRestrictionsLearnMoreUrl()}))},_launchLearnMoreCL:function(){this.options.appApi.rnaApi.done(_.bind(function(e){e.openDecoratedUrl(l.GET_LINK_LEARN_MORE_GO_URL)},this))},_onClickOpenReview:function(){var e=this.options.sendFilesUiModel.get("openEurekaFileArgs");this.options.appApi.rnaApi.done(function(i){i.assetApi({methodName:"openEurekaFile",methodArgs:e})})},_resetAfterError:function(e){var i=this.options.sendFilesUiModel;i.set("cl_active_view","welcome"),i.set("metadata_collection",e.filesModelBackup.clone()),i.set("local_file_objects",e.localFilesBackup)},_showConnectorFileError:function(){this.showErrorBubble(r.CREATE_LINK_ERROR,l.CONNECTOR_FILE_ERROR_TITLE,l.CONNECTOR_FILE_ERROR_MSG)},_fetchingSubscriptionWait:function(e){e?(this.$fullOverlay=this.options.appApi.displayApi.showFullOverlay(!0),this.$fullOverlay.addClass("progress-fetch-subscription")):(this.$fullOverlay.removeClass("progress-fetch-subscription"),this.options.appApi.displayApi.showFullOverlay(!1))},_resolveRecipientsAddressesList:function(e){return this.options.appApi.rnaApi.then(_.bind(function(i){return _.isUndefined(e)||0===e.length?this._getResolvedPromise():i.stApi.getResolvedEmailAddressesListAPI(e).then(_.bind(function(e){var i;return 0===e.length?$.Deferred().reject().promise():(i=e.split(";"),i.pop(),this.options.recipients=[],_.each(i,_.bind(function(e){-1!==e.indexOf("@")&&this.options.recipients.push(e)},this)),$.Deferred().resolve().promise())},this),_.bind(function(){return $.Deferred().reject().promise()},this))},this),_.bind(function(){return $.Deferred().reject().promise()},this))},_postSignInFunction:function(){var e,i,t=this.options,s=this.options.is_public,n=this.options.recipients,o=this.options.is_individual;return i=this.options.appApi.baseFilesUrisApi.getAlternateUploadUri(),this.options.appApi.siteCatalystApi.logScEvent([r.TOOLS,this.options.sendFilesUiModel.get("ShareVariant"),r.SHARE_BUTTON,"async"]),this._logSharingParams(s,o,n),e=this.options.appApi.baseFilesUrisApi.getSendApiUri(),e=d.extractRootUrl(e),t={rootUrl:e,uploadUrl:i}},_renderOfflineView:function(){console.log("Render offlineView")},_resetPageToDefault:function(){console.log("Draw the success view for Create Link")},_logSharingParams:function(e){var i,t=this.options.appApi.siteCatalystApi;e&&t.logScEvent([r.TOOLS,this.options.sendFilesUiModel.get("ShareVariant"),r.SHARE_WITH,r.PUBLIC]),i=r.DEFAULT,t.logScEvent([r.TOOLS,this.options.sendFilesUiModel.get("ShareVariant"),r.SUBJECT,i]),this._logFormShareStarted()},_logFormShareStarted:function(){var e,i,t=this.options.appApi.siteCatalystApi;this._parcelHasForms()&&(e=[r.TOOLS,r.FSS,r.FORM,r.OUTPUT,r.SAVE_TO_PDF,r["1_STARTED"],r.SEND_TAB],i=e.join(":"),t.logScEvent(e,{featureType:i}))},_logFormShareSuccess:function(){var e,i,t,s=this.options.appApi.siteCatalystApi;this._parcelHasForms()&&(e=[r.TOOLS,r.FSS,r.FORM,r.OUTPUT,r.SAVE_TO_PDF,r["2_COMPLETED"],r.SEND_TAB],i=e.join(":"),t=[r.TOOLS,r.FSS,r.FORM,r.COMPLETED].join(":"),s.logScEvent(e,{featureType:i,sectionName:t}))},_logFormShareError:function(e){var i,t,s,n=this.options.appApi.siteCatalystApi;if(this._parcelHasForms()){var o="ServerError";switch(e){case"CannotConvertFormTimeout":o="TimeOut";break;case"CannotConvertFormRestrictedEditPermission":o="PermSet"}i=[r.TOOLS,r.FSS,r.FORM,r.OUTPUT,r.SAVE_TO_PDF,r.ERROR,o,r.SEND_TAB],t=i.join(":"),s=[r.TOOLS,r.FSS,r.FORM,r.OUTPUT,r.SAVE_TO_PDF,r.ERROR].join(":"),n.logScEvent(i,{featureType:t,sectionName:s})}},_parcelHasForms:function(){var e,i,s,n=!1;return e=this.options.sendFilesUiModel,i=e.get("metadata_collection"),s=e.get("enable_form_send"),s&&(n=i.some(function(e){return t.isFormMimeType(e.get("content_type"))})),n},_checkMaximumRecipients:function(e){var i,t=this.options.sendFilesUiModel,s=t.get("limits_model"),n=!1;return e&&(i=s.get("max_recipients"),e.length>i?this._displayTooManyRecipients(e.length,i):n=!0),n},_displayTooManyRecipients:function(){console.log("Too many recipients")},_displayNoAccessToUser:function(e){{var i,t;this.options.appApi.dialogApi}i=l.COULD_NOT_SEND,t="UserEncrypted"===e?filesUiStrings.ENCRYPTION_KEY_DISABLED_MESSAGE:l.ENTERPRISE_USERS_ACCESS_ERROR,this.showErrorBubble(r.CREATE_LINK_ERROR,i,t)},_onFilesChange:function(){var e=this.options.sendFilesUiModel,i=e.get("local_file_objects"),t=e.get("metadata_collection"),s=e.get("ccloud_file_objects");0===i.length&&0===t.length||s.length>0?this.$usCLGenerateLinkButton.addClass("disabled").attr("disabled","disabled"):this.$usCLGenerateLinkButton.removeClass("disabled").removeAttr("disabled"),i.length+t.length==1&&this._checkReviewPossible()},_setWorkingView:function(){this.options.sendFilesUiModel.set("cl_active_view","working"),this.options.sendFilesUiModel.get("allow_comments")?this.options.sendFilesUiModel.set("cl_active_view_heading",l.USM_CREATING_LINK):this.options.sendFilesUiModel.set("cl_active_view_heading",l.USM_CREATING_LINK)},_getSubjectText:function(e){var i=this.options.sendFilesUiModel.get("cl_subject_text");return e&&(i=i.replace(l.SHARE_INITIAL_SUBJECT_PREFIX,"")),i},_onClActiveViewChange:function(){var e=this.options.sendFilesUiModel,i=e.get("cl_active_view");switch(this.$ModalClAllowCommentsRow.hide(),this.$ModalClProgressView.hide(),this.$ModalClSuccessView.hide(),this.$ModalCopyLink.hide(),this.$clModalOpenReviewBtn.hide(),this.$ModalCreateLinkGenerate.removeClass("disabled").removeAttr("disabled"),i){case"welcome":this.$ModalClAllowCommentsRow.show(),this.$ModalClProgressView.hide(),this.$ModalClSuccessView.hide();break;case"working":this.$ModalClAllowCommentsRow.hide(),this.$ModalClProgressView.show(),this.$ModalClSuccessView.hide(),this.$ModalCreateLinkGenerate.addClass("disabled").attr("disabled","disabled"),e.set("enable_add_files",!1);break;case"complete":this.$ModalClAllowCommentsRow.hide(),this.$ModalClProgressView.hide(),this.$ModalClSuccessView.show(),this.$ModalCopyLink.show(),this.$ModalCreateLinkGenerate.hide(),this._updateCreatedLink(),e.set("enable_add_files",!1),e.get("allow_comments")&&this.$clModalOpenReviewBtn.show(),this._onClickCopyLink()}},_updateCreatedLink:function(){this._parcel=this.options.sendFilesUiModel.get("parcel"),this.$ModalClUrl.val(this._getPublicUrl(this._parcel.invitations))},_getPublicUrl:function(e){var i,t;return t=_.find(e,function(e){return"PARCEL_PUBLIC_SHARING"===e.recipient_email}),t&&(i=t.preview_url),i},_onClickURL:function(){this.$ModalClUrl.select()},_onBlurURL:function(){var e=this.$ModalClUrl.val();this.$ModalClUrl.val(""),this.$ModalClUrl.val(e)},_onClickCopyLink:function(){console.log("Copy Link");var e=this.options.sendFilesUiModel.get("ShareVariant"),i=r.SUCCESS,t="Copy Link";this.options.appApi.siteCatalystApi.logScEvent([e,i,t]),this._onClickURL(),this.$ModalClUrl.focus(),this.options.appApi.rnaApi.done(_.bind(function(e){e.cefBrowserApi({methodName:"handleViewEvent",parameters:["CopyEvent",{}]}).then(_.bind(function(){this._showLinkCopiedText(),setTimeout(_.bind(this._hideLinkCopiedText,this),4e3)},this),_.bind(function(){this.options.appApi.dialogApi;this.showErrorBubble(r.CREATE_LINK_ERROR,l.SHARE_COPY_LINK_ERROR_DLG_TITLE,l.SHARE_COPY_LINK_ERROR_DLG_MSG)},this))},this))},_showLinkCopiedText:function(){this.$ModalClLinkMessage.show()},_hideLinkCopiedText:function(){this.$ModalClLinkMessage.hide()},showErrorBubble:function(e,i,t,s){return"createLink"===this.options.sendFilesUiModel.get("US_tab_open")&&(e==r.FILE_LIST_ERROR?($(".us-modal-file-list-error-dialog").show(),s===!0?$(".us-modal-file-list-error-dialog").find(".us-modal-error-dialog-content-text").html(t):$(".us-modal-file-list-error-dialog").find(".us-modal-error-dialog-content-text").text(t)):e==r.CREATE_LINK_ERROR&&($(".us-modal-cl-error-dialog").show(),s===!0?$(".us-modal-cl-error-dialog").find(".us-modal-error-dialog-content-text").html(t):$(".us-modal-cl-error-dialog").find(".us-modal-error-dialog-content-text").text(t)),$("#us-modal-view").addClass("modal-for-error-dialog")),$.Deferred().resolve().promise()},hideErrorBubble:function(){$(".us-modal-error-dialog-container:visible").hide(),$("#us-modal-view").removeClass("modal-for-error-dialog")},_addKeyEventListener:function(){this.options.appApi.keyApi.pushKeyHandler(this)},_onKeyDown:function(e){var i=!1,t=e.which;return $("#modal-cl-summary-learn-more").is(":focus")&&13==t&&(this._launchLearnMoreCL(),i=!0),i}}),n.UsModalCreateLinkTabView}),define("pdmplugins/unified-share/js/modalView/templates/us-modal-send-mail-tab-template",[],function(){return'<div><div id="sm-default-state"><div colspan="100%" style="padding-bottom:10px;" class=" modal-sm-heading ui-theme theme-text"> <%= EMAIL_OPENED %> </div><div class="ui-theme theme-header-text us-sm-desc-text"><text  id="sm-mail-sent-desc"></text><text id="pref_launcher" class="ui-theme theme-text theme-share-add-files"><%= PREFERENCES %></text></div><div class="us-sm-desc ui-theme theme-share-promo-container"><div class="us-sm-desc-content-default ui-theme theme-header-text us-sm-desc-text"><%= SEND_MAIL_DESC_HEADER %><ul class="us-modal-sm-desc-content-list"><li class="ui-theme theme-header-text"> <%= SEND_LINK_AS_ATTACHMENT %> </li><li class="ui-theme theme-header-text"> <%= SEND_LARGE_FILE_AS_ATTACHMENT %> </li><li class="ui-theme theme-header-text"> <%= SEND_MAIL_REVIEWERS_CMNT %> </li></ul><span class="ui-theme theme-text theme-share-add-files sm_switch_tab_link" aria-label ="<%= TRY_NOW %>" tabindex = "0"> <%= TRY_NOW %> </span></div></div><div class = "ui-theme theme-share-modal-container share-modal-button-bar" ><button class="control-button theme-button theme-button-label ui-theme theme-text" id="sm-close-dialog"><%= CLOSE %></button></div></div><div id="sm_no_default_state"><div class = "sm-mode-selector"></div><div class = "sm-profile-selector"></div><div class="us-sm-desc ui-theme theme-share-promo-container"><div class="us-sm-desc-content-default-no ui-theme theme-header-text us-sm-desc-text"><%= SEND_MAIL_DESC_HEADER %><ul class="us-modal-sm-desc-content-list"><li class="ui-theme theme-header-text"> <%= SEND_LINK_AS_ATTACHMENT %> </li><li class="ui-theme theme-header-text"> <%= SEND_LARGE_FILE_AS_ATTACHMENT %> </li><li class="ui-theme theme-header-text"> <%= SEND_MAIL_REVIEWERS_CMNT %> </li></ul><span class="ui-theme theme-text theme-share-add-files sm_switch_tab_link" aria-label ="<%= TRY_NOW %>" tabindex = "0"> <%= TRY_NOW %> </span></div><div class="us-reduce-upsell ui-theme theme-header-text hide"><div class="us-reduce-size-image-container"></div><div class="us-reduce-size-summary "><%= UPSELL_MSG %> </div><a class="us-reduce-upsell-link theme-hyperlink" id="reduce-upsell-link" tabindex = "0" aria-label="<%= REDUCE_UPSELL_LINK_TEXT%>"><%= REDUCE_UPSELL_LINK_TEXT %></a></div></div><div class="us-checkbox-cell" id="modal-remember-choice-container"><input type="checkbox" id="modal-remember-choice-checkbox" class="share-checkbox" aria-label ="<%= REMEMBER_CHOICE %>"><label for="modal-remember-choice-checkbox" class="us-modal-allow-comments-label ui-theme theme-text"><%= REMEMBER_CHOICE %></label></div><div class = "ui-theme theme-share-modal-container share-modal-button-bar" ><button class="sm-button control-button theme-button theme-button-label" id="sm-continue" aria-label ="<%= SM_CONTINUE %>" ><%= SM_CONTINUE %></button></div></div></div>'
}),define("pdmplugins/unified-share/js/modalView/templates/us-modal-sm-service-selector-view-template",[],function(){return'<div><table class="us-table-big"><th colspan="100%" style="padding-bottom:10px;" class=" modal-sm-heading ui-theme theme-text"> <%= SEND_FILE_ATTACH_EMAIL %> </th><tr class="us-row"><td class="us-sm-attach-using-label ui-theme theme-text" colspan="2"><%= ATTACH_USING %>:</td></tr><tr class="us-row"><td class="us-radio-cell us-sm-radio-cell"><input class = "service-selector sm-service-selector" type="radio" id="sm_default_mail" name = "sm_mode" checked></td><td><label for="sm_default_mail" id = "sm_default_mail_label" class="sm-service-selector-label ui-theme theme-text"><%= DEFAULT_EMAIL %></label></td></tr><tr class="us-row"><td class="us-radio-cell us-sm-radio-cell"><input class = "service-selector sm-service-selector" type="radio" id="sm_webmail" name = "sm_mode"></td><td><label for="sm_webmail" id = "sm_webmail_label" class="sm-service-selector-label ui-theme theme-text"><%= USE_WEBMAIL %></label></tr></table></div>'}),define("pdmplugins/unified-share/js/modalView/views/us-modal-sm-service-selector-view",["core/ac-core","pdmplugins/unified-share/js/ac-unified-share","pdmplugins/unified-share/js/modalView/templates/us-modal-sm-service-selector-view-template","i18n!pdmplugins/unified-share/js/nls/ui-strings"],function(e,i,t,s){return i.USModalSMServiceSelectorView=e.View.extend({events:{"click .sm-service-selector":"_selectService"},initialize:function(){e.View.prototype.initialize.call(this),this.mouseUp=!1},render:function(){this.$el;e.View.prototype.render.call(this),this._template=_.template(t),0===this.$el.children().length&&(this.$el.html(this._template({DEFAULT_EMAIL:s.DEFAULT_EMAIL_APP,USE_WEBMAIL:s.USE_WEBMAIL,DEFAULT_EMAIL_TITLE:s.DEFAULT_EMAIL_APP,USE_WEBMIAL_TITLE:s.USE_WEBMAIL,SEND_FILE_ATTACH_EMAIL:s.SEND_FILE_ATTACH_EMAIL,ATTACH_USING:s.SEND_MAIL_ATTACH_USING})),this._initWrappers(),this._addEventListeners()),this._addUiModelEventListeners(),this._setEmailClientName(),this._selectModeFromServiceSelected()},_initWrappers:function(){this.$SmDefaultMailLabel=this.$("#sm_default_mail_label"),this.$SmWebmailLabel=this.$("#sm_webmail_label"),this.$smWebmail=this.$("#sm_webmail")},_addUiModelEventListeners:function(){var e=this.options.SendMailUiModel;e.on("change:send_mail_mode",this._onSendMailModeChange)},_onSendMailModeChange:function(){this.render()},_addEventListeners:function(){$(document).mouseup(_.bind(function(e){e.target.className.includes("service-selector-label")&&(this.mouseUp=!0)},this))},_selectService:function(e){var i=this.options.SendMailUiModel,t=$(e.currentTarget),s=t.attr("id");i.set("send_mail_mode",s),this.mouseUp&&t.blur(),this.mouseUp=!1},_setEmailClientName:function(){var e=s.DEFAULT_EMAIL_APP+" ("+this.options.SendMailUiModel.get("default_email_client")+")";this.$SmDefaultMailLabel.text(e)},_selectModeFromServiceSelected:function(){var e=this.options.SendMailUiModel.get("send_mail_mode");this.$("#"+e).attr("checked",!0)},_hideDisableWebmailUI:function(){this.$smWebmail.attr("disabled",!0),this.$smWebmail.addClass("disabled"),this.$SmWebmailLabel.addClass("disabled")}}),i.USModalSMServiceSelectorView}),define("pdmplugins/unified-share/js/modalView/templates/us-modal-sm-webmail-profile-selector-template",[],function(){return'<div class = "ui-theme theme-text webmail-advisory" ><%= WEBMAIL_ADVISORY %></div><div class = "custom-select"><select class = " ui-theme theme-text theme-container theme-border webmail-profile-select"></select></div>'}),define("pdmplugins/unified-share/js/modalView/views/us-modal-sm-webmail-profile-selector",["core/ac-core","pdmplugins/unified-share/js/ac-unified-share","pdmplugins/unified-share/js/modalView/templates/us-modal-sm-webmail-profile-selector-template","i18n!pdmplugins/unified-share/js/nls/ui-strings"],function(e,i,t,s){return i.USModalSMProfileSelector=e.View.extend({events:{"change .webmail-profile-select":"_onProfileSelect"},initialize:function(){e.View.prototype.initialize.call(this)},render:function(){this.$el;e.View.prototype.render.call(this),this._template=_.template(t),0===this.$el.children().length&&(this.$el.html(this._template({WEBMAIL_ADVISORY:s.WEBMAIL_ADVISORY})),this._initWrappers()),this._addUiModelEventListeners(),this._updateProfilesListUI(),this.updateSelectedProfileInUI()},_initWrappers:function(){this.$WebmailProfileSelect=this.$(".webmail-profile-select")},_addUiModelEventListeners:function(){var e=this.options.SendMailUiModel;e.on("change:email_addresses",this._updateProfilesListUI),e.on("change:selected_profile",this.updateCssOnProfileSelected)},updateCssOnProfileSelected:function(){var e=this.options.SendMailUiModel.get("selected_profile");""===e||e===s.SELECT_OPTION?this.$WebmailProfileSelect.css("font-style","italic"):this.$WebmailProfileSelect.css("font-style","normal")},_updateProfilesListUI:function(){var e=this.options.SendMailUiModel,i=_.clone(e.get("email_addresses")),t=Object.getOwnPropertyNames(i);t.reverse(),this.resetProfilesListUiToDefault();for(var s=0;s<t.length;s++)this.$WebmailProfileSelect.children("option").eq(1).before($("<option></option>").val(t[s]).text(t[s]));this.$WebmailProfileSelect.children("option").addClass("ui-theme theme-text profile-option"),this.$WebmailProfileSelect.children("option").first().hide()},_onProfileSelect:function(){var e=this.$WebmailProfileSelect.find("option:selected").text();this.options.SendMailUiModel.set("selected_profile",e)},resetProfilesListUiToDefault:function(){this.$WebmailProfileSelect.empty(),this.$WebmailProfileSelect.append($("<option></option>").val(s.SELECT_OPTION).text(s.SELECT_OPTION)),this.$WebmailProfileSelect.append($("<option></option>").val(s.ADD_GMAIL).text(s.ADD_GMAIL)),this.$WebmailProfileSelect.children("option").addClass("ui-theme theme-text profile-option"),this.$WebmailProfileSelect.children("option").first().hide()},updateSelectedProfileInUI:function(){var e=this.options.SendMailUiModel.get("selected_profile");this.$WebmailProfileSelect.val(""===e?s.SELECT_OPTION:e)}}),i.USModalSMProfileSelector}),define("pdmplugins/unified-share/js/modalView/views/us-modal-send-mail-tab-view",["core/ac-core","files/ac-files","pdmplugins/unified-share/js/ac-unified-share","pdmplugins/unified-share/js/modalView/templates/us-modal-send-mail-tab-template","i18n!pdmplugins/unified-share/js/nls/ui-strings","pdmplugins/unified-share/js/utils/sc-constants","pdmplugins/unified-share/js/modalView/views/us-modal-sm-service-selector-view","pdmplugins/unified-share/js/modalView/views/us-modal-sm-webmail-profile-selector","pdmplugins/unified-share/js/models/ui/send-mail-ui-model"],function(e,i,t,s,n,o){return t.UsModalSendMailTabView=e.View.extend({events:{"click .sm-button":"_onContinueClick","click .sm_switch_tab_link":"_onTryNowClick","click #sm-close-dialog":"_closeDialogNow","click #pref_launcher":"_launchPreferenceDialog","click #modal-remember-choice-checkbox":"_onRemeberChoiceClick","click #reduce-upsell-link":"_launchOptimizeApp","click .us-reduce-size-image-container":"_launchOptimizeApp","keydown #reduce-upsell-link":"_onKeyDown","keydown #sm_switch_tab_link":"_onKeyDown"},initialize:function(){e.View.prototype.initialize.call(this),this._template=_.template(s),this.options.SendMailUiModel=new t.SendMailUiModel,this.upselloptimize=this.options.sendFilesUiModel.attributes.SingleFileSize},render:function(){this.$el;e.View.prototype.render.call(this),this._template=_.template(s);var i=n.SEND_MAIL_DESC_HEADER;if(e.Util.isReader()&&(i=n.SEND_MAIL_DESC_HEADER_READER),0===this.$el.children().length){var t=_.template(n.REDUCE_UPSELL_MESSAGE,{SIZE:this.upselloptimize});this.$el.html(this._template({SM_CONTINUE:n.SHARE_BUTTON,SEND_MAIL_DESC_HEADER:i,SEND_LINK_AS_ATTACHMENT:n.SEND_LINK_AS_ATTACHMENT,SEND_LARGE_FILE_AS_ATTACHMENT:n.SEND_LARGE_FILE_AS_ATTACHMENT,SEND_MAIL_REVIEWERS_CMNT:n.SEND_MAIL_REVIEWERS_CMNT,TRY_NOW:n.SEND_MAIL_TRY_NOW,REMEMBER_CHOICE:n.REMEMBER_CHOICE,PREFERENCES:n.PREFERENCES,EMAIL_OPENED:n.EMAIL_OPENED,CLOSE:n.SHARE_SUCCESS_CLOSE,UPSELL_MSG:t,REDUCE_UPSELL_LINK_TEXT:n.REDUCE_UPSELL_LINK_TEXT})),this._initWrappers()}this._getDefaultEmailClient(),this._addUiModelEventListeners(),this._renderChildViews(),this.toggleProfileSelectorVisibility(),this.toggleProceedButton(),this.fetchAllProfiles(!1),this.getLastUsedChoices(),this._addKeyEventListener(),this._updatePromoBoxContainerVisibility()},teardown:function(){this.setLastUsedchoices()},_initWrappers:function(){this.$smModeSelector=this.$(".sm-mode-selector"),this.$smButton=this.$(".sm-button"),this.$smProfileSelector=this.$(".sm-profile-selector"),this.$shareTab=$("#share-tab"),this.$rememberChoice=$("#modal-remember-choice-checkbox"),this.$smMailSentDesc=this.$("#sm-mail-sent-desc"),this.$smMainContainer=this.$("#sm_no_default_state"),this.$smDefaultSetContainer=this.$("#sm-default-state"),this.$smLastUsedChoiceUpdated=!1,this.$smMailSent=!1},_addUiModelEventListeners:function(){var e=this.options.SendMailUiModel;e.on("change:send_mail_mode",this._onSendMailModeChange),e.on("change:selected_profile",this._onProfileSelected),this.options.sendFilesUiModel.on("change:US_tab_open",this._onUsTabChanged)},_onUsTabChanged:function(){if("attachToEmail"===this.options.sendFilesUiModel.get("US_tab_open")&&this.$smLastUsedChoiceUpdated&&this.options.SendMailUiModel.get("default_mail_set")===!0&&0==this.$smMailSent){var e=this.options.sendFilesUiModel.get("ShareVariant"),i=o.USE,t="Send Mail Remember Choice in checked state";this.options.appApi.siteCatalystApi.logScEvent([e,i,t]),this._sendMailDefault()}},_renderChildViews:function(){this._renderChildView("_smModeSelector",t.USModalSMServiceSelectorView,this.$smModeSelector),this._renderChildView("_smProfileSelector",t.USModalSMProfileSelector,this.$smProfileSelector)},_getDefaultEmailClient:function(){this.options.appApi.rnaApi.then(_.bind(function(e){e.stApi.getDefaultEmailClient().then(_.bind(function(e){this.options.SendMailUiModel.set("default_email_client",this._getEmailClientName(e)),this._setEmailClientName(),this._smModeSelector&&this._smModeSelector.render()},this),_.bind(function(){return $.Deferred().reject().promise()},this))},this),_.bind(function(){return $.Deferred().reject().promise()},this))},_onSendMailModeChange:function(){this.toggleProfileSelectorVisibility(),this.toggleProceedButton()},_updatePromoBoxContainerVisibility:function(){this.upselloptimize?($(".us-sm-desc-content-default-no").addClass("hide"),$(".us-reduce-upsell").removeClass("hide")):this.options.sendFilesUiModel.get("isSnTenabled")||$(".us-sm-desc").hide()},_launchOptimizeApp:function(){this.options.appApi.rnaApi.done(_.bind(function(e){var i={methodName:"unifiedShareOptimizeUpsell",methodArgs:""};e.stApi.invokeMethod(i)},this))},_onProfileSelected:function(){this.toggleProceedButton();var e=this.options.SendMailUiModel,i=e.get("selected_profile");i===n.ADD_OTHER?(console.log("configure email"),this._configureProfile(o.BASICMAIL)):i===n.ADD_GMAIL&&(console.log("configure GMAIL"),this._configureProfile(o.GMAIL))},toggleProfileSelectorVisibility:function(){var e=this.options.SendMailUiModel,i=e.get("send_mail_mode");"sm_default_mail"===i?this.$smProfileSelector.hide():"sm_webmail"===i&&this.$smProfileSelector.show()},toggleProceedButton:function(){var e=this.options.SendMailUiModel,i=e.get("send_mail_mode"),t=e.get("selected_profile");"sm_default_mail"===i||t!==n.SELECT_OPTION&&""!==t&&t!==n.ADD_OTHER&&t!==n.ADD_GMAIL&&t!==n.ADD_YAHOO?this.$smButton.removeClass("disabled").removeAttr("disabled"):this.$smButton.addClass("disabled").attr("disabled","disabled")},_onTryNowClick:function(e){e&&this.$shareTab.focus(),this.$shareTab.click()},_onRemeberChoiceClick:function(){var e=this.options.sendFilesUiModel.get("ShareVariant"),i=o.USE,t="Send Mail Remember Choice Clicked";this.options.appApi.siteCatalystApi.logScEvent([e,i,t])},_onContinueClick:function(){var e=this.options.SendMailUiModel,i=e.get("send_mail_mode"),t=e.get("selected_profile"),s=e.get("email_addresses")[t],n=this.options.sendFilesUiModel.get("ShareVariant"),a=o.USE,l="Send Mail Remember Choice in unchecked state";this.options.appApi.siteCatalystApi.logScEvent([n,a,l]),this._sendMailFinal(i,t,s)},_sendMailFinal:function(e,i,t){if("sm_default_mail"===e){var s=this.options.sendFilesUiModel.get("ShareVariant"),a=o.USE,l="default email attachment";this.options.appApi.siteCatalystApi.logScEvent([s,a,l]),this._sendMail(!1,"none")}else{if(i===n.SELECT_OPTION||""===i||i===n.ADD_OTHER||i===n.ADD_GMAIL||i===n.ADD_YAHOO)return;var s=this.options.sendFilesUiModel.get("ShareVariant"),a=o.USE,l="webmail attachment";this.options.appApi.siteCatalystApi.logScEvent([s,a,l]),this._sendMail(!0,t)}},_sendMail:function(e,i){if(this.$smMailSent=!0,this.options.sendFilesUiModel.isMultipleFilesSelected()||"contentPlusRHP"===this.options.sendFilesUiModel.get("layout")){var t=[],s={},n=this.options.sendFilesUiModel.get("local_file_objects"),o=this.options.sendFilesUiModel.get("metadata_collection"),a=this.options.sendFilesUiModel.get("connector_file_objects"),l=a.length+o.length;_.each(n,_.bind(function(e){e.get("assetId")?(t.push(e.get("assetId")),++l):t.push(e._proxy)},this)),_.each(o.models,_.bind(function(e){t.push(e.get("id"))},this)),s.selectedFileIds=t,s.useWebmailObj=e,s.profileObj=i,s.filesToDownloadLengthObj=l,this.options.appApi.rnaApi.then(_.bind(function(e){this.setLastUsedchoices(),e.stApi.attachToEmail(s).then(_.bind(function(){this.switchUI()},this),_.bind(function(){return $.Deferred().reject().promise()},this))},this),_.bind(function(){return $.Deferred().reject().promise()},this))}else this.options.appApi.rnaApi.then(_.bind(function(t){var s={useWebmail:e,profile:i};this.setLastUsedchoices(),t.stApi.sendMailWithoutFLD(s).then(_.bind(function(){this.switchUI()},this),_.bind(function(){return $.Deferred().reject().promise()},this))},this),_.bind(function(){return $.Deferred().reject().promise()},this))},switchUI:function(){this.options.SendMailUiModel.get("default_mail_set")===!0?(this.$smMainContainer.hide(),this.$smDefaultSetContainer.show()):this._closeDialogNow()},fetchAllProfiles:function(e){this.options.appApi.rnaApi.then(_.bind(function(i){i.stApi.getAllWebmailProfiles().then(_.bind(function(i){e&&this._updateSelectedProfile(i,!0),this._updateProfilesInUiModel(i),this._smProfileSelector.updateSelectedProfileInUI()},this),_.bind(function(){return $.Deferred().reject().promise()},this))},this),_.bind(function(){return $.Deferred().reject().promise()},this))},_configureProfile:function(e){this.options.appApi.rnaApi.then(_.bind(function(i){i.stApi.configureProfile(e).then(_.bind(function(){this.fetchAllProfiles(!0)},this),_.bind(function(e){return this._updateSelectedProfile(e,!1),this._smProfileSelector.updateSelectedProfileInUI(),$.Deferred().reject().promise()},this))},this),_.bind(function(){return $.Deferred().reject().promise()},this))},_updateProfilesInUiModel:function(e){for(var i={},t=Object.getOwnPropertyNames(e),s=0;s<t.length;s++){var n=e[t[s]],o=n.EmailAddress;i[o]=t[s]}Object.keys(i).length>0&&this.options.SendMailUiModel.set("email_addresses",i)},_updateSelectedProfile:function(e,i){var t,s=Object.getOwnPropertyNames(e),n=this.options.SendMailUiModel.get("email_addresses");if(i)for(var o=0;o<s.length;o++){var a=e[s[o]],l=a.EmailAddress;if(!n[l]){t=l,this.options.SendMailUiModel.set("selected_profile",t);break}}else this.options.SendMailUiModel.set("selected_profile","")},_getEmailClientName:function(e){switch(e){case 0:return n.EMAIL_CLIENT_OTHER;case 1:return n.EMAIL_CLIENT_EUDORA;case 2:return n.EMAIL_CLIENT_LOTUS_NOTES;case 3:return n.EMAIL_CLIENT_NETSCAPE;case 4:return n.EMAIL_CLIENT_OUTLOOK;case 5:return n.EMAIL_CLIENT_OUTLOOK_EXPRESS;case 6:return n.EMAIL_CLIENT_ENTOURAGE;case 7:return n.EMAIL_CLIENT_MAIL;case 8:return n.UNKNOWN;default:return n.UNKNOWN}},setLastUsedchoices:function(){if(this.$rememberChoice.is(":checked")){var e=this.options.SendMailUiModel,i=e.get("selected_profile"),t=!0,s=!0,o="sm_webmail"===e.get("send_mail_mode");e.set("default_mail_set",!0),(""!==i||i!==n.SELECT_OPTION)&&(i=e.get("email_addresses")[i]),void 0===i&&(i=""),this.options.appApi.rnaApi.then(_.bind(function(e){e.stApi.setLastUsedPreferences([t,o,i,s])},this))}else this.options.appApi.rnaApi.then(_.bind(function(e){e.stApi.setLastUsedPreferences([!1,!1,"",this.options.SendMailUiModel.get("default_mail_set")])},this))},getLastUsedChoices:function(){this.options.appApi.rnaApi.then(_.bind(function(e){e.stApi.getLastUsedPreferences().then(_.bind(function(e){this.updateLastUsedChoices(e),this._smProfileSelector.updateSelectedProfileInUI()},this),_.bind(function(){return $.Deferred().reject().promise()},this))},this),_.bind(function(){return $.Deferred().reject().promise()},this))},updateLastUsedChoices:function(e){this.$smLastUsedChoiceUpdated=!0;var i,t,s,n,o,a,l=this.options.SendMailUiModel;e&&(i=e.didLastUsedWebmail,o=e.defaultSet,t=e.useWebmail,a=e.webmailDisabled,l.set("default_mail_set",o),a&&(l.set("send_mail_mode","sm_default_mail"),this._hideOrDisableWebmailUI(),t=!1),o?(this.$smMainContainer.hide(),this.$smDefaultSetContainer.show(),t?(l.set("send_mail_mode","sm_webmail"),s=e.selectedProfile,n=this._convertEncodedToSimpleProfile(s),l.set("selected_profile",n)):l.set("send_mail_mode","sm_default_mail"),this.$rememberChoice.prop("checked",!0),"attachToEmail"===this.options.sendFilesUiModel.get("US_tab_open")&&this.$smMailSent===!1&&this._sendMailDefault()):(this.$smDefaultSetContainer.hide(),this.$smMainContainer.show()))},_getEmailForSelectedProfile:function(e){var i=this.options.SendMailUiModel.get("email_addresses");for(var t in i)if(t===e)return i[t];return""},_sendMailDefault:function(){var e=this.options.SendMailUiModel,i=e.get("send_mail_mode"),t=e.get("selected_profile"),s=this._getEmailForSelectedProfile(t);this._sendMailFinal(i,t,s)},_hideOrDisableWebmailUI:function(){this._smModeSelector._hideDisableWebmailUI()},_convertEncodedToSimpleProfile:function(e){for(var i=this.options.SendMailUiModel,t=i.get("email_addresses"),s=Object.getOwnPropertyNames(t),n=0;n<s.length;n++)if(t[s[n]]===e)return s[n];return""},_addKeyEventListener:function(){this.options.appApi.keyApi.pushKeyHandler(this)},_onKeyDown:function(e){var i=e.which,t=e.currentTarget;return"sm_switch_tab_link"===t.id&&13==i?this._onTryNowClick(!0):"reduce-upsell-link"===t.id&&13==i?this._launchOptimizeApp():void 0},_setEmailClientName:function(){var e=n.US_EMAIL_OPENED_MESSAGE,i=n.EMAIL_CLIENT_MAIL;"sm_default_mail"===this.options.SendMailUiModel.get("send_mail_mode")&&(i=this.options.SendMailUiModel.get("default_email_client")),e=e.replace('"<%=EMAIL_CLIENT_NAME%>"',i),this.$smMailSentDesc.text(e)},_closeDialogNow:function(){var e=new t.CloseAppOp(this.options);e.run()},_launchPreferenceDialog:function(){this.options.appApi.rnaApi.done(function(e){e.stApi.invokeMethod({methodName:"launchEmailPref",methodArgs:""})})}}),t.UsModalSendMailTabView}),define("pdmplugins/unified-share/js/modalView/templates/us-modal-send-signature-tab-template",[],function(){return'<div id="modal-sfs-heading" class="ui-theme theme-text"><%= SFS_MESSAGE_HEADING %></div><div id="modal-sfs-summary" class="modal-tab-summary ui-theme theme-text"><div id="modal-sfs-summary-text" class="ui-theme theme-header-text"><%= SFS_MESSAGE_TEXT %><span id="modal-sfs-summary-learn-more" aria-label="<%= LEARN_MORE %>" class="modal-learn-more ui-theme theme-text theme-share-add-files" tabindex= "0"> <%= LEARN_MORE %></span></div></div><div class="modal-sfs-icons-wrapper ui-theme theme-text"><div class="us-sfs-workflow-div"><div class="us-sfs-sendafile-img"></div><div class="modal-sfs-sendafile-text ui-theme theme-header-text"><%= SFS_ICON_SENDFILE %></div></div><div class="us-sfs-arrow-img"></div><div class="us-sfs-workflow-div"><div class="us-sfs-recipients-img"></div><div class="modal-sfs-recipients-text ui-theme theme-header-text"><%= SFS_ICON_RECIPIENTS %></div></div><div class="us-sfs-arrow-img"></div><div class="us-sfs-workflow-div"><div class="us-sfs-getnotified-img"></div><div class="modal-sfs-getnotified-text ui-theme theme-header-text"><%= SFS_ICON_GETNOTIFIED %></div></div></div><div id="modal-sfs-file-message" class="modal-tab-file-message"><div id="modal-sfs-file-message-text" class="ui-theme theme--text"><%= SFS_MESSAGE_TEXT_MULTIPLEFILE %></div></div><div id="modal-sfs-legal" class="modal-sfs-legal-txt ui-theme theme-header-text"><%= GET_LEGAL_TEXT %></div><div id="modal-sfs-button-bar-id" class="modal-sfs-button-bar ui-theme theme-share-modal-container"><div class="us-sfs-poweredby-img"></div><button class="modal-sfs-submit-button control-button theme-button theme-button-label" aria-label = "<%= SFS_ADD_SIGNERS_BUTTON %>" aria-describedby="modal-add-signatures-button" id="modal-add-signatures"><%= SFS_ADD_SIGNERS_BUTTON %></button></div>'}),define("pdmplugins/unified-share/js/modalView/views/us-modal-send-signature-tab-view",["core/ac-core","files/ac-files","pdmplugins/unified-share/js/ac-unified-share","pdmplugins/unified-share/js/modalView/templates/us-modal-send-signature-tab-template","i18n!pdmplugins/unified-share/js/nls/ui-strings","pdmplugins/unified-share/js/utils/sc-constants"],function(e,i,t,s,n,o){return t.UsModalSignTabView=e.View.extend({events:{"click #modal-add-signatures":"_onContinueClick","click #modal-sfs-summary-learn-more":"_launchSFSLearnMore"},initialize:function(){e.View.prototype.initialize.call(this),this._template=_.template(s)},render:function(){e.View.prototype.render.call(this),0===this.$el.children().length&&(this.$el.html(this._template({SFS_MESSAGE_HEADING:n.SFS_MESSAGE_HEADING,SFS_MESSAGE_TEXT:n.SFS_MESSAGE_TEXT,LEARN_MORE:n.LEARN_MORE,SFS_ICON_SENDFILE:n.SFS_ICON_SENDFILE,SFS_ICON_RECIPIENTS:n.SFS_ICON_RECIPIENTS,SFS_ICON_GETNOTIFIED:n.SFS_ICON_GETNOTIFIED,SFS_ADD_SIGNERS_BUTTON:n.US_SHARE_SFS_CTA,SFS_MESSAGE_TEXT_MULTIPLEFILE:n.SFS_MESSAGE_TEXT_MULTIPLEFILE,GET_LEGAL_TEXT:n.US_SFS_TRIAL_CONDITION})),this._initWrappers()),this._renderChildViews(),this._addUiModelEventListeners(),this._UpdateTrialView(),this._UpdateSignButtonBarWidth(),this._addKeyEventListener()},_initWrappers:function(){this.$ModalAddSignature=this.$("#modal-add-signatures"),this.$ModalMoreFileMassage=this.$("#modal-sfs-file-message"),this.$ModalGetSignHeading=this.$("#modal-sfs-heading"),this.$ModalGetSignSummary=this.$("#modal-sfs-summary-text"),this.$ModalGetSignLegalText=this.$("#modal-sfs-legal"),this.$usModalExpansionView=$("#us-modal-expansion-view"),this.$modalSFSButtonBar=this.$("#modal-sfs-button-bar-id")},_UpdateTrialView:function(){this.options.appApi.rnaApi.done(_.bind(function(i){if(e.Util.isReader()&&!i.isSignedInReader()&&i.esApi.isTrialFeatureEnabled()){var t=i.esApi.getTotalTrialTransactionsForFreeUser();console.log("total_free_transaction::"+t);var s=_.template(n.US_SFS_TRIAL_BODY,{count:t});this.$ModalGetSignHeading.html(n.US_SFS_TRIAL_TITLE),this.$ModalGetSignSummary.html(s),this.$ModalGetSignLegalText.show()}else this.$ModalGetSignLegalText.hide()},this))},_UpdateSignButtonBarWidth:function(){var e=this.$usModalExpansionView.width();this.$modalSFSButtonBar.css("width",e+"px")},_addUiModelEventListeners:function(){var e=this.options.sendFilesUiModel;e.on("change:US_tab_open",this._onTabChange)},_renderChildViews:function(){this.$ModalMoreFileMassage.hide(),this.$ModalGetSignLegalText.hide()},_onTabChange:function(){this._onFilesChange()},_onFilesChange:function(){var e=this.options.sendFilesUiModel,i=e.get("US_tab_open");if("sendForSignature"===i){var e=this.options.sendFilesUiModel,t=(n.ADD_MORE_FILES,e.get("local_file_objects").length+e.get("metadata_collection").length);t>1&&this.$ModalMoreFileMassage.show()}else this.$ModalMoreFileMassage.hide()},_onContinueClick:function(){this._launchSFS()},_launchSFS:function(){this.options.appApi.rnaApi.done(_.bind(function(i){var t={methodName:"unifiedShareLaunchSFS",methodArgs:""},s=i.esApi.isAdobeSignToolShown(),n=(s?o.SIGN_TOOL_SHOWN:o.SIGN_TOOL_NOT_SHOWN)+"-"+o.GET_SIG;this.options.appApi.siteCatalystApi.logScEvent([n,o.GET_STARTED_CLICKED]),e.Util.isReader()&&!i.isSignedInReader()&&i.esApi.isTrialFeatureEnabled()?this.options.appApi.sessionApi.ensureSignedIn().then(_.bind(function(){this.options.appApi.siteCatalystApi.logScEvent([n,o.SIGNED_IN]),i.stApi.invokeMethod(t)},this)):i.stApi.invokeMethod(t)},this))},_launchSFSLearnMore:function(){this.options.appApi.rnaApi.done(_.bind(function(e){e.openDecoratedUrl(n.SFS_LEARNMORE_GOURL)},this))},_addKeyEventListener:function(){this.options.appApi.keyApi.pushKeyHandler(this)},_onKeyDown:function(e){var i=!1,t=e.which;return $("#modal-sfs-summary-learn-more").is(":focus")&&13==t&&(this._launchSFSLearnMore(),i=!0),i}}),t.UsModalSignTabView}),define("pdmplugins/unified-share/js/modalView/views/us-modal-expansion-view",["core/ac-core","files/ac-files","pdmplugins/unified-share/js/ac-unified-share","pdmplugins/unified-share/js/modalView/templates/us-modal-expansion-view-template","i18n!pdmplugins/unified-share/js/nls/ui-strings","pdmplugins/unified-share/js/modalView/views/us-modal-share-tab-view","pdmplugins/unified-share/js/modalView/views/us-modal-create-link-tab-view","pdmplugins/unified-share/js/modalView/views/us-modal-send-mail-tab-view","pdmplugins/unified-share/js/modalView/views/us-modal-send-signature-tab-view"],function(e,i,t,s){return t.UsModalExpansionView=e.View.extend({initialize:function(){e.View.prototype.initialize.call(this),this._template=_.template(s)},render:function(){e.View.prototype.render.call(this),0===this.$el.children().length&&(this.$el.html(this._template()),this._initWrappers()),this._renderChildViews(),this._addUiModelEventListeners(),this._onUsTabChanged()},_initWrappers:function(){this.$getLinkView=this.$("#get-link-view"),this.$shareView=this.$("#share-view"),this.$signView=this.$("#sign-view"),this.$sendAttachmentView=this.$("#send-attachment-view")},_addUiModelEventListeners:function(){var e=this.options.sendFilesUiModel;e.on("change:US_tab_open",this._onUsTabChanged)},_renderChildViews:function(){this._renderChildView("_usModalCreateLink",t.UsModalCreateLinkTabView,this.$getLinkView),this._renderChildView("_usModalShare",t.UsModalShareTabView,this.$shareView),this._renderChildView("_usModalAttachToEmail",t.UsModalSendMailTabView,this.$sendAttachmentView),this._renderChildView("_usModalSendForSign",t.UsModalSignTabView,this.$signView)},_onUsTabChanged:function(){var e=this.options.sendFilesUiModel.get("US_tab_open");this.$getLinkView.hide(),this.$shareView.hide(),this.$signView.hide(),this.$sendAttachmentView.hide(),"createLink"===e?this.$getLinkView.show():"share"===e?this.$shareView.show():"attachToEmail"===e?this.$sendAttachmentView.show():"sendForSignature"===e&&this.$signView.show()}}),t.UsModalExpansionView}),define("pdmplugins/unified-share/js/modalView/templates/us-modal-file-list-template",[],function(){return'<div><span class = "us-modal-file-list-arrow ui-theme theme-share-container theme-share-border"></span><span class = "us-modal-file-list-arrow-before ui-theme theme-share-container theme-share-border"></span><div class="us-modal-file-list-frame ui-theme theme-share-container theme-share-border"><div class= modal-file-list-heading-row><span class = "modal-file-list-heading ui-theme theme-text"><%= SELECTED_FILES %></span><button class= "modal-view-add-file ui-theme theme-share-add-files theme-share-container"aria-label ="<%= ADD_MORE_FILES %>" title="<%= ADD_MORE_FILES %>"><%= ADD_MORE_FILES %></button></div><ul class="us-share-files-list us-modal-files-list ui-theme theme-share-container" role="grid"></ul></div></div>'}),define("pdmplugins/unified-share/js/modalView/templates/us-modal-file-list-item-template",[],function(){return'<li class="us-share-file-list-item  ui-theme" title="<%= name %>" role="row">        <div class="us-share-file-list-name theme-text"              id="us-share-file-list-name-<%= asset_id %>" tabindex="-1">            <%= name %></div>        <button class="us-share-file-list-close us-modal-file-list-close core-remove-x"                data-asset-id="<%= asset_id %>"                data-list-index="<%= list_index %>"                title="<%= remove %>" tabindex="0"                aria-label="<%= ariaRemoveLabel %>"></button></li>'}),define("pdmplugins/unified-share/js/modalView/views/us-modal-file-list-view",["core/ac-core","files/ac-files","pdmplugins/unified-share/js/ac-unified-share","pdmplugins/unified-share/js/modalView/templates/us-modal-file-list-template","pdmplugins/unified-share/js/modalView/templates/us-modal-file-list-item-template","i18n!pdmplugins/unified-share/js/nls/ui-strings","pdmplugins/unified-share/js/utils/sc-constants","core/utils/file-types","core/utils/truncate","core/utils/crypto-util","acplugins/my-recent-files/js/ac-my-recent-files","acplugins/my-recent-files/js/ops/op-factory","acplugins/my-recent-files/js/models/recent-local-item-model","core/views/plugin-content-view","pdmplugins/unified-share/js/ops/desktop-add-files-op","pdmplugins/unified-share/js/ops/close-app-op","pdmplugins/unified-share/js/ops/us-fetch-tool-center-selected-files"],function(e,i,t,s,n,o,a,l,r,d,p){return t.USModalFileListView=e.View.extend({events:{"click .modal-view-add-file":"_onAddFileClick","click .us-share-file-list-close":"_onRemoveAssetClick"},initialize:function(){e.View.prototype.initialize.call(this),_.bind(this.render,this),this._template=_.template(s),this._itemTemplate=_.template(n),this._initView()},render:function(){this.$el,this.options.sendFilesUiModel;e.View.prototype.render.call(this),0===this.$el.children().length&&(this.$el.append(this._template({SELECTED_FILES:o.USM_SELECTED_FILES,ADD_MORE_FILES:o.ADD_MORE_FILES,SHARE_NO_FILES_SELECTED:o.SHARE_NO_FILES_SELECTED,SHARE_CLICK_TO_ADD_FILES:o.SHARE_CLICK_TO_ADD_FILES})),this._initWrappers(),this._fetchDocument()),e.Util.isCEF()&&this.$(".share-modal-tool-frame").addClass("unselectable"),this._renderChildViews()},_initView:function(){this._addUiModelEventListeners();var e=this.options.sendFilesUiModel.get("ShareVariant"),i=a.DISCOVER,t="Open Share Panel";this.options.appApi.siteCatalystApi.logScEvent([e,i,t])},_fetchDocument:function(){console.log("inside fetch document");var i,t,s,n=this.options;return this._uiModel=n.sendFilesUiModel,i=this._startPlugin(),e.Util.isCEF()?(this._activeView=void 0,this.options.readRegistry=!0,t=this._fetchActiveDocument(),this._uiModel.set("fetchDocPromise",t),console.log("Setting fetchDocPromise to"+this._uiModel.get("fetchDocPromise"))):(this._activeView=this._uiModel.get("active_view"),t=$.Deferred().resolve().promise()),t.then(_.bind(function(){return s=this._activeView,i.then(_.bind(function(){var i=e.Features.getFeature("enable_sender_survey"),t=this._uiModel.get("limits_model"),s=t.get("can_custom_brand"),n=this.options.brandingModel.get("enabled"),o=!1,a=this.options.appApi.usersMeApi.getUserCohorts();a&&"enabled"===a["ts-sender-survey"]&&(o=!0),e.Util.isCEF()&&(n=!1),this._uiModel.set({active:!0,user_action_id:d.getRandomString(),user_action_name:"Share:ShareButton",customize_recipient_page:n,customize_recipient_page_enabled:s,enable_sender_survey:i&&o})},this))},this))},_fetchActiveDocument:function(){console.log("fetch active document");var i,s,n,o,a,l,r,d,h,c,u=(t.selector.routerArgs,$.Deferred()),m=this.options.recentFolderModel;return this.options.appApi.rnaApi.then(_.bind(function(E){if(i=E.stApi.getSendTrackAppLauncherWithParcel(),d=E.stApi.getSendTrackAppLauncherWithAssets(),h=E.stApi.getSendTrackAppLauncherWithModels(),d)this.options.appApi.displayApi.showSpinner(!0),r=JSON.parse(d),l=$.map(r,function(e){return e}),this._activeView="workflow",this.options.appApi.sessionApi.ensureSignedIn().then(_.bind(function(){t.opFactory.create("DesktopGettingSubscriptionLevels",this.options).run().always(_.bind(function(){this._uiModel.addFilesToCollection(l),this.options.appApi.displayApi.showSpinner(!1),u.resolve().promise()},this))
},this),_.bind(function(){this.options.appApi.displayApi.showSpinner(!1)},this));else if(h)this.options.appApi.displayApi.showSpinner(!0),this._activeView="workflow",h.length>0&&(_.each(h,function(i){c=new e.LocalItemModel(void 0,{_proxy:i._proxy}),b.push(c)}),this._uiModel.addFileObjects(b),u.resolve().promise()),this.options.appApi.displayApi.showSpinner(!1);else if(i)this.options.appApi.displayApi.showSpinner(!0),this._activeView="workflow",this.options.appApi.sessionApi.ensureSignedIn().then(_.bind(function(){s=this.options.appApi.baseFilesUrisApi.getSendApiUri(),s=tsUtils.extractRootUrl(s),this.options.rootUrl=s,this.options.appApi.displayApi.showSpinner(!1),this._gettingAuthenticatedModelsPromise.then(_.bind(function(){o=this.options.rootUrl,a=new t.AddParcelOp({uiModel:this._uiModel,parcelId:i,rootUrl:o}),t.opFactory.create("DesktopGettingSubscriptionLevels",this.options).run().always(_.bind(function(){a.run()},this)),u.resolve().promise()},this))},this),_.bind(function(){this.options.appApi.displayApi.showSpinner(!1)},this));else if(console.log(" launching app :  "+this._uiModel.get("launchpad")),"shareButton"===this._uiModel.get("launchpad")||"HomeRecent"===this._uiModel.get("launchpad")&&"onlyRHP"===this._uiModel.get("layout"))n=E.getOpenedFile(),_.isEmpty(n)?(this._activeView="welcome",u.resolve().promise()):(this._activeView="workflow",this.options.appApi.rnaApi.done(_.bind(function(e){n.invoke("determineFileSource").then(_.bind(function(e){if("root"===e||"unsupported"===e||"local"===e||"desktop_sharepoint"===e||"native"===e||"native_v2"===e)console.log("add file objects"),this._uiModel.addFileObjects(n);else if("box"===e||"dropbox"===e||"onedrive"===e||"onedrivebusiness"===e||"googleDrive"===e)this._uiModel.addFileObjects(n),this._uiModel.addConnectorFileObjects(n);else if("ccloud"==e)this._uiModel.addFileObjects(n),this._uiModel.addCCloudFileObjects(n);else{var i,s=[];i=new t.DisallowedFileModel({name:n.get("name"),source:e,reason:"non-native"}),s.push(i),this._uiModel.set("disallowed_files",s,{silent:!1})}},this),_.bind(function(){this._uiModel.addFileObjects(n)},this)),this.options.sendFilesUiModel.set("openedFileAssetId",n.get("assetId")),this._isDirty(n,e).then(_.bind(function(){this.options.sendFilesUiModel.set("bHFileIsDirty",!1),u.resolve().promise()},this),_.bind(function(){this.options.sendFilesUiModel.set("bHFileIsDirty",!0),u.resolve().promise()},this)),n.on("change:name",_.bind(function(e,i){var t=i;this.options.sendFilesUiModel.updateOpenedFile(e),this.options.sendFilesUiModel.get("is_subject_user_input")||this._setOpenedDocNameAsSubject(t,!0)},this))},this)));else if("HomeRecent"===this._uiModel.get("launchpad")&&"contentPlusRHP"===this._uiModel.get("layout")){var g,S=E.stApi.getSelectedFileIndicesAPI();S&&(g=S.split(",").map(Number));var f=(new p.OpFactory).create("FetchingRNARecentFileList",_.extend(this.options,{folderModel:m}));f.run().then(_.bind(function(){for(var e,i=0;i<g.length;i++)e=this.options.folderModel.get("items").models[g[i]-1],this._uiModel.addFileObjects(e),e.invoke("determineFileSource").then(_.bind(function(i){"box"===i||"dropbox"===i||"onedrive"===i||"onedrivebusiness"===i||"googleDrive"===i?this._uiModel.addConnectorFileObjects(e):"ccloud"===i&&this._uiModel.addCCloudFileObjects(e)},this)),u.resolve().promise()},this))}else if("HomeDC"===this._uiModel.get("launchpad")){var A=this._uiModel;this.options.appApi.rnaApi.done(_.bind(function(e){e.stApi.readUnifiedShareLaunchingInfoAPI().then(_.bind(function(e){for(var i=0;i<e.length;i++){var s=new t.FileMetadataModel({assetId:e[i].id,global:!1,name:e[i].name,ext:"pdf"});A.addFileObjects(s)}u.resolve().promise()},this),_.bind(function(){return $.Deferred().reject().promise()},this))},this))}else if("HomeConnector"===this._uiModel.get("launchpad")){var v,R,b=[];this.options.appApi.rnaApi.done(_.bind(function(i){v=i.stApi.UnifiedShareLauncherSelectedProxyIds(),v.length>0&&(_.each(v.models,_.bind(function(i){R=new e.LocalItemModel(void 0,{_proxy:i._proxy}),b.push(R),R.invoke("determineFileSource").then(_.bind(function(e){("box"===e||"dropbox"===e||"onedrive"===e||"onedrivebusiness"===e||"googleDrive"===e)&&this._uiModel.addConnectorFileObjects(R)},this))},this)),this._uiModel.addFileObjects(b),u.resolve().promise())},this))}else if("toolCentre"===this._uiModel.get("launchpad")){var I=new t.FetchToolCentreSelectedFiles(this.options);I.run().then(_.bind(function(){u.resolve().promise();var e=this.$(".us-share-file-list-item").last().offset().top;this.$filesList.scrollTop(e)},this))}},this)),u.promise()},_isDirty:function(e,i){return i.rnaServicesAPI.isDirtyApi(e._proxy).then(_.bind(function(e){return e?$.Deferred().reject().promise():$.Deferred().resolve().promise()},this),_.bind(function(){return $.Deferred().reject().promise()},this))},_startPlugin:function(){var i=this.options,s=this._gettingAuthenticatedModelsPromise;return s||(s=this._gettingAuthenticatedModelsPromise=!e.Util.isCEF()&&i.appApi.sessionApi.isSignedIn()?t.opFactory.create("GettingAuthenticatedModelsOp",i).run():this._getResolvedPromise()),s},_addUiModelEventListeners:function(){var e=this.options.sendFilesUiModel;e.on("change:local_file_objects",this._onFilesChange),e.get("metadata_collection").on("all",this._onFilesChange),e.on("change:resetFileList",this._onResetFilesList),e.on("change:US_tab_open",this._onUsTabChanged),e.on("change:cl_active_view",this._handleFileListCrossVisibility),e.on("change:ccloud_file_objects",this._onCCloudFilesChange),e.on("change:enable_add_files",this._setAddFilesState)},_onFilesChange:function(){var e=this.options.sendFilesUiModel,i=e.get("US_tab_open"),t=e.get("cl_active_view"),s=e.get("local_file_objects").length+e.get("metadata_collection").length;"createLink"!==i&&"complete"===t&&(this.options.sendFilesUiModel.resetClSubAndMsg(),e.set("cl_active_view","welcome")),this.render(),"contentPlusRHP"===e.get("layout")&&this.options.appApi.rnaApi.then(_.bind(function(e){e.stApi.updateSelectedFileCount(s)},this))},_onUsTabChanged:function(){this._handleFileListCrossVisibility()},_handleFileListCrossVisibility:function(){var e=this.options.sendFilesUiModel,i=e.get("US_tab_open"),t=e.get("cl_active_view");"createLink"===i&&"complete"===t?this.$(".us-share-file-list-close").hide():this.$(".us-share-file-list-close").show()},_onCCloudFilesChange:function(){var e=this.options.sendFilesUiModel,i=e.get("ccloud_file_objects").length;i&&this._showCCloudFileError()},_showCCloudFileError:function(){return this.options.appApi.dialogApi.displayTextAlert(this.options.appApi.dialogApi.SEVERITY_ERROR,o.CONNECTOR_FILE_ERROR_TITLE,o.CONNECTOR_FILE_ERROR_MSG)},_onResetFilesList:function(){this.options.sendFilesUiModel.get("resetFileList")&&(this.options.sendFilesUiModel.set("resetFileList",!1,{silent:!0}),this.options.sendFilesUiModel.resetFileListModel(),this._fetchDocument(),this._onFilesChange())},_initWrappers:function(){this.$body=$("body"),this.$shareToolFrame=this.$(".share-modal-tool-frame"),this.$filesList=this.$(".us-share-files-list"),this.$emptyFilesList=this.$(".share-files-list-empty"),this.$addMoreFilesBtn=this.$(".modal-view-add-file"),this.$addressHeading=this.$(".share-address-heading"),this.$addressList=this.$(".us-share-modal-address-input"),this.$shareButton=this.$(".share-files-button"),this.$cancelButton=this.$(".share-cancel"),this.$shareFileListClose=this.$(".us-share-file-list-close")},_onListItemMouseEnter:function(){console.log(" height is : "+this.$(".us-share-file-list-name").css("width")),this.$(".us-share-file-list-close").css("display","inline-block")},_onListItemMouseLeave:function(){this.$(".us-share-file-list-close").css("display","none")},_renderChildViews:function(){this._renderFileList()},_onRemoveAssetClick:function(e){var i,t,s,n=$(e.target),o=this.options.sendFilesUiModel,a=o.get("metadata_collection"),l=_.clone(o.get("local_file_objects")),r=_.clone(o.get("connector_file_objects")),d=_.clone(o.get("ccloud_file_objects"));i=n.data("asset-id"),i?(s=a.get(i),a.remove(s)):(t=n.data("list-index"),s=l.splice(t,1),r=o.removeFileObjects(s,r),d=o.removeFileObjects(s,d),o.set("connector_file_objects",r),o.set("ccloud_file_objects",d),o.set("local_file_objects",l))},_renderFileList:function(){var i,t=this.$filesList,s=(this.$emptyFilesList,this.options.sendFilesUiModel),n=s.get("local_file_objects"),a=s.get("metadata_collection"),d=s.get("enable_form_send"),p=(s.get("direct_to_workflow"),s.get("view_mode"),!0),h=this._computeMaxAvailWidth();t.empty(),s.set("us_subject_text",""),_.each(n,function(i,s){var n,a,l,r,d,p=Object.prototype.toString.call(i);"[object File]"===p?(n=i.name,l=this._getFileObjIconClass(i)):e.Util.isCEF()&&"[object Object]"===p?(n=i.get("name"),l=this._getFileObjIconClass(i),r=this._getFileObjIconDesc(i)):(n=i.value.replace(/^.*(\\|\/|\:)/,""),l=this._getFileInputIconClass(n),r=this._getFileInputIconDesc(n)),n&&(a=n,n=_.escape(n)),d=this._itemTemplate({icon_class:l,icon_desc:r,name:n,asset_id:"",list_index:s,remove:o.SHARE_REMOVE,ariaRemoveLabel:this._getRemoveAriaLabel(n)}),n&&(t.append(d),this._setOpenedDocNameAsSubject(a,!1))},this),a.each(_.bind(function(e){var i=e.get("name");d&&l.isFormMimeType(e.get("content_type"))&&(i=i.substring(0,i.length-5)+".pdf");var s=this._itemTemplate({icon_class:this._getIconClass(e),icon_desc:this._getIconDesc(e),name:i,asset_id:e.get("id"),list_index:"",remove:o.SHARE_REMOVE,ariaRemoveLabel:this._getRemoveAriaLabel(i)});e.get("name")&&(t.append(s),this._setOpenedDocNameAsSubject(i,!1))},this)),("onlyRHP"===s.get("layout")||a.length+n.length==1)&&(this.$(".us-share-file-list-item").first().children("button").remove(),p=!1),_.each(this.$(".us-share-file-list-name"),function(e){i=$(e),r.truncateElementText(i,h)}),this.$(".us-share-file-list-name").first().removeAttr("title")},_setAddFilesState:function(){var e=this.options.sendFilesUiModel,i=!e.get("enable_add_files");this.$addMoreFilesBtn.prop("disabled",i),"attachToEmail"===e.get("US_tab_open")?this.$addMoreFilesBtn.attr("title",""):this.$addMoreFilesBtn.attr("title",i?o.ERROR_MULTIPLE_FILES_REVIEW1_MODAL:o.ADD_MORE_FILES)},_onAddFileClick:function(){var i,s,n=this.options.appApi.selectionApi,o=this.options.sendFilesUiModel,l=this.options.appApi,r=this.options.sendFilesUiModel.get("ShareVariant"),d=a.USE,p="Add Files";this.options.appApi.siteCatalystApi.logScEvent([r,d,p]),i=_.extend({},this.options,{uiModel:o,selectionApi:n,appApi:l}),console.log("add files clicked"),e.Util.isCEF()&&(s=new t.DesktopAddFilesOp(i),s.run())},_setOpenedDocNameAsSubject:function(e,i){var t=this.options.sendFilesUiModel;if(i||!t.get("us_subject_text")){var s=e.substring(0,e.lastIndexOf("."));s=s?s:e,t.set("us_subject_text",s),t.set("cl_subject_text",s)}},_removeExtn:function(e){var i=e.text();i.replace(/pdf/gi,""),e.text(i)},_getRemoveAriaLabel:function(e){return _.template(o.GENERIC_ARIA_LABEL_STRING,{prefix:e,suffix:o.SHARE_REMOVE})},_getIconDesc:function(e){var i,t=l.getFileInfo(e.get("content_type"),e.get("name"));return i=t.desc||""},_getIconClass:function(i){var t,s,n;return t=e.Util.isCEF()?l.getFileMimeType(e.Util.getExtension(i.get("name"))):i.get("content_type"),n=l.getFileInfo(t,i.get("name")),s=n.iconCls||""},_getFileObjIconClass:function(i){var t,s,n,o;return e.Util.isCEF()?(t=l.getFileMimeType(e.Util.getExtension(i.get("name"))),s=i.get("name")):(t=i.type,s=i.name),o=l.getFileInfo(t,s),n=o.iconCls||""},_getFileObjIconDesc:function(i){var t,s,n,o;return e.Util.isCEF()?(t=l.getFileMimeType(e.Util.getExtension(i.get("name"))),s=i.get("name")):(t=i.type,s=i.name),o=l.getFileInfo(t,s),n=o.desc||""},_getFileInputIconClass:function(e){var i,t=l.getFileInfo("",e);return i=t.iconCls||""},_getFileInputIconDesc:function(e){var i,t=l.getFileInfo("",e);return i=t.desc||""},_computeMaxAvailWidth:function(){return 300}}),t.USModalFileListView}),define("pdmplugins/unified-share/js/modalView/templates/us-modal-share-success-template",[],function(){return'<div id="us-modal-success-view-container"><button class="us-modal-success-view-image" tabindex = "-1"/><div class="doc-sent-container"><div class="review-generated-heading ui-theme theme-text"><%= REVIEW_GENERATED_MSG %></div><div class="doc-sent-text-heading modal-success-view-text-heading ui-theme theme-text"><%= DOC_SENT_HEADING %></div><div class="doc-sent-text-summary us-modal-sent-text-summary ui-theme theme-text"><%= DOC_SENT_SUMMARY %></div></div><div id="us-track-sent-doc"><button class="control-button button-grey us-modal-track-files-button ui-theme theme-text theme-share-grey-button" id="success-goto-sent-files"><%= GO_TO_SENT_FILES %></button></div></div>'}),define("pdmplugins/unified-share/js/modalView/views/us-modal-share-success-view",["core/ac-core","pdmplugins/unified-share/js/ac-unified-share","pdmplugins/unified-share/js/modalView/templates/us-modal-share-success-template","i18n!pdmplugins/unified-share/js/nls/ui-strings","pdmplugins/unified-share/js/ops/close-app-op"],function(e,i,t,s){return i.UsModalShareSuccessView=e.View.extend({events:{"click #success-goto-sent-files":"_onClickSentLink"},initialize:function(){e.View.prototype.initialize.call(this),this._template=_.template(t)},render:function(){if(e.View.prototype.render.call(this),0===this.$el.children().length){var i=this.options.sendFilesUiModel.get("us_mode"),t=this.options.sendFilesUiModel.isMultipleFilesSelected(),n=(this.options.sendFilesUiModel.getRecipientsArray().length>1,"#send-mode"==i&&t?s.USM_SUCCESS_VIEW_MESSAGE:s.USM_SUCCESS_VIEW_MESSAGE),o=t?s.USM_SUCCESSFULLY_SENT_MULTIPLE:s.USM_SUCCESSFULLY_SENT,a=t?s.TRACK_FILES:s.TRACK_FILE;this.$el.html(this._template({SUCCESS_CLOSE:s.CLOSE_STRING,GO_TO_SENT_FILES:a,DOC_SENT_HEADING:o,DOC_SENT_SUMMARY:n,REVIEW_GENERATED_MSG:s.REVIEW_GENERATED_MSG})),this._initWrappers(),"#review-mode"===i?(this.$sentHeading.hide(),this.$sentSuccessSummary.hide(),this.$ManageFilesButton.hide()):this.$reviewHeading.hide()}this._centerVertically()},_initWrappers:function(){this.$ManageFilesButton=this.$("#success-goto-sent-files"),this.$usModalSuccessViewContainer=this.$("#us-modal-success-view-container"),this.$sentSuccessSummary=this.$(".doc-sent-text-summary"),this.$sentHeading=this.$(".doc-sent-text-heading"),this.$reviewHeading=this.$(".review-generated-heading")},_onClickSentLink:function(){var i="sentfiles";this.options.appApi.rnaApi.done(_.bind(function(t){if(t.isRunningInBrowser())this.options.appApi.sessionApi.ensureSignedIn().done(_.bind(function(){e.opFactory.create("GettingSsoUriOp",this.options).run(i).done(function(e){e&&window.open(e.uri)})},this));else{var s={};s.op="setHighlightWorkflowId",s.workflowID=this.options.sendFilesUiModel.attributes.parcel.parcel_id,s.sourcePlugin="unifiedShare",s.assetFileName="",s.assetWorkflowId="",t.stApi.updateInAppDMStateAPI(s),t.selectLeftRailItem("sentfiles",void 0,"CloseShareModalView")}},this))},_centerVertically:function(){var e,i=$("#unified-share-container").height();console.log("the height is  : "+i),e=.15*i,this.$usModalSuccessViewContainer.css("margin-top",e)}}),i.UsModalShareSuccessView}),define("pdmplugins/unified-share/js/modalView/templates/us-modal-subscription-required-template",[],function(){return'<div id="us-modal-subscribe-container"><div class="us-modal-subscription-content-container"><div class="modal-sm-heading ui-theme theme-text"><%= SHARE_AV_UPSELL_TITLE %></div><div class="us-subscription-main-content ui-theme theme-header-text us-sm-desc-text"><%= SHARE_AV_UPSELL_MSG %></div></div><div id="us-modal-subscribe-btn-container"><button class="us-modal-subscribe-learn-more-btn control-button theme-button theme-button-label"><%= US_SHARE_SFS_CTA %></button><button class="us-modal-subscribe-close-btn control-button button-grey ui-theme theme-text"><%= CLOSE %></button></div></div>'}),define("pdmplugins/unified-share/js/modalView/views/us-modal-subscribe-now-view",["core/ac-core","pdmplugins/unified-share/js/ac-unified-share","pdmplugins/unified-share/js/modalView/templates/us-modal-subscription-required-template","i18n!pdmplugins/unified-share/js/nls/ui-strings","pdmplugins/unified-share/js/ops/close-app-op"],function(e,i,t,s){return i.UsModalSubscribeNow=e.View.extend({events:{"click .us-modal-subscribe-learn-more-btn":"_onClickLearnMore","click .us-modal-subscribe-close-btn":"_onClickCloseShare"},initialize:function(){e.View.prototype.initialize.call(this),this._template=_.template(t)},render:function(){e.View.prototype.render.call(this),0===this.$el.children().length&&(this.$el.html(this._template({SHARE_AV_UPSELL_TITLE:s.SHARE_AV_UPSELL_TITLE,SHARE_AV_UPSELL_MSG:s.SHARE_AV_UPSELL_MSG,US_SHARE_SFS_CTA:s.US_SHARE_SFS_CTA,CLOSE:s.SHARE_SUCCESS_CLOSE})),this._initWrappers())},_initWrappers:function(){this.$usModalSubscribeNowViewContainer=this.$("#us-modal-subscribe-container")},_onClickLearnMore:function(){this.options.appApi.rnaApi.done(_.bind(function(e){e.openDecoratedUrl(this.options.limitsModel.get("upgrade_url"))},this)),e.Util.isCEF()&&this.options.appApi.sessionApi.ensureSignedIn()},_onClickCloseShare:function(){var e=new i.CloseAppOp(this.options);e.run()}}),i.UsModalSubscribeNow}),define("pdmplugins/unified-share/js/modalView/views/us-modal-view-content-view",["core/ac-core","files/ac-files","pdmplugins/unified-share/js/ac-unified-share","pdmplugins/unified-share/js/modalView/templates/us-modal-view-content-template","i18n!pdmplugins/unified-share/js/nls/ui-strings","pdmplugins/unified-share/js/utils/sc-constants","core/utils/file-types","pdmplugins/unified-share/js/ops/desktop-add-files-op","pdmplugins/unified-share/js/views/us-modal-view","pdmplugins/unified-share/js/modalView/views/us-modal-tab-view","pdmplugins/unified-share/js/modalView/views/us-modal-expansion-view","pdmplugins/unified-share/js/modalView/views/us-modal-file-list-view","pdmplugins/unified-share/js/modalView/views/us-modal-share-success-view","pdmplugins/unified-share/js/modalView/views/us-modal-subscribe-now-view"],function(e,i,t,s,n){return t.ModalContentView=e.View.extend({events:{"click .us-modal-manage-files":"_onManageFileClick","click #share-modal-close":"_closeModalShareView","click #us-modal-view":"_closeFileListDialog"},initialize:function(){e.View.prototype.initialize.call(this),this._template=_.template(s)},render:function(){e.View.prototype.render.call(this),0===this.$el.children().length&&(this.$el.html(this._template({USM_SHARE_DIALOG_HEADING:n.USM_SHARE_DIALOG_HEADING,MANAGE_FILES:n.ADD_MORE_FILES,CLOSE:n.CLOSE_SHARE_PANE})),this._initWrappers()),this._addKeyEventListener(),this._renderChildViews(),this._addUiModelEventListeners(),this._onFilesChange(),this._updateEscKeyHandler(),this._adjustWelcomeViewHeight(),this._setManageFilesState(),this._adjustExpnsionViewWidth(),this.$shareModalCloseBtn.focus(),this.$shareModalCloseBtn.blur()},_adjustExpnsionViewWidth:function(){var e=this.$usModalExpansionViewContainer.outerWidth();this.$usModalViewtableColumnRight.css("width",e+"px")},_initWrappers:function(){this.$usModalTabViewContainer=this.$("#us-modal-tab-view-container"),this.$usModalViewtableColumnRight=this.$(".us-modal-view-table-column-right"),this.$usModalExpansionViewContainer=this.$("#us-modal-expansion-view-container"),this.$UsModalFileListContainer=this.$("#us-modal-file-list-container"),this.$UsModalManageFiles=this.$(".us-modal-manage-files"),this.$usSuccessView=this.$("#us-success-view"),this.$usSubscribeNowView=this.$("#us-subscribe-now-view"),this.$usModalView=this.$("#us-modal-view"),this.$shareLoader=this.$(".share-modal-loader"),this.$Loadertext=this.$("#uploading-text"),this.$modeText=this.$("#mode-text"),this.$usWelcomeView=this.$("#us-modal-share-welcome-view"),this.$usModalClose=this.$("#us-modal-close"),this.$usModalViewContainer=this.$("#us-modal-view-container"),this.$modalLoader=this.$("#modal-loader"),this.$shareModalCloseBtn=this.$("#share-modal-close"),this.$modalShareHeading=this.$("#modal-share-heading")},_addKeyEventListener:function(){this.options.appApi.keyApi.pushKeyHandler(this)},_onKeyDown:function(e){var i=e.which;return 27===i?(this.$UsModalFileListContainer.is(":visible")?this._closeFileListDialog():this._closeModalShareView(),this._consumeEvent(e),!0):void 0},_adjustWelcomeViewHeight:function(){this.$usModalViewContainer.outerHeight(!0),this.$usModalClose.outerHeight(!0)},_addUiModelEventListeners:function(){var e=this.options.sendFilesUiModel;e.on("change:local_file_objects",this._onFilesChange),e.get("metadata_collection").on("all",this._onFilesChange),e.on("change:share_loader_text",this._updateLoaderText),e.on("change:us_share_state",this._onUsShareStateChange),e.on("change:enable_add_files",this._setManageFilesState),e.on("change:US_tab_open",this._onUsTabChanged)},_renderChildViews:function(){this._renderChildView("_unisharemodaltabview",t.UsModalTabView,this.$usModalTabViewContainer),this._renderChildView("_unisharerhpexpansionview",t.UsModalExpansionView,this.$usModalExpansionViewContainer),this._renderChildView("_unisharemodalfilelistview",t.USModalFileListView,this.$UsModalFileListContainer)},_setManageFilesState:function(){var e=this.options.sendFilesUiModel,i=!e.get("enable_add_files");i?this.$UsModalManageFiles.hide():this.$UsModalManageFiles.show()},_onManageFileClick:function(){var e=this.options.sendFilesUiModel,i=e.get("local_file_objects").length+e.get("metadata_collection").length;i>1?this.$UsModalFileListContainer.is(":visible")?this._closeFileListDialog():this._showFilesListDialog():this._unisharemodalfilelistview._onAddFileClick()},_showFilesListDialog:function(){this.$UsModalFileListContainer.show(),this.$usModalView.addClass("modal-for-file-list"),this._unisharemodalfilelistview._renderFileList()},_closeFileListDialog:function(){this.$UsModalFileListContainer.hide(),this.$usModalView.removeClass("modal-for-file-list")},_closeModalShareView:function(){var e=new t.CloseAppOp(this.options);e.run()},_onFilesChange:function(){var e,i=this.options.sendFilesUiModel,t=n.ADD_MORE_FILES,s=i.get("local_file_objects").length+i.get("metadata_collection").length;s>1?(t=n.USM_SHARING+" "+s+" "+n.USM_N_FILES,e=t):(t=n.ADD_MORE_FILES,e=n.USM_SHARING+" "+this.getFirstFileName(),this._closeFileListDialog()),this.$UsModalManageFiles.text(t),this.$UsModalManageFiles.prop("title",e),this.$UsModalManageFiles.attr("aria-label",t)},getFirstFileName:function(){var e=this.options.sendFilesUiModel,i=e.get("local_file_objects"),t=e.get("metadata_collection");return i.length?i[0].get("name"):t.local_file_objects?t[0].get("name"):""},_onUsTabChanged:function(){this._closeFileListDialog()},_onUsShareStateChange:function(){console.log("on share state changed");var e=this.options.sendFilesUiModel,i=e.get("us_share_state");this.$usWelcomeView.show(),this.$shareLoader.hide(),"avNotAllowed"===i?(this._renderChildView("_subscribeNowView",t.UsModalSubscribeNow,this.$usSubscribeNowView),this.$usWelcomeView.hide(),this.$shareLoader.hide()):"preShare"===i?(this.$usSuccessView.hide(),this.$usWelcomeView.show(),this.$shareLoader.hide(),this.$modalShareHeading.text(n.USM_SHARE_DIALOG_HEADING)):"postShare"===i&&"#send-mode"===e.get("us_mode")?(this._renderChildView("_shareSuccessView",t.UsModalShareSuccessView,this.$usSuccessView),this.$usSuccessView.show(),this.$usWelcomeView.hide(),this.$shareLoader.hide(),this.$modalShareHeading.text(n.SHARE_TAB_HEADER)):(this._renderChildView("_shareWorkingView",t.UsModalView,this.$usModalView),this.$shareLoader.show(),this._makeLoaderCenterVertically(),this._makeLoaderCenterHorizontally(),this._setLoaderText(),this.$usWelcomeView.hide(),this.$modalShareHeading.text(n.SHARE_TAB_HEADER))},_setLoaderText:function(){{var e=this.options.sendFilesUiModel;e.get("us_mode")}this.$Loadertext.text(""),this.$modeText.text(n.USM_SENDING)},_updateLoaderText:function(){var e=this.options.sendFilesUiModel,i=e.get("us_mode");"#send-mode"===i&&this.$Loadertext.text(e.get("share_loader_text"))},_updateEscKeyHandler:function(){this.options.appApi.rnaApi.then(_.bind(function(e){e.stApi.handleEscKeyAtCef()},this),_.bind(function(){return $.Deferred().reject().promise()},this))},_makeLoaderCenterVertically:function(){var e,i=this.$usModalViewContainer.height();e=.4*i,this.$shareLoader.css("margin-top",e)},_makeLoaderCenterHorizontally:function(){var e=this.$usModalViewContainer.width(),i=this.$modalLoader.outerWidth(!1);this.$modalLoader.css("margin-left",(e-i)/2)}}),t.ModalContentView}),define("pdmplugins/unified-share/js/popupView/templates/us-popup-content-template",[],function(){return'<div id="unified-share-popup-container" class="ui-theme theme-share-container"><div style="width: 100%"><div id="us-popup-send-mail" class="ui-theme theme-share-container"></div><div id="us-popup-create-link-view" class="ui-theme theme-share-container"></div><div id="us-popup-share-view" class="ui-theme theme-share-container"></div><div id="us-popup-promote-sign" class="ui-theme theme-share-container"></div></div></div>'}),define("pdmplugins/unified-share/js/popupView/templates/us-popup-create-link-template",[],function(){var e='<div class="create-link-view"><div class="popup-cl-header-container"><div class="popup-cl-left-container"><div class="create-link-header ui-theme theme-text"><%= CREATE_LINK_HEADING %></div><div class="us-create-link-icon-cell"></div></div><div class="popup-cl-right-container"><a class="ui-theme theme-share-add-files" tabindex="0" id="popup-copy-link" class="" aria-label = "<%= CREATE_LINK_COPY_LINK %>" aria-describedby="popup-copy-link-button"><%= CREATE_LINK_COPY_LINK %></a><div id="popup-cl-link-message" class="ui-theme theme-text" tabindex="-1"><i class="popup-cl-link-message-icon"/><span class="ui-theme theme-copy-link-text popup-cl-link-message-text"><%= CREATE_LINK_COPIED %></div></div></div><div id="create-link-container-id" class="create-link-container"><div id="popup-share-in-window-tooltip" class="ui-theme theme-text" aria-label="<%= TOOLTIP_INFO %>"><%= TOOLTIP_INFO %></div><div id="popup-share-in-window-tooltip-dc" class="ui-theme theme-text" aria-label="<%= TOOLTIP_INFO_DC %>"><%= TOOLTIP_INFO_DC %></div><div id="popup-share-in-window-tooltip-copy" class="ui-theme theme-text" aria-label="<%= TOOLTIP_INFO_COPY %>"><%= TOOLTIP_INFO_COPY %></div><div id="popup-cl-success-view" class="url-container"><div><textarea type="text" id="popup-cl-url" class="ui-theme theme-share-container theme-share-popup-input-container theme-text theme-share-popup-border" tabindex="0" readonly="readonly" /></div></div></div><div class="ui-theme toggle-theme create-link-options-container"><div id="popup-cl-allow-comments-container" class="popup-cl-left-container"><label class="switch"><input tabindex= "0" id="popup-cl-allow-comments-checkbox" type="checkbox" role="switch"><span id="create-link-toggle" class="slider round"></span></label><span class="ui-theme theme-text"><%= CREATE_LINK_ALLOW_COMMENTS %></span></div><div class="popup-cl-right-container"><button tabindex = "0" id="popup-cl-open-review" aria-label = "Go to review button" class="popup-create-link-button control-button theme-button theme-button-label"><%= CREATE_LINK_OPEN_REVIEW %></button><button tabindex = "0" id="popup-cl-copy-link" aria-label = "Copy the link" class="theme-share-grey-button popup-copy-button theme-primary-button-label"><%= CREATE_LINK_COPY_LINK %></button></div></div><div id="upsell-container-get-link"></div><div class = "us-popup-error-dialog-container us-popup-cl-error-dialog ui-theme theme-share-popup-border"><div class="us-popup-error-dialog-content us-popup-cl-error-dialog-content"><div class= "us-popup-error-dialog-content-text"></div></div></div></div>';return e}),define("pdmplugins/unified-share/js/popupView/templates/us-popup-free-user-upsell-template-mini",[],function(){return'<div class="us-floating-dialog"><span class="us-popup-upsell-arrow ui-theme theme-share-container theme-share-border"></span><div class="us-floating-upsell-container ui-theme theme-share-container theme-share-border"><div class="ui-theme"><div class="popup-file-list-heading ui-theme theme-text"><%= USM_SEND_FOR_REVIEW %></div><p class="ui-theme theme-text"><%= USM_UPSELL_INFO %></p></div><div class="us-upsell-btn-container"><span tabindex = "1" id="us-upsell-learn-more-btn" class="ui-theme theme-text theme-share-add-files us-floating-dialog-learn-more-focus"> <%= LEARN_MORE %> </span><button tabindex = "1" class="us-upsell-close-btn control-button button-grey ui-theme theme-text"><%= CLOSE %></button><button tabindex = "1" class="us-upsell-get-started-btn control-button theme-button theme-button-label floating-window-button-text"><%= US_SHARE_SFS_CTA %></button></div></div></div></div>'}),define("pdmplugins/unified-share/js/popupView/views/us-popup-create-link-view",["core/ac-core","files/ac-files","core/utils/file-types","pdmplugins/unified-share/js/ac-unified-share","pdmplugins/unified-share/js/popupView/templates/us-popup-create-link-template","pdmplugins/unified-share/js/popupView/templates/us-popup-free-user-upsell-template-mini","i18n!pdmplugins/unified-share/js/nls/ui-strings","pdmplugins/unified-share/js/utils/sc-constants","pdmplugins/unified-share/js/utils/ts-utils","pdmplugins/unified-share/js/ops/desktop-do-upload-op","pdmplugins/unified-share/js/ops/finding-upload-folder-op","pdmplugins/unified-share/js/ops/begin-desktop-upload-op","pdmplugins/unified-share/js/ops/share-files-op","pdmplugins/unified-share/js/ops/create-instant-link-op","core/utils/sc-analytics","core/ops/op"],function(e,i,t,s,n,o,a,l,r){return s.USPopupCreateLinkView=e.View.extend({events:{"click #popup-create-link-generate":"_onGenerateLink","click #popup-cl-allow-comments-checkbox":"_onAllowComments","click #popup-copy-link":"_copyLinkClicked","click #popup-cl-url":"_onClickURL","click #popup-cl-learn-more":"_launchLearnMoreCL","blur  #popup-cl-url":"_onBlurURL","click .us-upsell-close-btn":"_onUpsellCloseClicked","click .us-upsell-get-started-btn":"_onUpsellGetStartedClicked","click #us-upsell-learn-more-btn":"_onUpsellLearnMoreClicked","click #popup-cl-open-review":"_onClickOpenReview","click .ui-popup-learn-more":"_onLearnMoreBtnClick","click #popup-cl-copy-link":"_onCopyLinkBtnClick"},initialize:function(){e.View.prototype.initialize.call(this),this._template=_.template(n),this._templateUpsell=_.template(o),this.subscriptionInfoFetched=!1,e.Util.isReader()&&(this.generatingLinkForInitallySignedOutReader=!1)},render:function(){if(e.View.prototype.render.call(this),this.$("#popup-share-in-window-tooltip-dc").hide(),this.$("#popup-share-in-window-tooltip-copy").hide(),0===this.$el.children().length&&(this.$el.html(this._template({CREATE_LINK_HEADING:a.USM_GET_LINK_TAB_TEXT,CREATE_LINK_ALLOW_COMMENTS:a.CREATE_LINK_ALLOW_COMMENTS,CREATE_LINK_COPY_LINK:a.USM_COPY_LINK,CREATE_LINK_COPIED:a.CREATE_LINK_COPIED,CREATE_LINK_OPEN_REVIEW:a.CREATE_LINK,LEARN_MORE_LABEL:a.LEARN_MORE_LABEL,LEARN_MORE_LINK:a.LEARN_MORE,TOOLTIP_INFO:a.POP_SHARE_CREATE_LINK_INFO_TOOLTIP_LOCAL+a.POP_SHARE_CREATE_LINK_INFO_TOOLTIP_DC,TOOLTIP_INFO_DC:a.POP_SHARE_CREATE_LINK_INFO_TOOLTIP_DC,TOOLTIP_INFO_COPY:a.POP_SHARE_CREATE_LINK_INFO_TOOLTIP_COPY,CL_LEARN_MORE_LINK:a.POP_SHARE_CREATE_LINK_LEARN_MORE})),this.options.appApi.rnaApi.done(_.bind(function(e){var i=e.getOpenedFile();i.invoke("determineFileSource").then(_.bind(function(e){var i=this.options.sendFilesUiModel;i.get("workflowFile")?(this.$("#popup-share-in-window-tooltip").hide(),this.$("#popup-share-in-window-tooltip-dc").hide()):"root"===e?(this.$("#popup-share-in-window-tooltip").hide(),this.$("#popup-share-in-window-tooltip-dc").show()):(this.$("#popup-share-in-window-tooltip-dc").hide(),this.$("#popup-share-in-window-tooltip").show())},this))},this)),this._initUpsellDialog(),this._initWrappers()),!e.Util.isReader()||1!=this.generatingLinkForInitallySignedOutReader){this._renderChildViews(),this._addUiModelEventListeners(),this._checkUncheckAllowComments(),this._toggleAddFilesButton(),this._addUiEventListeners(),this._addKeyEventListener(),this._onFilesChange(),this._updateToggleTheme(),this._toggleAllowCommentsVisibility(),this._updateReviewBtn(),this._setupListener();
var i=this.options.sendFilesUiModel;i.get("workflowFile")&&this._onGenerateLink(),this._adjustTooltipPosition()}},_initUpsellDialog:function(){var e=this._templateUpsell({USM_SEND_FOR_REVIEW:a.USM_SEND_FOR_REVIEW,USM_UPSELL_INFO:a.USM_CREATE_LINK_UPSELL,LEARN_MORE:a.LEARN_MORE,US_SHARE_SFS_CTA:a.US_SHARE_SFS_CTA,CLOSE:a.SHARE_SUCCESS_CLOSE});this.$("#upsell-container-get-link").append(e),this.$(".us-popup-upsell-arrow").addClass("us-popup-upsell-top-arrow"),this.$(".us-floating-upsell-container").addClass("us-floating-upsell-container-top-arrow"),this.$(".us-floating-dialog").hide()},_initWrappers:function(){this.$PopupClView=this.$(".create-link-view"),this.$PopupClAllowCommentsRow=this.$("#popup-cl-allow-comments-container"),this.$PopupCopyLinkMessage=this.$("#popup-cl-link-message"),this.$PopupCopyLink=this.$("#popup-copy-link"),this.$PopupCLAllowCommentsCheckBox=this.$("#popup-cl-allow-comments-checkbox"),this.$PopupClUrl=this.$("#popup-cl-url"),this.$clPopupOpenReviewBtn=this.$("#popup-cl-open-review"),this.$popupShareInfo=this.$("#popup-share-info"),this._hideLinkCopiedText(),this.$PopupCopyLink.hide(),this.$PopupClUrl.hide(),this.$("#popup-cl-copy-link").hide()},_addUiModelEventListeners:function(){var e=this.options.sendFilesUiModel;e.on("change:cl_active_view",this._onClActiveViewChange),e.on("change:local_file_objects",this._onFilesChange),e.get("metadata_collection").on("all",this._onFilesChange),e.on("change:ccloud_file_objects",this._onFilesChange),e.on("change:cl_mode",this._onModeChange),e.on("change:cl_show_context_board",this._showContextBoard)},_addUiEventListeners:function(){$("#unified-share-container").on("click",this.hideErrorBubble),this.$popupShareInfo.mouseenter(this._onHoverInviteReviewInfo),this.$popupShareInfo.blur(_.bind(function(){setTimeout(_.bind(function(){this.$popupShareInfo.removeClass("hovered")},this),100)},this)),this.$popupShareInfo.hover(_.bind(function(){this.$popupShareInfo.addClass("hovered")},this),_.bind(function(){this.$popupShareInfo.removeClass("hovered")},this))},_renderChildViews:function(){},_reorderCollections:function(e){var i=[],t=$.Deferred(),s=0,n=[],o=this.options.sendFilesUiModel,a=o.get("limits_model"),r=0;if(!this.options.localFiles.length)return t.resolve().promise();if(this.avFlag=!1,this.formFlag=!1,_.each(this.options.localFiles,_.bind(function(t){var l;"postUpload"===e&&(t.id=this.options.assetIdarray[s],l=this.options.sendFilesUiModel.addFilesToCollection([t.id],void 0,o.get("share_collection"),!0,!0),i.push(l[0]),s++),"preUpload"===e&&(!_.isUndefined(t.get("path"))&&"\\\\www.adobe.com\\go\\homeacrordrunified18_2018"===t.get("path")||"http://www.adobe.com/go/homeacrordrunified18_2018"===t.get("path")?console.log("Welcome.pdf"):_.isEmpty(t.get("ext"))?(this.options.sendFilesUiModel.removeLocalFile([t]),l=this._showErrorDialogMsg("noExtension"),i.push(l)):_.isEmpty(t.get("assetId"))||this.options.sendFilesUiModel.get("bHFileIsDirty")&&t.get("assetId")===this.options.sendFilesUiModel.get("openedFileAssetId")?!a.get("can_send_av")&&o.hasAudioVideoExt(t.get("ext"))?(this.avFlag=!0,n[r++]=t,l=$.Deferred().resolve().promise(),i.push(l)):o.get("enable_form_send")||"form"!==t.get("ext")?(l=$.Deferred().resolve().promise(),i.push(l)):(this.formFlag=!0,n[r++]=t,l=$.Deferred().resolve().promise(),i.push(l)):(this.options.sendFilesUiModel.removeLocalFile([t]),l=this.options.sendFilesUiModel.addFilesToCollection([t.get("assetId")]),i.push(l[0])))},this)),n.length){var d;this.options.appApi.siteCatalystApi.logScEvent([l.TOOLS,this.options.sendFilesUiModel.get("ShareVariant"),l.FILES_SHARED_DLG,l.DISALLOWED,l.WARNING,l.SHOWN]),d=this.options.isType2OR3?this._showErrorDialogMsg("type2or3",n):this.avFlag&&!this.formFlag?this._showErrorDialogMsg("avError",n):!this.avFlag&&this.formFlag?this._showErrorDialogMsg("fileTypeError",n,"formError"):this._showErrorDialogMsg("fileTypeError",n,"avFormError"),i.push(d)}return $.when.apply($,i).then(_.bind(function(){this.options.localFiles=this.options.sendFilesUiModel.get("local_file_objects"),this.options.files=this.options.sendFilesUiModel.get("metadata_collection"),t.resolve()},this),_.bind(function(){t.reject()},this)),t.promise()},_setupListener:function(){this.options.appApi.rnaApi.done(_.bind(function(e){e.rnaUnifiedSharePopupAPI.initListener().done(_.bind(function(e){e._addEventListener("custom:PollParcel",_.bind(function(e,i){if(i.params){this.options.parcelCreationPromise=$.Deferred();var t=_.extend({parcel_id:i.params,pollCount:1,MAX_POLL_COUNT:50},this.options),n=new s.ShareFilesOp(t);n._pollParcelStandalone(),this.options.parcelCreationPromise.then(_.bind(function(){this._onPollingComplete(i.params,!0)},this),_.bind(function(){var e=i.params;this._onPollingComplete(e,!1)},this))}},this),null,null),e._addEventListener("custom:RegenerateLink",_.bind(function(){this.hideErrorBubble()},this),null,null),e._addEventListener("custom:setWorkflowFileLink",_.bind(function(e,i){var t=this.options.sendFilesUiModel;if(t.get("workflowFile")){var s=i.params;s&&""!=s&&(t.set("instant_link",s),t.set("cl_active_view","complete"))}},this),null,null)},this),this)},this))},_showErrorDialogMsg:function(e,i,t){{var s,n,o=this.options.appApi.dialogApi;this.options.sendFilesUiModel.get("limits_model")}if("noExtension"===e)return s=a.ADD_FILES_REJECTED_TITLE,n=a.ADD_FILES_REJECTED_MESSAGE,this.showErrorBubble(l.CREATE_LINK_ERROR,s,n);if("avError"===e){var r=_.extend({},{okButtonClass:"us-upsell-learn-more",cancelButtonClass:"us-upsell-close"});s=a.SHARE_AV_UPSELL_TITLE,n=a.SHARE_AV_UPSELL_MSG;var d=o.displayHtmlAlert(o.SEVERITY_WARNING,s,n,a.LEARN_MORE,a.CLOSE_STRING,r);return $(".alert-dlg-buttons-rhp").css({"text-align":"right",direction:"rtl"}),$(".us-upsell-learn-more").css({"padding-left":"15px","padding-right":"15px","margin-left":"10px","margin-right":"5px"}),d.then(_.bind(function(){return this._onUpsell(),$.Deferred().reject().promise()},this),_.bind(function(){return _.each(i,_.bind(function(e){this.options.sendFilesUiModel.removeLocalFile([e])},this)),$.Deferred().reject().promise()},this)).always(_.bind(function(){$(".alert-dlg-buttons-rhp").css({"text-align":"center",direction:"ltr"})},this))}if("type2or3"===e){var s=a.COULD_NOT_SEND,n=a.ENTERPRISE_USERS_ACCESS_ERROR;return this.showErrorBubble(l.CREATE_LINK_ERROR,s,n).then(_.bind(function(){return _.each(i,_.bind(function(e){this.options.sendFilesUiModel.removeLocalFile([e])},this)),$.Deferred().reject().promise()},this))}return"fileTypeError"===e?(s=a.SEND_UPSELL_UPGRADE_REQUIRED,"formError"===t?(n=a.SHARE_FORMS_ERROR_DESKTOP,this.options.appApi.siteCatalystApi.logScEvent([l.TOOLS,this.options.sendFilesUiModel.get("ShareVariant"),l.ATTEMPTED_TO_SHARE_FORM])):"avFormError"===t&&(n=a.SHARE_AV_FORMS_ERROR+a.SHARE_AV_UPGRADE_MESSAGE),this.showErrorBubble(l.CREATE_LINK_ERROR,s,n).then(_.bind(function(){return _.each(i,_.bind(function(e){this.options.sendFilesUiModel.removeLocalFile([e])},this)),$.Deferred().reject().promise()},this))):void 0},_checkReviewPossible:function(){var e=$.Deferred();return s.opFactory.create("CanSendForReviewOp",this.options).run().then(_.bind(function(){this.options.sendFilesUiModel.set("allow_comments_enabled",!0),e.resolve()},this),_.bind(function(i){if(this.options.sendFilesUiModel.set("allow_comments_enabled",!1),this.reviewPossibleErrorObj=i,e.resolve(),"#review-mode"===this.options.sendFilesUiModel.get("cl_mode")){var t=this.options.sendFilesUiModel.get("ShareVariant"),s=l.ERROR,n=i.analyticsEvent;this.options.appApi.siteCatalystApi.logScEvent([t,s,n]),this.showErrorBubble(l.CREATE_LINK_ERROR,a.FILE_CANT_BE_SENT,i.msg),setTimeout(_.bind(this.hideErrorBubble,this,l.CREATE_LINK_ERROR),4e3),this._resetAfterError()}},this)),e},_onUpsell:function(i){var t=this.options.limitsModel,s=t.get("upgrade_url");this.options.appApi.rnaApi.done(_.bind(function(e){e.openDecoratedUrl(s)},this)),e.Util.isCEF()&&this.options.appApi.sessionApi.ensureSignedIn()},_onUpsellCloseClicked:function(){this.$(".us-floating-dialog").hide(),this.$("#popup-copy-link").focus()},_onUpsellLearnMoreClicked:function(){this.options.appApi.rnaApi.done(_.bind(function(e){e.openDecoratedUrl(a.REVIEW_LEARN_MORE_LINK_GO_URL)},this))},_onUpsellGetStartedClicked:function(){this.options.appApi.rnaApi.done(_.bind(function(e){e.openDecoratedUrl(this.options.limitsModel.get("upgrade_url"))},this)),e.Util.isCEF()&&this.options.appApi.sessionApi.ensureSignedIn(),this._onUpsellCloseClicked()},_onModeChange:function(){this._toggleAddFilesButton(),this._checkMaximumFiles(),this._checkReviewPossible()},_onAllowComments:function(){console.log("On Allow Comments..."),this.$PopupCLAllowCommentsCheckBox.blur(),this.options.sendFilesUiModel.get("allow_comments_enabled")===!1&&this.$PopupCLAllowCommentsCheckBox.is(":checked")&&this.reviewPossibleErrorObj&&(i=l.ERROR,t=this.reviewPossibleErrorObj.analyticsEvent,this.options.appApi.siteCatalystApi.logScEvent([e,i,t]),this.showErrorBubble(l.CREATE_LINK_ERROR,a.FILE_CANT_BE_SENT,this.reviewPossibleErrorObj.msg),setTimeout(_.bind(this.hideErrorBubble,this,l.CREATE_LINK_ERROR),4e3)),1==this.$PopupCLAllowCommentsCheckBox.is(":checked")?this.$PopupCLAllowCommentsCheckBox.attr("aria-label","Allow Comment Toggle on"):this.$PopupCLAllowCommentsCheckBox.attr("aria-label","Allow Comment Toggle off"),this.options.sendFilesUiModel.get("isReviewVisible")?this._allowComments():(this.$PopupCLAllowCommentsCheckBox.attr("checked",!1),this.$(".us-floating-dialog").show(),this.$("#us-upsell-learn-more-btn").focus());var e=this.options.sendFilesUiModel.get("ShareVariant"),i=l.CREATE_LINK_MODE,t=l.ALLOW_COMMENTS_TOGGLED,s=this.options.sendFilesUiModel.get("cl_mode");this.options.appApi.siteCatalystApi.logScEvent([e,i,t,s])},_allowComments:function(){var e=this.options.sendFilesUiModel;1==e.get("allow_comments_enabled")&&this.$PopupCLAllowCommentsCheckBox.is(":checked")?(e.set("allow_comments",!0),e.set("cl_mode","#review-mode")):(e.set("allow_comments",!1),e.set("cl_mode","#send-mode"),this.$PopupCLAllowCommentsCheckBox.attr("checked",!1))},_checkUncheckAllowComments:function(){{var e=this.options.sendFilesUiModel.get("cl_mode");this.options.sendFilesUiModel.get("allow_comments")}"#review-mode"==e?(this.$PopupCLAllowCommentsCheckBox.attr("checked",!0),this.$PopupCLAllowCommentsCheckBox.attr("aria-label","Allow Comment Toggle on")):(this.$PopupCLAllowCommentsCheckBox.attr("checked",!1),this.$PopupCLAllowCommentsCheckBox.attr("aria-label","Allow Comment Toggle off")),this._allowComments();var i=this.options.sendFilesUiModel.get("ShareVariant"),t=l.CREATE_LINK_MODE,s=l.ALLOW_COMMENTS_DEFAULT;this.options.appApi.siteCatalystApi.logScEvent([i,t,s,e])},_updateToggleTheme:function(){"LightTheme"===s.QueryParams.theme?($("#create-link-toggle").removeClass("darkTheme"),$("#create-link-toggle").addClass("lightTheme")):"DarkTheme"===s.QueryParams.theme&&($("#create-link-toggle").removeClass("lightTheme"),$("#create-link-toggle").addClass("darkTheme"))},_toggleAllowCommentsVisibility:function(){var e=!0;this.options.appApi.rnaApi.done(_.bind(function(i){e=i.stApi.shouldAdobeReviewVisible(),e&&!this.options.sendFilesUiModel.get("workflowFile")?this.$PopupClAllowCommentsRow.show():this.$PopupClAllowCommentsRow.hide()},this))},_toggleAddFilesButton:function(){{var e=this.options.sendFilesUiModel,i=e.get("cl_mode");e.get("allow_comments")}"#review-mode"==i?e.set("enable_add_files",!1):e.set("enable_add_files",!0)},_checkMaximumFiles:function(){var e=this.options.sendFilesUiModel,i=e.get("US_tab_open");if("createLink"===i){if(e.get("allow_comments")&&e.isMultipleFilesSelected()){var t=(this.options.appApi.dialogApi,a.SHARE_TOO_MANY_FILES_DLG_TITLE),s=a.ERROR_MULTIPLE_FILES_REVIEW1+". "+a.ERROR_MULTIPLE_FILES_REVIEW2;this.$PopupCLAllowCommentsCheckBox.prop("checked",!1),e.setCLMode("#send-mode"),e.set("allow_comments",!1);var n=this.options.sendFilesUiModel.get("ShareVariant"),o=l.ERROR,r="Multiple files selected for review";return this.options.appApi.siteCatalystApi.logScEvent([n,o,r]),this.showErrorBubble(l.FILE_LIST_ERROR,t,s),!1}var d,e=this.options.sendFilesUiModel,p=e.get("limits_model"),h=e.get("cl_mode"),c=e.get("local_file_objects").length+e.get("metadata_collection").length;if(d=_.isUndefined(p)?50:p.get("#send-mode"===h?"max_files":"max_review_files"),c>d){var u=(this.options.appApi.dialogApi,a.SHARE_TOO_MANY_FILES_DLG_TITLE),m=_.template(a.SHARE_TOO_MANY_FILES_DLG_MSG,{maxNumber:d});return this.showErrorBubble(l.FILE_LIST_ERROR,u,m,!0),!1}}return!0},_onGenerateLink:function(){console.log("Generating link....");var e=this.options.sendFilesUiModel;return e.get("workflowFile")?void this.options.appApi.rnaApi.done(_.bind(function(e){e.rnaUnifiedSharePopupAPI.getWorkflowFileLink()},this)):(this.options.appApi.siteCatalystApi.logEvent("CSE","GetLink","GetLink_Invoked"),this.options.CheckRestrictionsPromise=$.Deferred(),s.FetchDesktopSubscriptionsPromise=$.Deferred(),void(e.isAVSharingPermitted()?"onlyRHP"===this.options.sendFilesUiModel.get("layout")&&this.options.sendFilesUiModel.get("checkForSave")?this.options.appApi.rnaApi.done(_.bind(function(e){e.rnaServicesAPI.checkOpenedDocAndPromptForSaveApi().then(_.bind(function(){this._onShareClick()},this))},this)):this._onShareClick():e.setShareState("avNotAllowed")))},_onShareClick:function(){var i,t,n,o,r,d,p,h,c,u,m,E,g,S,f=[],A=[];if(this._checkMaximumFiles()){if(n=this.options.sendFilesUiModel,o=n.get("metadata_collection"),h=n.get("local_file_objects"),r="createLink"===n.get("US_tab_open"),d="share"===n.get("US_tab_open"),u=n.get("customize_recipient_page"),S=n.get("allow_comments"),p=n.get("allow_comments"),c=this._getSubjectText(!1),i={uiModel:n,files:o,localFiles:h,recipients:f,is_public:r,is_individual:d,can_make_comments:S,email_subject:c,displayApi:this.options.appApi.displayApi,appApi:this.options.appApi,rootView:this.options.rootView,is_branding:u,sendFilesUiModel:this.options.sendFilesUiModel,assetIdarray:A,recipientsAreFinalized:!0,is_review:S},t=_.extend({},{filesModelBackup:o.clone(),localFilesBackup:h}),m=_.bind(function(){this._reorderCollections("preUpload").then(_.bind(function(){this.options.CheckRestrictionsPromise.resolve()},this),_.bind(function(){this._resetAfterError(t)},this))},this),E=_.bind(function(e){if(e){var i=(this.options.appApi.dialogApi,_.template('<div class = "learn-more-sharing"><%=LEARN_MORE%></div>')({LEARN_MORE:a.LEARN_MORE})),s=a.FILE_CANT_BE_SENT,n=a.SHARE_ERROR_ENTERPRISE_SEND_DLG_MSG+i,o=this.options.sendFilesUiModel.get("ShareVariant"),r=l.USE,d="Sharing Restriction Error Prompt Shown";this.options.appApi.siteCatalystApi.logScEvent([o,r,d]),this.showErrorBubble(l.CREATE_LINK_ERROR,s,n,!0),$(".learn-more-sharing").click(this._onSharingLearnMore),this._resetAfterError(t)}else{var p=this.options.sendFilesUiModel;"#review-mode"!==p.get("cl_mode")||p.get("allow_comments_enabled")!==!1?m():(this.reviewPossibleErrorObj&&(r=l.ERROR,d=this.reviewPossibleErrorObj.analyticsEvent,this.options.appApi.siteCatalystApi.logScEvent([o,r,d]),this.showErrorBubble(l.CREATE_LINK_ERROR,a.FILE_CANT_BE_SENT,this.reviewPossibleErrorObj.msg),setTimeout(_.bind(this.hideErrorBubble,this,l.CREATE_LINK_ERROR),4e3)),this._resetAfterError())}},this),g=_.bind(function(){var e=this.options.appApi.rnaApi;e.done(_.bind(function(e){E(e.isFeatRunning()?!1:!1)},this))},this),this.options=_.extend({},this.options,i),!this.options.appApi.networkConnectivityApi.isOnline())return this._renderOfflineView(),this._onShareError(t,l.NO_CONNECTIVITY),void this._resetAfterError(t);var v=!1;if(e.Util.isReader()){var R=this.options.appApi.sessionApi.isSignedInReader(),b=this.options.sendFilesUiModel.get("ShareVariant"),I=R?"Signed In":"Signed out";this.options.appApi.siteCatalystApi.logScEvent([b,l.CREATE_LINK_MODE,I]),R?this.generatingLinkForInitallySignedOutReader=!1:(v=!0,this.generatingLinkForInitallySignedOutReader=!0,this.$PopupClUrl.hide(),this.$clPopupOpenReviewBtn.show(),this.$PopupClAllowCommentsRow.show())}this.options.appApi.sessionApi.ensureSignedIn().then(_.bind(function(){if(v){var e=this.options.sendFilesUiModel.get("ShareVariant"),i="SignedInViaSignInDialog";this.options.appApi.siteCatalystApi.logScEvent([e,l.CREATE_LINK_MODE,i]),this.options.appApi.rnaApi.done(_.bind(function(e){e.rnaUnifiedSharePopupAPI.restoreUnifiedSharePopup("GetLink")},this))}v&&(this.$clPopupOpenReviewBtn.hide(),this.$PopupClAllowCommentsRow.hide(),this.$PopupClUrl.show()),this._setWorkingView(),this.options=_.extend({},this.options,this._postSignInFunction()),this.options.readRegistry=!1,this._createInstantLink(t),s.FetchDesktopSubscriptionsPromise.then(_.bind(function(){var e=v?!s.subscriptionFetched:!this.subscriptionInfoFetched;this._resetACUnifiedShareValues(),e?s.opFactory.create("DesktopGettingSubscriptionLevels",this.options).run().then(_.bind(function(){this.subscriptionInfoFetched=!0,g()},this),_.bind(function(){this._onShareError(t,l.UNKNOWN_SERVICE_ERROR),this._resetAfterError(t)},this)):g()},this),_.bind(function(){this._resetACUnifiedShareValues(),this._onShareError(t,l.NO_CONNECTIVITY),this._resetAfterError(t)},this)),0==v?s.FetchDesktopSubscriptionsPromise.resolve():s.subscriptionFetchTriggered||s.FetchDesktopSubscriptionsPromise.resolve()},this),_.bind(function(e){e&&"NoAccessToPdfServices"===e.errorString&&this._displayNoAccessToUser(e.errorCode)},this))}},_onShareError:function(e,i){if(i===l.NO_CONNECTIVITY)this.showErrorBubble(l.CREATE_LINK_ERROR,a.SHARE_NO_INTERNET_CONNECTION,a.SHARE_NO_INTERNET_CONNECTION_MSG);else if(i===l.UNKNOWN_SERVICE_ERROR)this.showErrorBubble(l.CREATE_LINK_ERROR,a.COULD_NOT_COMPLETE_REQUEST,a.COULD_NOT_COMPLETE_REQUEST_MSG);else if(i===l.REVIEW_NOT_PERMITTED){var t=this.options.sendFilesUiModel.get("ShareVariant"),s=l.USE,n="Review not supported";this.options.appApi.siteCatalystApi.logScEvent([t,s,n]),this.showErrorBubble(l.CREATE_LINK_ERROR,a.SHARE_REVIEW_RESTRICTED,a.SHARE_REVIEW_RESTRICTED_MSG).done(_.bind(function(){this.options.sendFilesUiModel.setCLMode("#send-mode"),this.options.sendFilesUiModel.set("allow_comments",!1)},this))}else i===l.ERROR_UPLOAD&&this.showErrorBubble(l.CREATE_LINK_ERROR,a.SHARE_UPLOAD_ERROR_TITLE,a.SHARE_UPLOAD_ERROR_MSG)},_onSharingLearnMore:function(){this.options.appApi.rnaApi.then(_.bind(function(e){e.stApi.launchSendTrackRestrictionsLearnMoreUrl()}))},_launchLearnMoreCL:function(){this.options.appApi.rnaApi.done(_.bind(function(e){e.openDecoratedUrl(a.GET_LINK_LEARN_MORE_GO_URL)},this))},_onClickOpenReview:function(){if(this.options.appApi.rnaApi.done(function(e){e.logPerformance("GetLinkGenerating","start"),e.logPerformance("ShareAFile","start")}),this.options.sendFilesUiModel.get("allow_comments_enabled")===!1&&this.$PopupCLAllowCommentsCheckBox.is(":checked")&&this.reviewPossibleErrorObj){{this.options.sendFilesUiModel.get("ShareVariant"),l.ERROR,this.reviewPossibleErrorObj.analyticsEvent}this.showErrorBubble(l.CREATE_LINK_ERROR,a.FILE_CANT_BE_SENT,this.reviewPossibleErrorObj.msg),setTimeout(_.bind(this.hideErrorBubble,this,l.CREATE_LINK_ERROR),4e3)}else this.$clPopupOpenReviewBtn.hide(),this.$PopupClAllowCommentsRow.hide(),this.$PopupClUrl.show(),this._setWorkingView(),this._onGenerateLink(),this.options.showContextBoard=!0},_showContextBoard:function(){this.options.showContextBoard!==!0||this.options.sendFilesUiModel.get("workflowFile")||this.options.appApi.rnaApi.done(_.bind(function(e){{var i=this.options.sendFilesUiModel.get("cl_mode");this.options.sendFilesUiModel.get("allow_comments")}"#review-mode"==i?e.rnaUnifiedSharePopupAPI.openDummyReview():e.rnaUnifiedSharePopupAPI.openDummyView(),this.options.sendFilesUiModel.get("workflowFile")||e.rnaUnifiedSharePopupAPI.hidePopup(),this.options.appApi.siteCatalystApi.logScEvent([l.TOOLS,this.options.sendFilesUiModel.get("ShareVariant"),l.START_COMMENTING,l.CLICKED])},this))},_resetACUnifiedShareValues:function(){s.FetchDesktopSubscriptionsPromise=void 0,e.Util.isReader()&&(s.subscriptionFetched=!1,s.subscriptionFetchTriggered=!1)},_resetAfterError:function(i){var t=this.options.sendFilesUiModel;t.set("cl_active_view","error"),i&&(t.set("metadata_collection",i.filesModelBackup.clone()),t.set("local_file_objects",i.localFilesBackup)),e.Util.isReader()&&1==this.generatingLinkForInitallySignedOutReader&&(this.generatingLinkForInitallySignedOutReader=!1)},_showConnectorFileError:function(){this.showErrorBubble(l.CREATE_LINK_ERROR,a.CONNECTOR_FILE_ERROR_TITLE,a.CONNECTOR_FILE_ERROR_MSG)},_fetchingSubscriptionWait:function(e){e?(this.$fullOverlay=this.options.appApi.displayApi.showFullOverlay(!0),this.$fullOverlay.addClass("progress-fetch-subscription")):(this.$fullOverlay.removeClass("progress-fetch-subscription"),this.options.appApi.displayApi.showFullOverlay(!1))},_postSignInFunction:function(){var e,i,t=this.options,s=this.options.is_public,n=this.options.recipients,o=this.options.is_individual;return i=this.options.appApi.baseFilesUrisApi.getAlternateUploadUri(),this._logSharingParams(s,o,n),e=this.options.appApi.baseFilesUrisApi.getSendApiUri(),e=r.extractRootUrl(e),t={rootUrl:e,uploadUrl:i}},_renderOfflineView:function(){console.log("Render offlineView")},_resetPageToDefault:function(){console.log("Draw the success view for Create Link")},_parcelHasForms:function(){var e,i,s,n=!1;return e=this.options.sendFilesUiModel,i=e.get("metadata_collection"),s=e.get("enable_form_send"),s&&(n=i.some(function(e){return t.isFormMimeType(e.get("content_type"))})),n},_checkMaximumRecipients:function(e){var i,t=this.options.sendFilesUiModel,s=t.get("limits_model"),n=!1;return e&&(i=s.get("max_recipients"),e.length>i?this._displayTooManyRecipients(e.length,i):n=!0),n},_displayTooManyRecipients:function(){console.log("Too many recipients")},_displayNoAccessToUser:function(e){{var i,t;this.options.appApi.dialogApi}i=a.COULD_NOT_SEND,t="UserEncrypted"===e?filesUiStrings.ENCRYPTION_KEY_DISABLED_MESSAGE:a.ENTERPRISE_USERS_ACCESS_ERROR,this.showErrorBubble(l.CREATE_LINK_ERROR,i,t)},_onFilesChange:function(){{var e=this.options.sendFilesUiModel,i=e.get("local_file_objects"),t=e.get("metadata_collection");e.get("ccloud_file_objects")}i.length+t.length==1&&this._checkReviewPossible()},_setWorkingView:function(){this.options.sendFilesUiModel.set("cl_active_view","working")},_getSubjectText:function(e){var i=this.options.sendFilesUiModel.get("cl_subject_text");return e&&(i=i.replace(a.SHARE_INITIAL_SUBJECT_PREFIX,"")),i},_onClActiveViewChange:function(){var e=this.options.sendFilesUiModel,i=e.get("cl_active_view");switch(console.log("View set to "+i),this._updateReviewBtn(),i){case"working":this._hideLinkCopiedText(),this.$PopupCopyLink.hide(),this.$PopupClUrl.val(a.GENERATING_LINK_MSG),this.$PopupClUrl.addClass("progress-animation progress-animation-background");break;case"complete":this._updateCreatedLink(),this.$PopupClUrl.removeClass("progress-animation progress-animation-background");break;case"error":this._hideLinkCopiedText(),this.$PopupCopyLink.hide(),this.$PopupClUrl.val(""),this.$PopupClUrl.removeClass("progress-animation progress-animation-background")}},_updateReviewBtn:function(){var e=this.options.sendFilesUiModel;this.options.sendFilesUiModel.get("workflowFile")?(this.$("#popup-share-in-window-tooltip").hide(),this.$("#popup-share-in-window-tooltip-dc").hide(),this.$("#popup-share-in-window-tooltip-copy").show(),this.$("#create-link-container-id")[0].style.height="70px",this.$("#popup-cl-open-review").hide(),this.$("#popup-cl-copy-link").show(),this.$("#popup-cl-url").show()):(this.$("#popup-cl-copy-link").hide(),"working"!==e.get("cl_active_view")&&1!=this.options.showContextBoard&&this.$("#popup-cl-open-review").show())},_createInstantLink:function(i){var t,n,o=this.options.sendFilesUiModel.get("share_collection"),r=this.options.sendFilesUiModel.get("metadata_collection");o.reset(),r.each(_.bind(function(e){var i=new s.FileMetadataModel;i.set(_.clone(e.attributes)),o.add(i)},this)),n=_.extend({shareFiles:o},this.options),t=new s.CreateInstantLinkOp(n),t.run().then(_.bind(function(i){this.options.instantLinkResult=i,this.options.CheckRestrictionsPromise.then(_.bind(function(){e.Util.isReader()&&1==this.generatingLinkForInitallySignedOutReader&&(this.generatingLinkForInitallySignedOutReader=!1);var i=this.options.instantLinkResult,t=this.options.sendFilesUiModel;t.set("instant_link",i.public_link),t.set("instant_link_token",i.public_link_token),t.set("instant_link_expiry",i.expiry_time),this.options.appApi.rnaApi.done(_.bind(function(e){e.rnaUnifiedSharePopupAPI.storeInstantLinkInfo(t.get("instant_link"),t.get("instant_link_token"),t.get("instant_link_expiry"),t.get("cl_mode"),i.asset_id)},this));var s=this.options.sendFilesUiModel.get("ShareVariant"),n=l.SUCCESS,o=l.INSTANT_LINK,a=t.get("cl_mode");this.options.appApi.siteCatalystApi.logScEvent([s,n,o,a]),t.set("cl_active_view","complete")},this))},this),_.bind(function(e){var t="";if(void 0!=e.responseText)try{t=JSON.parse(e.responseText).error.code}catch(s){}if("SharingRestrictions"===t){var n=_.template('<div class = "learn-more-sharing"><%=LEARN_MORE%></div>')({LEARN_MORE:a.LEARN_MORE}),o=a.FILE_CANT_BE_SENT,r=a.SHARE_ERROR_ENTERPRISE_SEND_DLG_MSG+n,d=this.options.sendFilesUiModel.get("ShareVariant"),p=l.USE,h="Sharing Restriction Error Prompt Shown";this.options.appApi.siteCatalystApi.logScEvent([d,p,h]),this.showErrorBubble(l.CREATE_LINK_ERROR,o,r,!0),$(".learn-more-sharing").click(this._onSharingLearnMore),this._resetAfterError(i)}else 0==$(".us-popup-error-dialog-content:visible").length&&this.showErrorBubble(l.CREATE_LINK_ERROR,a.SHARE_CL_ERROR_DLG_TITLE,a.SHARE_CL_ERROR_DLG_MSG);this._resetAfterError(i);var d=this.options.sendFilesUiModel.get("ShareVariant"),p=l.ERROR,h=l.INSTANT_LINK;this.options.appApi.siteCatalystApi.logScEvent([d,p,h])},this))},_updateCreatedLink:function(){var e="",i=this.options.sendFilesUiModel;i.get("instant_link")&&(e=i.get("instant_link")),this.$PopupClUrl.val(e),this._onClickCopyLink(!1)},_getPublicUrl:function(e){var i,t;return t=_.find(e,function(e){return"PARCEL_PUBLIC_SHARING"===e.recipient_email}),t&&(i=t.preview_url),i},_onClickURL:function(){this.$PopupClUrl.select()},_onBlurURL:function(){var e=this.$PopupClUrl.val();this.$PopupClUrl.val(""),this.$PopupClUrl.val(e)},_copyLinkClicked:function(){var e=this.options.sendFilesUiModel.get("ShareVariant"),i=l.COPY_LINK,t=l.CLICKED;this.options.appApi.siteCatalystApi.logScEvent([e,i,t]),this._onClickCopyLink(!1)},_onClickCopyLink:function(e){console.log("Copy Link");var i=this.options.sendFilesUiModel.get("ShareVariant"),t=l.SUCCESS,s="Copy Link";this.options.appApi.siteCatalystApi.logScEvent([i,t,s]),this._onClickURL(),this.$PopupClUrl.focus(),this.options.appApi.rnaApi.done(_.bind(function(i){var t=!1;if(1==e&&this.options.appApi.rnaApiObj&&this.options.appApi.rnaApiObj._clipboardAPI){var s=this.$PopupClUrl.val();try{var n=0==s.length;this.options.appApi.rnaApiObj._clipboardAPI.invoke("writeClipboardData",{text:s,shouldIgnore:n}).then(_.bind(function(){t=!0;var e=this.options.sendFilesUiModel;this.options.appApi.rnaApi.done(e.get("workflowFile")?function(e){e.logPerformance("PopUpCopyLink","end")}:_.bind(function(e){e.logPerformance("GetLinkGenerating","end"),e.invokeMethod({methodName:"createLinkPopupCopyLinkBtnClick",methodArgs:!0})},this)),this.$PopupCopyLink.hide(),this.options.sendFilesUiModel.set("cl_show_context_board","true")},this),_.bind(function(){t=!1},this))}catch(o){}}0==t&&i.cefBrowserApi({methodName:"handleViewEvent",parameters:["CopyEvent",{}]}).then(_.bind(function(){var e=this.options.sendFilesUiModel;this.options.appApi.rnaApi.done(e.get("workflowFile")?function(e){e.logPerformance("PopUpCopyLink","end")}:_.bind(function(e){e.logPerformance("GetLinkGenerating","end"),e.invokeMethod({methodName:"createLinkPopupCopyLinkBtnClick",methodArgs:!0})},this)),this.$PopupCopyLink.hide(),this.options.sendFilesUiModel.set("cl_show_context_board","true")},this),_.bind(function(){this.options.appApi.dialogApi;this.showErrorBubble(l.CREATE_LINK_ERROR,a.SHARE_COPY_LINK_ERROR_DLG_TITLE,a.SHARE_COPY_LINK_ERROR_DLG_MSG)},this))},this))},_showLinkCopiedText:function(){this.$PopupCopyLinkMessage.show()},_hideLinkCopiedText:function(){this.$PopupCopyLinkMessage.hide()},showErrorBubble:function(e,i,t,s){$(".us-popup-cl-error-dialog").show(),s===!0?$(".us-popup-cl-error-dialog").find(".us-popup-error-dialog-content-text").html(t):$(".us-popup-cl-error-dialog").find(".us-popup-error-dialog-content-text").text(t),$("#us-popup-view").addClass("popup-for-error-dialog");var n=_.invert(a);if(n[t]){var o=n[t];this.options.appApi.siteCatalystApi.logScEvent([this.options.sendFilesUiModel.get("ShareVariant"),l.CREATE_LINK_MODE,l.ERROR_BUBBLE_SHOWN,o])}return $.Deferred().resolve().promise()},hideErrorBubble:function(){(void 0===event||"popup-cl-allow-comments-checkbox"!=event.target.id&&"popup-cl-open-review"!=event.target.id)&&($(".us-popup-error-dialog-container").hide(),$("#us-popup-view").removeClass("popup-for-error-dialog"))},_addKeyEventListener:function(){this.options.appApi.keyApi.pushKeyHandler(this)},_onKeyDown:function(e){var i=!1,t=e.which;if(13==t&&("popup-copy-link"==e.target.id?(this._onClickCopyLink(!0),i=!0):"popup-cl-allow-comments-checkbox"==e.target.id?(e.target.click(),e.target.focus(),i=!0):$("#popup-cl-learn-more").is(":focus")?(this._launchLearnMoreCL(),i=!0):"popup-cl-open-review"==e.target.id?(this.onClickOpenReview(),i=!0):"popup-share-info"==e.target.id?this.$popupShareInfo.addClass("hovered"):"us-upsell-learn-more-btn"==e.target.id?this._onUpsellLearnMoreClicked():"ui-popup-learn-more"==e.target.classList[0]&&this._onLearnMoreBtnClick()),9==t){var s=$("*[tabindex = 0]:visible"),n=s.index(e.target);if(0==n&&e.shiftKey?(s.eq(s.length-1).focus(),i=!0,e.preventDefault()):n!=s.length-1||e.shiftKey||(s.eq(0).focus(),i=!0,e.preventDefault()),s=$("*[tabindex = 1]:visible"),s.length>0){var n=s.index(e.target);0==n&&e.shiftKey?(s.eq(s.length-1).focus(),i=!0,e.preventDefault()):n!=s.length-1||e.shiftKey||(s.eq(0).focus(),i=!0,e.preventDefault())}}return i},_mapInstantLink:function(){this.options.appApi.rnaApi.done(_.bind(function(e){e.rnaUnifiedSharePopupAPI.mapInstantLink()},this))},_onPollingComplete:function(e,i){this.options.appApi.rnaApi.done(_.bind(function(t){t.rnaUnifiedSharePopupAPI.onPollingComplete(e,i)},this))},_setLastShareMode:function(){this.options.appApi.rnaApi.done(_.bind(function(e){var i=this.options.sendFilesUiModel;"#send-mode"==i.get("cl_mode")?e.stApi.setLastSharePaneMode(0):"#review-mode"==i.get("cl_mode")&&e.stApi.setLastSharePaneMode(1)},this))},_adjustTooltipPosition:function(){var e=$(".us-create-link-icon-cell").position();if(e){var i=e.left;$(".us-create-link-icon-cell .popup-cl-tooltip-position").css({"margin-left":-1*i+"px"}),$(".us-create-link-icon-cell .popup-tooltip-arrow").css({"margin-left":i-9+"px"});for(var t=14;$(".us-create-link-icon-cell .popup-cl-tooltip-position").height()>75;)t--,$(".us-create-link-icon-cell .popup-tooltip-text").css({"font-size":t+"px"})}},_logSharingParams:function(e){var i=this.options.appApi.siteCatalystApi;e&&i.logScEvent([l.TOOLS,this.options.sendFilesUiModel.get("ShareVariant"),l.SHARE_WITH,l.PUBLIC]),this._logFormShareStarted()},_logFormShareStarted:function(){var e,i,t=this.options.appApi.siteCatalystApi;this._parcelHasForms()&&(e=[l.TOOLS,l.FSS,l.FORM,l.OUTPUT,l.SAVE_TO_PDF,l["1_STARTED"],l.SEND_TAB],i=e.join(":"),t.logScEvent(e,{featureType:i}))},_logFormShareSuccess:function(){var e,i,t,s=this.options.appApi.siteCatalystApi;this._parcelHasForms()&&(e=[l.TOOLS,l.FSS,l.FORM,l.OUTPUT,l.SAVE_TO_PDF,l["2_COMPLETED"],l.SEND_TAB],i=e.join(":"),t=[l.TOOLS,l.FSS,l.FORM,l.COMPLETED].join(":"),s.logScEvent(e,{featureType:i,sectionName:t}))},_logFormShareError:function(e){var i,t,s,n=this.options.appApi.siteCatalystApi;if(this._parcelHasForms()){var o="ServerError";switch(e){case"CannotConvertFormTimeout":o="TimeOut";break;case"CannotConvertFormRestrictedEditPermission":o="PermSet"}i=[l.TOOLS,l.FSS,l.FORM,l.OUTPUT,l.SAVE_TO_PDF,l.ERROR,o,l.SEND_TAB],t=i.join(":"),s=[l.TOOLS,l.FSS,l.FORM,l.OUTPUT,l.SAVE_TO_PDF,l.ERROR].join(":"),n.logScEvent(i,{featureType:t,sectionName:s})
}},_onCopyLinkBtnClick:function(){this.options.appApi.rnaApi.done(function(e){e.logPerformance("PopUpCopyLink","start")}),this._onClickCopyLink(!0),this.options.appApi.rnaApi.done(_.bind(function(e){e.invokeMethod({methodName:"createLinkPopupCopyLinkBtnClick",methodArgs:!1}),e.rnaUnifiedSharePopupAPI.hidePopup()},this))},_onLearnMoreBtnClick:function(){var e=a.POP_SHARE_CREATE_LINK_LEARN_MORE_LINK;_.isEmpty(e)||this.options.appApi.rnaApi.done(_.bind(function(i){i.openDecoratedUrl(e)},this))}}),s.USPopupCreateLinkView}),define("pdmplugins/unified-share/js/popupView/templates/us-popup-share-template",[],function(){return'<div id="us-popup-share-container"><div id="us-popup-share-primary-view" class="ui-theme">   <div id="popup-share-heading" class="popup-share-heading-container">       <div class="ui-theme theme-text popup-share-heading-text" aria-label="<%= INVITE_PEOPLE_HEADING %>"><%= INVITE_PEOPLE_HEADING %></div><div class="us-share-popup-icon-cell"><div tabindex = "0" id="popup-share-info" class="info-icon-img popup-tooltip-icon" aria-label ="<%= TOOLTIP_INFO %>"><div class="popup-tooltip popup-tooltip-border popup-tooltip-text popup-share-tooltip-position ui-theme theme-tooltip theme-share-border"><span class="ui-theme theme-tooltip-text"><%= TOOLTIP_INFO %></span><div class="popup-tooltip-arrow"></div></div></div></div>   </div>   <div id="popup-share-in-window-tooltip" class="ui-theme theme-text" aria-label="<%= TOOLTIP_INFO %>"><%= TOOLTIP_INFO %> </div>   <div id="popup-share-in-window-tooltip-dc" class="ui-theme theme-text" aria-label="<%= TOOLTIP_INFO_DC %>"><%= TOOLTIP_INFO_DC %></div>   <div id="popup-share-email-address-template-container" class ="ui-theme theme-share-container"></div>   <div id="upsell-container-invite-tab"></div>   <div class="ui-theme toggle-theme popup-share-options-container"><div id="popup-share-allow-comments-container"><label class="switch"><input tabindex="0" id="popup-ip-allow-comments-checkbox" type="checkbox" role="switch"><span id="invite-people-toggle" class="slider round ui-theme theme-toggle"></span></label><span class="ui-theme theme-text"><%= CREATE_LINK_ALLOW_COMMENTS %></span></div>        <div id="deadline-popup-selector-container" class ="ui-theme theme-share-container"></div>   </div>   <div class="popup-share-button-container"><div id="popup-share-uploading-text" class= "us-popup-uploading-text ui-theme theme-text"></div><div id="popup-share-progress-view"><div class="popup-share-progress"><div class="popup-share-progress-bar"></div></div></div>   <div class="popup-share-button-bar">   <div class = "us-popup-error-dialog-container us-popup-share-error-dialog ui-theme theme-share-border">       <span class = "us-popup-error-dialog-arrow us-popup-error-dialog-share-arrow"></span>       <div class="us-popup-error-dialog-content us-popup-share-error-dialog-content">           <div class= "us-popup-error-dialog-content-text"></div>       </div>   </div>       <button tabindex="-1" class="share-files-button control-button theme-button theme-button-label floating-window-button-text"            aria-describedby="share-files-button" aria-label="<%= SEND_INVITATIONS %>"><%= SHARE_BUTTON %></button>       <button class = "ui-theme theme-text" id= "close-share-button"><%= SHARE_CLOSE %></button>   </div></div></div><div id="us-success-view" class="ui-theme"></div></div>'}),define("pdmplugins/unified-share/js/popupView/templates/us-popup-free-user-upsell-template",[],function(){return'<div class="us-floating-dialog"><span class="us-popup-upsell-arrow ui-theme theme-share-container theme-share-border"></span><div class="us-floating-upsell-container ui-theme theme-share-container theme-share-border"><div class="ui-theme"><div class="popup-file-list-heading ui-theme theme-text"><%= USM_SEND_FOR_REVIEW %></div><ul class="us-upsell-popup-info-list"><li class="ui-theme theme-header-text"> <%= USM_REVIEW_UPSELL_1 %> </li><li class="ui-theme theme-header-text"> <%= USM_REVIEW_UPSELL_2 %> </li><li class="ui-theme theme-header-text"> <%= USM_REVIEW_UPSELL_3 %> </li><li class="ui-theme theme-header-text"> <%= USM_REVIEW_UPSELL_4 %> </li><li class="us-no-bullet-row"><span tabindex = "1" id="us-upsell-learn-more-btn" class="ui-theme theme-text theme-share-add-files us-floating-dialog-learn-more-focus"> <%= LEARN_MORE %> </span></li></ul></div><div class="us-upsell-btn-container"><button tabindex = "1" class="us-upsell-close-btn control-button button-grey ui-theme theme-text"><%= CLOSE %></button><button tabindex = "1" class="us-upsell-get-started-btn control-button theme-button theme-button-label floating-window-button-text"><%= US_SHARE_SFS_CTA %></button></div></div></div></div>'}),define("pdmplugins/unified-share/js/popupView/templates/us-popup-email-addr-view-template",[],function(){return'<div class="us-share-popup-address-input-container">        <div class = "share-popup-tool-frame ui-theme theme-share-container theme-share-popup-border">            <button id="us-popup-search-email-img" tabindex="-1"/>            <div class="share-popup-email-list" role="grid" aria-labelledby="share-heading">                <div class = "us-popup-email-input-box">                   <input tabindex="0" type="text" class="us-share-popup-address-input ui-theme theme-share-container theme-share-input-text"                           placeholder="<%= SHARE_ADDRESS_PROMPT %>"                           id="us-share-popup-address-input"                           aria-autocomplete="list"                           aria-label="<%= SHARE_ADDRESS_PROMPT %>"                           aria-owns="us-share-auto-c-list" autocomplete="false" />                </div>                <button tabindex="0" class="us-share-popup-address-book" aria-label ="<%= ADDRESS_BOOK_LABEL %>" title="<%= ADDRESS_BOOK %>"                     aria-describedby="us-share-popup-address-book" id="us-popup-address-book-img"/>            </div>         </div></div><div class="us-share-popup-autocomplete-box-parent ui-theme theme-share-container"><div class="us-share-popup-autocomplete-box ui-theme theme-share-popup-border theme-share-container theme-text"></div></div><div class="share-popup-message-container"><textarea type="text" maxlength="1000" id="us-sm-popup-subject-input" class="us-share-popup-subject-input ui-theme theme-share-popup-container theme-share-input-text theme-share-border hidden" aria-label = "<%= SHARE_INITIAL_SUBJECT_ARIA_LABEL %>"/><textarea tabindex="0" autoresize type="text" maxlength="1000" class="us-share-popup-message-input ui-theme theme-share-container theme-share-input-text theme-share-popup-border" id="us-share-popup-message-input" aria-label="<%= SHARE_MESSAGE_HEADING_ARIA_LABEL %>"placeholder = "<%= SHARE_MESSAGE_PROMPT_PLACEHOLDER %>" spellcheck="false"></textarea></div>'}),define("pdmplugins/unified-share/js/popupView/templates/us-popup-email-addr-view-template-add-signers",[],function(){return'<div id="us-share-popup-address-input-container-nv" class="us-share-popup-address-input-container">        <div class = "share-popup-tool-frame ui-theme theme-share-container theme-share-popup-border" style="max-height:none;">            <div id="share-popup-email-list-nv" class="share-popup-email-list" role="grid" aria-labelledby="share-heading">                <div class = "us-popup-email-input-box">                   <input tabindex="0" type="text" id="us-share-popup-address-input-nv" class="us-share-popup-address-input ui-theme theme-share-container theme-share-input-text"                           placeholder="<%= ADD_SIGNERS_EMAIL_PLACEHOLDER %>"                           id="us-share-popup-address-input"                           aria-autocomplete="list"                           aria-label="<%= ADD_SIGNERS_EMAIL_PLACEHOLDER %>"                           aria-owns="us-share-auto-c-list" autocomplete="false" />                </div>            </div>         </div></div><div class="us-share-popup-autocomplete-box-parent ui-theme theme-share-container"><div class="us-share-popup-autocomplete-box ui-theme theme-share-popup-border theme-share-container theme-text"></div></div><div id="share-popup-message-container-box" class="share-popup-message-container"><textarea id="us-share-popup-subject-list" class="us-share-popup-subject-input ui-theme theme-share-container theme-share-popup-border theme-text" aria-label = "<%= SHARE_INITIAL_SUBJECT_ARIA_LABEL %>" align="left" maxlength="255" tabindex="5"></textarea><textarea id="us-share-popup-message-list" class="us-share-popup-message-input us-share-popup-message-list ui-theme theme-share-container theme-share-popup-border theme-text"  align="left" style="width: 100%;"  placeholder = "<%= SHARE_MESSAGE_PROMPT_PLACEHOLDER %>" aria-label = "<%= SHARE_MESSAGE_PROMPT_PLACEHOLDER %>" tabindex="6"></textarea></div>'}),define("pdmplugins/unified-share/js/popupView/templates/us-popup-email-list-item-template",[],function(){return'    <div class="share-popup-email-list-item  theme-hoverable ui-theme theme-share-container" title="<%= email %>">       <div class="share-email-list-name theme-text" tabindex="-1"><%= name %></div>       <div           aria-labelledby="share-email-list-name">           <button class="share-email-list-close core-remove-x"                title="<%= remove %>" tabindex="0"                 data-asset-id="<%= asset_id %>"                aria-label="<%= ariaRemoveLabel %>"></button>       </div>   </div> '}),define("pdmplugins/unified-share/js/popupView/templates/us-popup-autocomplete-template",[],function(){return' <div class="us-popup-share-auto-c-list"     role="listbox" id="us-share-auto-c-list"></div><div class="us-ms-graph-get-contacts-banner ui-theme theme-list-item theme-share-container">   <button id="us-get-ms-graph-contacts-message" class= "ui-theme theme-share-add-files" tabindex="0" aria-label ="<%= GET_MS_GRAPH_CONTACTS_MSG %>" title="<%= GET_MS_GRAPH_CONTACTS_MSG %>"><%= GET_MS_GRAPH_CONTACTS_MSG %></button></div>'}),define("pdmplugins/unified-share/js/popupView/templates/us-popup-autocomplete-item-template",[],function(){return'<div class="us-share-auto-address <%=specialClass%> ui-theme theme-list-item" aria-label = "<%-email %>" role="option" tabindex="-1" title="<%-email %>" name="<%-name%>"><div id="email-list-name" class= "ui-theme theme-text" title="<%-email %>" name="<%-name%>"><%-name%></div><div id="email-list-email" class= "ui-theme theme-text" title="<%-email %>" name="<%-name%>"><%-email%></div></div>'}),define("pdmplugins/unified-share/js/popupView/views/us-popup-autocomplete-view",["core/ac-core","pdmplugins/unified-share/js/ac-unified-share","pdmplugins/unified-share/js/popupView/templates/us-popup-autocomplete-template","pdmplugins/unified-share/js/popupView/templates/us-popup-autocomplete-item-template","pdmplugins/unified-share/js/utils/sc-constants","i18n!pdmplugins/unified-share/js/nls/ui-strings"],function(e,i,t,s,n,o){return i.AutocompleteView=e.View.extend({events:{"mousedown .us-share-auto-address":"_onAddressClick","mousedown .us-ms-graph-get-contacts-banner":"_onGetMSGraphContactsClick"},initialize:function(){var i,n=this.options,o=n.autoCCollection;console.log("shub options",n),e.View.prototype.initialize.call(this),this._template=_.template(t),this._localAddressTemplate=_.template(s),this._addressTemplate=_.template("<div class='us-share-auto-address <%=specialClass%> ui-theme theme-list-item theme-hoverable'title='<%-email %>' role='option' tabindex='-1' aria-label ='<%-email %>' name='<%-name%>'><div id='email-list-email-only' class= 'ui-theme theme-text' title='<%-email %>' name='<%-name%>'><span title='<%-email %>'><%-email%></span></div></div>"),this._editControl=n.emailView,this.isMSGraphBannerInFocus=!1,i=new Backbone.Collection,this.filteredCollection=i,i.on("all",_.debounce(_.bind(this._onFilteredCChange,this),50)),o.on("all",_.debounce(_.bind(this._onCollectionChange,this),300))},render:function(){return e.View.prototype.render.call(this),0===this.$el.children().length&&(this.$el.html(this._template({GET_MS_GRAPH_CONTACTS_MSG:o.GET_MS_GRAPH_CONTACTS_MSG_1+"Office"+o.GET_MS_GRAPH_CONTACTS_MSG_2+"Outlook"+o.GET_MS_GRAPH_CONTACTS_MSG_3})),this._initWrappers(),this.$autoCList.on("scroll",this._onAddressScroll),this.$getMSGraphContacts.hide(),e.Util.isCEF()&&this.$autoCList.css("overflow","auto"),!i.QueryParams||"SharePopup_RequestSignatures"!==i.QueryParams.shareVariant&&"SharePopup_RequestSignatures_Disclosed"!==i.QueryParams.shareVariant||"attachToEmail"!==i.QueryParams.launchApp||"attachToEmail"!==this.options.sendFilesUiModel.get("US_tab_open")||this.$autoCList.css("max-height","150px")),this._renderAddressList(),this},setFilter:function(e){e&&(e=$.trim(e.toLowerCase()),e.length<1&&(e=void 0)),e||(this.selectedID=void 0),this.fragment=e,this._updateFilteredCollection()},makeChoice:function(e){console.log("make choice");{var i,t,s;this.options,this.options.sendFilesUiModel}return this.isMSGraphBannerInFocus?this._onGetMSGraphContactsClick():(e?this.selectedID&&(i=this.filteredCollection.get(this.selectedID)):i=this.selectedID?this.filteredCollection.get(this.selectedID):this.filteredCollection.at(0),i&&(t=i.get("email"),s=i.get("name"),this._insertEmail(t,s),this._editControl.clear())),i},selectDown:function(){var i,t,s,n=this.filteredCollection,o=this.selectedID,a=this.$autoCList.scrollTop(),l=$(".us-share-auto-address").outerHeight(),r=6,d=6;e.Util.isCEF&&(r=n.length),s=this.options.sendFilesUiModel.get("enable_autoc_arrows"),s&&(o?(r>n.length&&(r=n.length),t=n.get(o),i=n.indexOf(t),-1===i?o=void 0:(r>i&&(i+=1,r>d&&this._keyboardScrollTo(a+l)),i>=r?(o=void 0,this.$getMSGraphContacts.is(":visible")&&!this.isMSGraphBannerInFocus&&(this.isMSGraphBannerInFocus=!0)):(t=n.at(i),o=t?t.id:void 0))):this.isMSGraphBannerInFocus?this.isMSGraphBannerInFocus=!1:(t=n.at(0),t?(o=t.id,this._keyboardScrollTo(0)):o=void 0),this.selectedID=o,this._renderAddressList())},selectUp:function(){var i,t,s,n=this.filteredCollection,o=this.selectedID,a=this.$autoCList.scrollTop(),l=6,r=6,d=$(".us-share-auto-address").outerHeight();e.Util.isCEF&&(l=n.length),s=this.options.sendFilesUiModel.get("enable_autoc_arrows"),s&&(o?(t=n.get(o),i=n.indexOf(t),-1===i?o=void 0:(i>=0&&(i-=1,l>r&&this._keyboardScrollTo(a-d)),0>i?o=void 0:(t=n.at(i),o=t?t.id:void 0))):this.$getMSGraphContacts.is(":visible")&&!this.isMSGraphBannerInFocus?(o=void 0,this.isMSGraphBannerInFocus=!0):(this.isMSGraphBannerInFocus=!1,l>n.length&&(l=n.length),l-=1,t=n.at(l),t?(o=t.id,l>=r&&this._keyboardScrollTo(l*d)):o=void 0),this.selectedID=o,this._renderAddressList())},_keyboardScrollTo:function(i){e.Util.isCEF()&&(this.$autoCList.stop(!0,!0),this.$autoCList.animate({scrollTop:i},1))},_initWrappers:function(){this.$autoCList=this.$(".us-popup-share-auto-c-list"),this.$getMSGraphContacts=this.$(".us-ms-graph-get-contacts-banner")},_renderAddressList:function(){var e,i,t=this.filteredCollection,s=this.$autoCList,n=this.selectedID;e=this._localAddressTemplate,i=this._addressTemplate,t.length&&this.$el.show(),s.empty(),t.each(function(t){var o,a="";t.id===n&&(a="selected"),o=_.isUndefined(t.get("name"))||""===t.get("name")?i({email:t.get("email"),specialClass:a,id:_.uniqueId("us-share-auto-address-"),ariaSelected:""===a?"false":"true"}):e({name:t.get("name"),email:t.get("email"),specialClass:a,id:_.uniqueId("us-share-auto-address-"),ariaSelected:""===a?"false":"true"}),s.append(o)}),this._renderGetMSGraphBanner(),t.length||this.$el.hide()},_renderGetMSGraphBanner:function(){this.options.appApi.rnaApi.done(_.bind(function(e){e.rnaMicrosoftGraphAPI.isMicrosoftGraphEnabled().then(_.bind(function(){this.options.appApi.sessionApi.isSignedInReader()&&e.rnaMicrosoftGraphAPI.isSignedInMicrosoftGraph().then(_.bind(function(e){e?this.$getMSGraphContacts.hide():(this.$getMSGraphContacts.show(),this.isMSGraphBannerInFocus?this.$getMSGraphContacts.addClass("selected"):this.$getMSGraphContacts.removeClass("selected"))},this),_.bind(function(){this.$getMSGraphContacts.hide()},this))},this),_.bind(function(){this.$getMSGraphContacts.hide()},this))},this))},_updateFilteredCollection:function(){var e,i=this.options.autoCCollection,t=this.filteredCollection,s=[],n="",o="",a=!1,l=this.options.sendFilesUiModel.get("pgcSuggestionsCollection");return l&&i.add(l.toJSON(),{merge:!0}),e=this.fragment,e&&e.length&&(s=i.filter(function(i){if(o=i.get("email"),a=0===o.indexOf(e),a===!1&&(n=i.get("name"),void 0!==n&&(n=n.toLowerCase(),a=0===n.indexOf(e.toLowerCase()),a===!1)))for(var t=n.split(" "),s=0;s<t.length&&(a=0===t[s].indexOf(e.toLowerCase()),a!==!0);++s);return a})),t.set(s),s},_onFilteredCChange:function(){if(this.filteredCollection.length>0){var e=this.filteredCollection.at(0);this.selectedID=e.id,this.isMSGraphBannerInFocus=!1}this._renderAddressList()},_onCollectionChange:function(){this._renderAddressList()},_onAddressClick:function(e){var i,t,s=$(e.target),o=this.options,a=this.options.sendFilesUiModel;i=s.attr("title"),t=s.attr("name"),this._insertEmail(i,t),this._editControl.clear(),a.get("autocomplete_eventual_click")||(o.appApi.siteCatalystApi.logScEvent([n.TOOLS,this.options.sendFilesUiModel.get("ShareVariant"),n.EMAIL,n.AUTOCOMPLETE,n.EVENTUAL_CLICK]),a.set("autocomplete_eventual_click",!0),a.set("autocomplete_avoided",!0)),a.get("autocomplete_immediate_click")||(o.appApi.siteCatalystApi.logScEvent([n.TOOLS,this.options.sendFilesUiModel.get("ShareVariant"),n.EMAIL,n.AUTOCOMPLETE,n.IMMEDIATE_CLICK]),a.set("autocomplete_immediate_click",!0))},_onGetMSGraphContactsClick:function(){this.options.appApi.rnaApi.done(_.bind(function(i){i.rnaUnifiedSharePopupAPI.hidePopup();var t=this.options.sendFilesUiModel.get("ShareVariant"),s=n.USE,o="Sign In to MSGraph";this.options.appApi.siteCatalystApi.logScEvent([t,s,o]),i.rnaMicrosoftGraphAPI.loginToMicrosoftGraph().then(_.bind(function(){var i=e.opFactory.create("MicrosoftGraphOutlookContactsOp",this.options),t=this.options.sendFilesUiModel.get("ShareVariant"),s=n.USE,o="Get MSGraph Contacts After Sign In";this.options.appApi.siteCatalystApi.logScEvent([t,s,o]),i.run().then(_.bind(function(e){var i=this.options.autoCCollection;i.add(e.toJSON(),{merge:!0}),this._renderGetMSGraphBanner()},this),_.bind(function(){},this))},this),_.bind(function(){this.isMSGraphBannerInFocus=!1},this))},this))},_onAddressScroll:function(){var e=this.options,i=this.options.sendFilesUiModel;i.get("autocomplete_scroll")||(e.appApi.siteCatalystApi.logScEvent([n.TOOLS,this.options.sendFilesUiModel.get("ShareVariant"),n.EMAIL,n.AUTOCOMPLETE,n.SCROLL]),i.set("autocomplete_scroll",!0),i.set("autocomplete_immediate_click",!0),i.set("autocomplete_avoided",!0))},_insertEmail:function(e,i){this.options.emailView.abortPGCRequest();this.options.autoCCollection.findWhere({email:e});this.options.emailView._setRecipientsFromText(e,i),this.setFilter(void 0),_.delay(_.bind(function(){this._editControl.focus(!0)},this),10)}}),i.AutocompleteView}),define("pdmplugins/unified-share/js/popupView/views/us-popup-email-addr-view",["core/ac-core","core/utils/view-util","pdmplugins/unified-share/js/ac-unified-share","pdmplugins/unified-share/js/popupView/templates/us-popup-email-addr-view-template","pdmplugins/unified-share/js/popupView/templates/us-popup-email-addr-view-template-add-signers","pdmplugins/unified-share/js/popupView/templates/us-popup-email-list-item-template","i18n!pdmplugins/unified-share/js/nls/ui-strings","pdmplugins/unified-share/js/popupView/views/us-popup-autocomplete-view","pdmplugins/unified-share/js/utils/sc-constants","core/utils/truncate","pdmplugins/unified-share/js/ops/get-from-addressbook-op","pdmplugins/unified-share/js/ops/get-from-addressbook-op"],function(e,i,t,s,n,o,a,l,r,d,p){return t.UsPopupEmailAddrView=e.View.extend({events:{"input .us-share-popup-address-input":"_onRecipientsInput","paste .us-share-popup-address-input":"_onRecipientsPaste","blur  .us-share-popup-address-input":"_onRecipientsBlur","click .share-popup-tool-frame":"_onShareAddressClick","click .share-email-list-close":"_onEmailListClose","focus .us-share-popup-address-input":"_onInputFocus","blur .us-share-popup-address-input":"_onInputBlur","click .us-share-popup-address-book":"_onAddressBookClick","click .share-email-list-name":"_onInputFocus"},_setTemplate:function(){this._template=_.template(t.QueryParams&&"SharePopup_RequestSignatures"===t.QueryParams.shareVariant&&"attachToEmail"===t.QueryParams.launchApp&&"attachToEmail"===this.options.sendFilesUiModel.get("US_tab_open")?n:s)},initialize:function(){e.View.prototype.initialize.call(this),this._setTemplate(),this._localAddressTemplate=_.template(o);var i=_.extend({},this.options,{searchString:""});this.PGCOp=e.opFactory.create("GettingPGCSuggestionsOp",i)},render:function(){var i;e.View.prototype.render.call(this);var s=this.options.sendFilesUiModel;if(!s.get("is_message_user_input")){var n="#send-mode"==s.get("us_mode")?a.SHARE_MESSAGE_PROMPT2:a.SHARE_MESSAGE_PROMPT_REVIEW2;s.set("us_message_text",n)}var o=s.get("us_subject_text"),n=s.get("us_message_text"),l=a.USM_IP_MESSAGE_BOX_PLACEHOLDER,r=!1;if(!t.QueryParams||"SharePopup_RequestSignatures"!==t.QueryParams.shareVariant&&"SharePopup_RequestSignatures_Disclosed"!==t.QueryParams.shareVariant||"attachToEmail"!==t.QueryParams.launchApp||"attachToEmail"!==this.options.sendFilesUiModel.get("US_tab_open")||(r=!0),r===!0&&(l=a.ADD_SIGNERS_MESSAGE_PLACEHOLDER,s.get("is_subject_user_input")||s.set("us_subject_text","#send-mode"==s.get("us_mode")?a.SHARE_INITIAL_SUBJECT:a.SHARE_INITIAL_SUBJECT_REVIEW)),0===this.$el.children().length){if(this.$el.html(this._template({SHARE_ADDRESS_HEADING:a.SHARE_ADDRESS_HEADING,SHARE_ADDRESS_PROMPT:a.USM_NAME_EMAIL_BOX_PLACEHOLDER,SHARE_INDIVIDUAL_HELP:a.SHARE_INDIVIDUAL_HELP,CLOSE:a.CLOSE,SHARE_INITIAL_SUBJECT_ARIA_LABEL:this._getSubjectInitialAriaLabel(),SHARE_INITIAL_SUBJECT:o,SHARE_MESSAGE_HEADING_ARIA_LABEL:this._getMessageInitialAriaLabel(),SHARE_MESSAGE_PROMPT:n,SHARE_MESSAGE_PROMPT_PLACEHOLDER:l,ADDED_MEMBERS:a.ADDED_RECIPIENT,SHARE_SUBTEXT:a.SHARE_SUBTEXT,USER_ADVISORY_MSG:a.USER_ADVISORY_MSG,ADDED_MEMBERS_MSG:a.SHARE_ACCORDIAN_SUMMARY_2,SUBJECT_TITLE:a.NAME_STRING,MESSAGE_TITLE:a.SHARE_MESSAGE_HEADING,ADDRESS_BOOK:a.ADDRESS_BOOK,ADDRESS_BOOK_LABEL:a.ADDRESS_BOOK_LABEL,ADD_SIGNERS_EMAIL_PLACEHOLDER:a.ADD_SIGNERS_PLACEHOLDER})),this._initWrappers(),r){this.$shareSubjectinput.one("input",this._onSubjectInputOnce),this.$shareSubjectinput.one("paste",this._onSubjectInputOnce),this.$(".share-popup-tool-frame").css("max-height","none");var d=a.ADD_SIGNERS_MESSAGE_PLACEHOLDER;this.$shareMessageInput.val(d)}this.$shareMessageInput.one("input",this._onMessageInputOnce),this.$shareMessageInput.one("paste",this._onMessageInputOnce),i=document.createElement("input"),void 0!==i.placeholder?this.$addressHeading.hide():this.$addressHeading.show(),e.Util.isCEF()&&(this.$addressHelpMsg.css("z-index","1000"),this.$autocompleteBox.css("z-index","1001"))}return this._addUiModelEventListeners(),this._addKeyEventListener(),this._renderChildViews(),$(".us-share-popup-address-input").one("focus",this._initialiseEmailAddFetching),this._updateEmailFields(),this._processRecipients(!0,!0),this},stopListening:function(i,t,s){e.View.prototype.stopListening.call(this,i,t,s),this.applyMethodRecursively("undelegateEvents"),this._removeUiModelEventListeners()},_initWrappers:function(){this.$addressHeading=this.$(".share-address-heading"),this.$emailErrorBubble=this.$(".sharing-email-error"),this.$addressHelpMsg=this.$(".share-address-help-msg"),this.$autocompleteBox=this.$(".us-share-popup-autocomplete-box"),this.$sharePopupEmailList=this.$(".share-popup-email-list"),this.$shareUserAdvisoryMessage=this.$("#share-user-advisory-message"),this.$addedMembers=this.$("#added-members"),this.$addedMembersMessage=this.$("#share-added-members-message"),this.$addedMembersListContainer=this.$("#added-members-list-container"),this.$removeButton=this.$(".share-email-list-close"),this.$usModeSelector=this.$("#us-mode-selector"),this.$shareSubjectinput=this.$(".us-share-popup-subject-input"),this.$shareMessageInput=this.$(".us-share-popup-message-input"),this.$usModeContentContainer=this.$("#us-mode-content-container"),this.$inputContainer=this.$(".us-share-popup-address-input-container"),this.$input=this.$(".us-share-popup-address-input"),this.$inputMask=this.$(".share-address-input-mask"),this.$searchEmailImg=this.$("#us-popup-search-email-img"),this.$usPopupEmailInputBox=this.$(".us-popup-email-input-box"),this.$usPopupAddressBookButton=this.$(".us-share-popup-address-book"),this.$placeholder=this.$input.attr("placeholder"),this.$smFileListContainer=this.$("#us-share-popup-subject-list")},_renderChildViews:function(){var e,i=this.options.sendFilesUiModel;i.get("enable_autocomplete")?(e=_.extend({},this.options,{emailView:this}),this.$autocompleteBox.show(),this._renderChildView("_autocompleteControl",l,this.$autocompleteBox,e)):(this._autocompleteControl&&this.removeChildView(this._autocompleteControl),this.$autocompleteBox.hide()),!t.QueryParams||"SharePopup_RequestSignatures"!==t.QueryParams.shareVariant&&"SharePopup_RequestSignatures_Disclosed"!==t.QueryParams.shareVariant||"attachToEmail"!==t.QueryParams.launchApp||"attachToEmail"!==this.options.sendFilesUiModel.get("US_tab_open")||this._renderChildView("_smfilelistview",t.UniShareFileListView,this.$smFileListContainer)},_detachChildViewsAndClear:function(){this._autocompleteControl&&this.removeChildView(this._autocompleteControl);var e=this.options.sendFilesUiModel.get("email_addr_collection");e.length>0&&e.reset()},_updateEmailFields:function(){{var e=this.options.sendFilesUiModel;"share"===e.get("US_tab_open")}this.$el.removeClass("disabled"),this.$addressHeading.removeAttr("disabled"),this.enable(!0)},_onEmailListClose:function(e){var i,t,s=$(e.target),n=this.options.sendFilesUiModel.get("email_addr_collection"),o=this.options.sendFilesUiModel.get("ShareVariant"),a=r.USE,l="Remove User";this.options.appApi.siteCatalystApi.logScEvent([o,a,l]),i=s.data("asset-id"),i&&(t=n.get(i),n.remove(t)),this._updateAddedMembersText(n.length)},_processRecipients:function(e,i){var t=this.options.sendFilesUiModel.get("email_addr_collection");t.length>0?(this.$shareUserAdvisoryMessage.show(),this._toggleSubjectAndMessageVisibility(!0),this.$searchEmailImg.hide(),this.$input.css("margin-left","4px"),this.$input.removeAttr("placeholder")):(this.$shareUserAdvisoryMessage.hide(),this.$searchEmailImg.show(),this.$input.css("margin-left","20px"),this.$input.attr("placeholder",this.$placeholder)),i===!0&&this.focus(!0),this._renderEmailList(t),this._updateInputEmailTextAreaWidth()},_renderEmailList:function(i){var t,s,n,o,l,r=this.$sharePopupEmailList,p=this.options.sendFilesUiModel,h=(p.get("view_mode"),this.options,this._computeMaxAvailWidth());if(e.Util.isCEF()&&r.show(),r.children(".share-popup-email-list-item").remove(),i.each(_.bind(function(e){s=e.get(e.get("name")?"name":"email"),n=e.get("email"),l=e.get("valid"),o=this._localAddressTemplate({name:s,email:n,remove:a.SHARE_EMAIL_REMOVE,asset_id:e.cid,ariaRemoveLabel:this._getRemoveAriaLabel(s)}),s&&l?0==r.children(".share-popup-email-list-item").length?r.prepend(o):r.children(".share-popup-email-list-item").last().after(o):l||i.remove(e)},this)),_.each(this.$(".share-email-list-name"),function(e){t=$(e);var i={truncateFromRight:!0,truncateFromExt:!1,ellipsis:"...",maxIterations:10};d.truncateElementText(t,h-$(".share-email-list-close").width(),i)}),this._updateAddedMembersText(i.length),this.$(".us-popup-email-input-box").last().offset()){var c=this.$(".us-popup-email-input-box").last().offset().top;r.scrollTop(c)}},_updateAddedMembersText:function(e){void 0!=e&&e>=0&&this.$addedMembers.html(a.ADDED_RECIPIENT_NO_COUNT+" ("+e+")")},_updateSubjectFromModel:function(){var e=this.options.sendFilesUiModel;0==e.get("is_subject_user_input")&&this.setSubject(!t.QueryParams||"SharePopup_RequestSignatures"!==t.QueryParams.shareVariant&&"SharePopup_RequestSignatures_Disclosed"!==t.QueryParams.shareVariant||"attachToEmail"!==t.QueryParams.launchApp||"attachToEmail"!==this.options.sendFilesUiModel.get("US_tab_open")?e.get("us_subject_text"):e.get("filename"))},_updateMessageFromModel:function(){var e=this.options.sendFilesUiModel;this.setMessage(e.get("us_message_text"))},_getRemoveAriaLabel:function(e){return _.template(a.GENERIC_ARIA_LABEL_STRING,{prefix:e,suffix:a.SHARE_EMAIL_REMOVE})},_initialiseEmailAddFetching:function(){var i=this.options,s=i.sendFilesUiModel,n=(i.limitsModel,this._getResolvedPromise());this._displayIPMToUser=!1,s.set({is_individual:!0}),e.Util.isCEF()&&s.get("autocomplete_local_contacts_imported")===!1&&(n=this._importLocalEmailContacts(),n.then(_.bind(function(){s.set({autocomplete_local_contacts_imported:!0})},this))),e.Util.isCEF()&&s.get("autocomplete_cloud_contacts_imported")===!1&&this.options.appApi.sessionApi.isSignedInReader()&&t.opFactory.create("DesktopFetchingAutocompleteListOp",this.options).run().then(_.bind(function(){s.set({autocomplete_cloud_contacts_imported:!0})},this)),e.Util.isCEF()&&s.get("autocomplete_msgraph_contacts_imported")===!1&&this.options.appApi.rnaApi.done(_.bind(function(i){i.rnaMicrosoftGraphAPI.isMicrosoftGraphEnabled().done(_.bind(function(){i.rnaMicrosoftGraphAPI.isSignedInMicrosoftGraph().done(_.bind(function(i){if(i){var t=e.opFactory.create("MicrosoftGraphOutlookContactsOp",this.options),n=this.options.sendFilesUiModel.get("ShareVariant"),o=r.USE,a="Get MSGraph Contacts for SignedIn User";this.options.appApi.siteCatalystApi.logScEvent([n,o,a]),t.run().then(_.bind(function(e){var i=this.options.autoCCollection;i.add(e.toJSON(),{merge:!0}),s.set({autocomplete_msgraph_contacts_imported:!0})},this),_.bind(function(){},this))}},this))},this))},this))},_toggleSubjectAndMessageVisibility:function(e){e?(this.$shareMessageInput.show(),this.$addedMembers.show(),this.$addedMembersMessage.hide(),this.$addedMembersListContainer.show()):(this.$shareMessageInput.hide(),this.$addedMembers.hide(),this.$addedMembersMessage.hide(),this.$addedMembersListContainer.hide())},_importLocalEmailContacts:function(){return this.options.appApi.rnaApi.then(_.bind(function(e){return e.stApi.getOutlookAutoCompleteListAtIdleAPI().then(_.bind(function(e){return e._addEventListener("custom:onOutlookAddressesFetchComplete",_.bind(function(e,i){var t=i.params,s=t.split(";"),n="",o="",a=-1,l=this.options.autoCCollection;this._enablePopupAutoHide(),s.pop(),_.each(s,function(e){a=_.lastIndexOf(e,"<"),-1===a?(o=e,n=""):(o=e.substring(a+1),n=e.substring(0,a)),">"===_.last(o)&&(o=o.slice(0,-1))," "===_.last(n)&&(n=n.slice(0,-1)),l.get(o)&&l.remove(o),l.add({email:o,name:n,isLocalContact:!0})})},this)),$.Deferred().resolve().promise()},this),_.bind(function(){return this._enablePopupAutoHide(),$.Deferred().reject().promise()},this))},this),_.bind(function(){return $.Deferred().reject().promise()},this))},_addUiModelEventListeners:function(){var e=this.options.sendFilesUiModel;e.get("email_addr_collection").on("all",this._onRecipientsChange),e.on("change:enable_autocomplete",this._onEnableAutocompleteChange),e.on("change:us_message_text",this._updateMessageFromModel),!t.QueryParams||"SharePopup_RequestSignatures"!==t.QueryParams.shareVariant&&"SharePopup_RequestSignatures_Disclosed"!==t.QueryParams.shareVariant||"attachToEmail"!==t.QueryParams.launchApp||"attachToEmail"!==this.options.sendFilesUiModel.get("US_tab_open")||e.on("change:us_subject_text",this._updateSubjectFromModel)},_removeUiModelEventListeners:function(){var e=this.options.sendFilesUiModel;e.get("email_addr_collection").off("all",this._onRecipientsChange),e.off("change:enable_autocomplete",this._onEnableAutocompleteChange)},_onViewEvent:function(i,t){"CHICKLET_REMOVED"===i&&this._onChickletRemoved(),e.View.prototype._onViewEvent.call(this,i,t)},_onRecipientsChange:function(){this._onDebouncedRecipientsChange()},_onDebouncedRecipientsChange:function(){this._processRecipients(!0,!0)},_getSubjectInitialAriaLabel:function(){return this._getAriaLabelForDesktop(a.NAME_STRING,this.options.sendFilesUiModel.get("us_subject_text"))
},_getMessageInitialAriaLabel:function(){return this._getAriaLabelForDesktop(a.SHARE_MESSAGE_HEADING,this.options.sendFilesUiModel.get("us_message_text"))},_getAriaLabelForDesktop:function(e,i){return _.template(a.GENERIC_ARIA_LABEL_STRING,{prefix:e,suffix:i})},_onEnableAutocompleteChange:function(){this._renderChildViews()},_addKeyEventListener:function(){this.options.appApi.keyApi.pushKeyHandler(this);this.options.appApi.localeApi.getLocale()},_removeKeyEventListener:function(){this.options.appApi.keyApi.popKeyHandler(this)},_onKeyDown:function(e){var i=!1,t=e.which,s=!1,n=this.$input;return this.$input.is(":focus")?(this._updateInputEmailTextAreaWidth(),13===t?this._autocompleteControl&&(this._autocompleteControl.makeChoice(!1)||_.defer(_.bind(function(){this.abortPGCRequest(),this._setRecipientModels()},this))):9===t?this._autocompleteControl&&!e.shiftKey&&this._autocompleteControl.makeChoice()&&(i=!0):8===t?this.hasText()||(this.removeLastRecipient(),i=!0):40===t?this._autocompleteControl&&(this._autocompleteControl.selectDown(),s=!0,i=!0):38===t?this._autocompleteControl&&(this._autocompleteControl.selectUp(),s=!0,i=!0):27===t&&this._autocompleteControl&&(this._autocompleteControl.filteredCollection.length?(this._autocompleteControl.setFilter(void 0),i=!0):i=!1),s?n.attr("aria-activedescendant",this._autocompleteControl.$(".selected").attr("id")):n.removeAttr("aria-activedescendant"),i&&this._consumeEvent(e),i):i},_onKeyup:function(e){var i=!1,t=e.which;return this.$input.is(":focus")?(32===t&&(i=!0,_.defer(_.bind(function(){this._setRecipientModels(!0)},this))),i):i},_updateInputEmailTextAreaWidth:function(){var e=this.options.sendFilesUiModel.get("email_addr_collection");if(0==e.length)return void this.$usPopupEmailInputBox.css("width","95%");var i,t=8*this.val().length+10,s=this.$usPopupEmailInputBox.width(),n=this.$sharePopupEmailList.width()-25;t=t?t:10,t>s&&n>t&&(i=t+32,i>n&&(i=n),this.$usPopupEmailInputBox.css("width",i+"px"))},_restoreInputEmailTextAreaWidth:function(){var e=this.options.sendFilesUiModel.get("email_addr_collection");if(0==e.length)return void this.$usPopupEmailInputBox.css("width","95%");{var i;this.$sharePopupEmailList.width()}0==this.val().length&&(i=4,this.$usPopupEmailInputBox.css("width",i+"px"))},_changeTextColor:function(e){e?($("#us-share-popup-address-input").removeClass("theme-share-input-text"),$("#us-share-popup-address-input").addClass("theme-text")):($("#us-share-popup-address-input").removeClass("theme-text"),$("#us-share-popup-address-input").addClass("theme-share-input-text"))},_setAutocompleteFilterValue:function(e){this._autocompleteControl&&(this.options.appApi.sessionApi.isSignedInReader()?""!==e?(this._autocompleteControl.setFilter(e),this.PGCOp.updateSearchString(e),this.PGCOp.run().then(_.bind(function(i){i.length>0&&(this.options.sendFilesUiModel.set("pgcSuggestionsCollection",i),this._autocompleteControl.setFilter(e))},this))):(this.abortPGCRequest(),this._autocompleteControl.setFilter(e)):this._autocompleteControl.setFilter(e))},abortPGCRequest:function(){this.options.appApi.sessionApi.isSignedInReader()&&(this.PGCOp.updateSearchString(""),this.PGCOp.run())},removeLastRecipient:function(){var e=this.options.sendFilesUiModel.get("email_addr_collection");e.pop()},_onRecipientsInput:function(){var e=this.val();this._changeTextColor(e),this._setAutocompleteFilterValue(e)},_onRecipientsPaste:function(){setTimeout(_.bind(function(){var e=this.val();this._changeTextColor(!0),this._setRecipientModels(),e=this.val(),this._setAutocompleteFilterValue(),this._updateInputEmailTextAreaWidth()},this),10)},_onRecipientsBlur:function(){return this._setRecipientModels(),this._autocompleteControl&&this._autocompleteControl.setFilter(void 0),!0},_setRecipientModels:function(e){var i=this.val();_.isUndefined(e)||!e||i.match(/.*@.*/)||(i+=" "),this._setRecipientsFromText(i)},_setRecipientsFromText:function(i,t){var s,n,o=this.options,a=o.sendFilesUiModel;if(e.Util.isCEF()&&i.match(/.+\s$/)&&0!==this._autocompleteControl.filteredCollection.length&&!i.match(/.*@.*|.+\s\s$/))return void this.setValue(i);if(i=i.replace(/(\r\n|\n|\r)/gm,""),s=i.split(i.match(/(<\S+>)/)?/\s*[,;]+\s*/:/\s*[,;\s]+\s*/),n=a.parseEmailArray(s,t),n.length>0)if(console.log(n[0].get("valid")),0==n[0].get("valid"));else{a.addRecipientsToCollection(n),this.clear();var l=this.options.sendFilesUiModel.get("ShareVariant"),d=r.USE,p="Add user";o.appApi.siteCatalystApi.logScEvent([l,d,p]),o.appApi.siteCatalystApi.logScEvent([r.TOOLS,this.options.sendFilesUiModel.get("ShareVariant"),r.EMAIL,r.CHICKLET_ADDED]),a.get("autocomplete_avoided")||(o.appApi.siteCatalystApi.logScEvent([r.TOOLS,this.options.sendFilesUiModel.get("ShareVariant"),r.EMAIL,r.AUTOCOMPLETE,r.AVOIDED]),a.set("autocomplete_avoided",!0))}},_onInputFocus:function(){this.$input.addClass("focus"),this._updateInputEmailTextAreaWidth()},_onInputBlur:function(){this.$input.removeClass("focus"),this._restoreInputEmailTextAreaWidth()},_onAddressBookClick:function(){var e,i,t,s=this.options.sendFilesUiModel.get("ShareVariant"),n=r.USE,o="Select Address Book";this._disablePopupAutoHide(),this.options.appApi.siteCatalystApi.logScEvent([s,n,o]),t=_.extend({},this.options),i=new p(t),e=i.run(),e.then(_.bind(function(e){this._setRecipientsFromText(e),this._enablePopupAutoHide()},this),_.bind(function(){this._enablePopupAutoHide()},this))},_onSubjectInputOnce:function(){var e=this.options.sendFilesUiModel.get("ShareVariant"),i=r.USE,t="Add subject";this.options.appApi.siteCatalystApi.logScEvent([e,i,t]),this.options.sendFilesUiModel.set("is_subject_user_input",!0),this.$shareSubjectinput.removeClass("theme-share-input-text"),this.$shareSubjectinput.addClass("theme-text")},_onMessageInputOnce:function(){var e=this.options.sendFilesUiModel.get("ShareVariant"),i=r.USE,t="Add message";console.log("_onMessageInputOnce"),this.options.appApi.siteCatalystApi.logScEvent([e,i,t]),this.options.sendFilesUiModel.set("is_message_user_input",!0),this.$shareMessageInput.removeClass("theme-share-input-text"),this.$shareMessageInput.addClass("theme-text")},_resetMessageInput:function(){this.options.sendFilesUiModel.set("is_message_user_input",!1),this.$shareMessageInput.addClass("theme-share-input-text"),this.$shareMessageInput.removeClass("theme-text"),this.$shareMessageInput.one("input",this._onMessageInputOnce),this.$shareMessageInput.one("paste",this._onMessageInputOnce)},_getSubjectText:function(){var e=this.$shareSubjectinput.val();return e.toString().normalize("NFC")},_focusOnEmailTextarea:function(){this.$("#us-share-popup-address-input-nv").focus()},_focusOnSubjectArea:function(){this.$shareSubjectinput.focus()},_blurOnMessageArea:function(){this.$shareMessageInput.blur()},_focusOnMessageArea:function(){this.$shareMessageInput.focus()},setSubject:function(e){this.$shareSubjectinput.val(e),this.$shareSubjectinput.attr("aria-label",this._getSubjectInitialAriaLabel()),!t.QueryParams||"SharePopup_RequestSignatures"!==t.QueryParams.shareVariant&&"SharePopup_RequestSignatures_Disclosed"!==t.QueryParams.shareVariant||"attachToEmail"!==t.QueryParams.launchApp||"attachToEmail"!==this.options.sendFilesUiModel.get("US_tab_open")||(this.$shareSubjectinput.attr("title",e),this.$shareSubjectinput.html(e))},_getMessageText:function(){var e=this.$shareMessageInput.val();return e.normalize("NFC")},setMessage:function(e){this.$shareMessageInput.val(e),this.$shareMessageInput.attr("aria-label",this._getMessageInitialAriaLabel())},_onShareAddrHelp:function(){var e=this.options.sendFilesUiModel;e.set({display_individual_help:!0})},_onShareAddrMsgClose:function(){var e=this.options.sendFilesUiModel;e.set({display_individual_help:!1}),this.focus(!0)},_onShareAddressClick:function(){this.focus(!0)},_onChickletRemoved:function(){this.focus(!0)},_computeMaxAvailWidth:function(){return 200},val:function(){return this.$input.val()||""},hasText:function(){return this.$input.val().length>0},setValue:function(e){this.$input.val(e)},enable:function(e){e?(this.$input.removeAttr("disabled"),this.$inputMask.hide(),this.$usPopupAddressBookButton.removeAttr("disabled"),this.$shareMessageInput.removeAttr("disabled"),this.$(".share-email-list-close").removeAttr("disabled"),this.$(".share-popup-email-list-item").removeClass("disabled")):(this.$input.attr({disabled:"disabled"}),this.$inputMask.show(),this.$usPopupAddressBookButton.attr({disabled:"disabled"}),this.$shareMessageInput.attr({disabled:"disabled"}),this.$(".share-email-list-close").attr({disabled:"disabled"}),this.$(".share-popup-email-list-item").addClass("disabled"))},focus:function(){this.$input.addClass("focus"),this.$input.focus()},clear:function(){this.$input.val(""),this._restoreInputEmailTextAreaWidth()},_disablePopupAutoHide:function(){this.options.appApi.rnaApi.done(_.bind(function(e){e.rnaUnifiedSharePopupAPI.setPopupAutoHide("false")},this))},_enablePopupAutoHide:function(){this.options.appApi.rnaApi.done(_.bind(function(e){e.rnaUnifiedSharePopupAPI.setPopupAutoHide("true")},this))}}),t.UsPopupEmailAddrView}),define("pdmplugins/unified-share/js/popupView/templates/us-popup-deadline-selector-template",[],function(){return'<div class = "us-popup-error-dialog-container us-popup-deadline-error-dialog ui-theme theme-share-border">           <span class = "us-popup-error-dialog-arrow us-popup-error-dialog-deadline-arrow"></span>           <div class="us-popup-error-dialog-content us-popup-deadline-error-dialog-content">               <div class= "us-popup-error-dialog-content-text"></div>           </div>       </div>       <div class="us-popup-checkbox-cell" id="deadline-selector">           <div  id="popup-select-deadline" class=" popup-select-deadline-text  ui-theme theme-text" tabindex="-1"></div>           <span class = "popup-select-date ui-theme theme-share-add-files" id= "deadline-selected" tabindex="0"><%= SELECT_DEADLINE %></span>       </div>		<div class = "popup-date-selector-container popup-deadline-selector-container"></div>       <div class = "us-popup-error-dialog-container us-popup-reminder-error-dialog ui-theme theme-share-border">           <span class = "us-popup-error-dialog-arrow us-popup-error-dialog-reminder-arrow"></span>           <div class="us-popup-error-dialog-content us-popup-reminder-error-dialog-content">               <div class= "us-popup-error-dialog-content-text"></div>           </div>       </div> 		<div class="us-popup-checkbox-cell" id="reminder-selector">           <div  id="popup-select-reminder" class=" popup-select-reminder-text  ui-theme theme-text" tabindex="-1"></div>           <span class = "popup-select-date ui-theme theme-share-add-files" id= "reminder-selected" tabindex="-1"><%= SELECT_REMINDER %></span>       </div>		<div class = "popup-date-selector-container popup-reminder-selector-container"></div>'}),define("pdmplugins/unified-share/js/popupView/templates/us-popup-date-selector-template",[],function(){return'<div class="ui-theme theme-text date-calender popup-date-calendar" id="us-date-calender"><div><button class="dialog-close-btn" tabindex="0"><span class="hidden-accessible"><%- close %></span></button></div><table><tr><td><div class ="date-calender-left-div"><div class="dateLabelFrom"><label for="from-date"><%- from %></label><span class="invalid-from-date-error hide">*<%- invalidDate %></span></div><input class="dateInput ui-theme theme-share-container theme-text" type="text" id="from-date" placeholder="MM/DD/YYYY" tabindex="0"/><div class="dateLabelTo"><label for="to-date"><%- to %></label><span class="invalid-to-date-error hide">*<%- invalidDate %></span></div><input class="dateInput ui-theme theme-share-container theme-text" type="text" id="to-date" placeholder="MM/DD/YYYY" tabindex="0"/><div class="date-div-go" ><button class = "date-calender-action-go" tabindex="0"><%- go %></button><span class="invalid-date-range-error hide">*<%- invalidDateRange %></span></div></div></td><td><div id="date-calender-month-view"><div class="header"><button class="left navButton usNavButton core-down-triangle" id="prev" style="font-size: 8px;" tabindex="0" title = "<%- prevMonth %>" aria-label = "<%- prevMonth %>" ></button><span class="left hook"></span><span class="month-year"></span><span class="right hook" id=""></span><button class="right navButton usNavButton core-down-triangle" id="next" style="font-size: 8px;" tabindex="0" title = "<%- nextMonth %>" aria-label = "<%- nextMonth %>" ></button></div><table id="week-days"><tr><td>Su</td><td>Mo</td><td>Tu</td><td>We</td><td>Th</td><td>Fr</td><td>Sa</td></tr></table><div class="month-dates"><table class="curr"><tr class="week"><td class="day"></td><td class="day"></td><td class="day"></td><td class="day"></td><td class="day"></td><td class="day"></td><td class="day"></td></tr><tr class="week"><td class="day"></td><td class="day"></td><td class="day"></td><td class="day"></td><td class="day"></td><td class="day"></td><td class="day"></td></tr><tr class="week"><td class="day"></td><td class="day"></td><td class="day"></td><td class="day"></td><td class="day"></td><td class="day"></td><td class="day"></td></tr><tr class="week"><td class="day"></td><td class="day"></td><td class="day"></td><td class="day"></td><td class="day"></td><td class="day"></td><td class="day"></td></tr><tr class="week"><td class="day"></td><td class="day"></td><td class="day"></td><td class="day"></td><td class="day"></td><td class="day"></td><td class="day"></td></tr><tr class="week"><td class="day"></td><td class="day"></td><td class="day"></td><td class="day"></td><td class="day"></td><td class="day"></td><td class="day"></td></tr></table></div></div></td></tr></table><div class="react-spectrum-Datepicker-clockContainer"><div class="react-spectrum-Clock "><input type="number" class="spectrum-Textfield clock-hour ui-theme theme-text theme-share-container" aria-label= "<%= HOURS_LABEL %>" placeholder="HH" min="0" max="23" value=""/><div class="react-spectrum-Clock-divider">:</div><input type="number" class="spectrum-Textfield clock-minute ui-theme theme-text theme-share-container" aria-label= "<%= MINUTES_LABEL %>" placeholder="mm" min="0" max="59" value=""/><button class="date-selector-del-button button-grey ui-theme theme-share-grey-button" aria-label= "<%= DELETE %>" aria-describedby="date-selector-del-button" ><%= DELETE %></button><button class="date-selector-go-button button-grey ui-theme theme-share-grey-button" aria-label= "<%= SAVE %>" aria-describedby="date-selector-go-button" ><%= SAVE %></button><button class="date-selector-cancel-button button-grey ui-theme theme-share-grey-button" aria-label= "<%= CANCEL %>" aria-describedby="date-selector-cancel-button" ><%= CANCEL %></button></div></div></div>'}),define("pdmplugins/unified-share/js/popupView/views/us-popup-date-selector",["core/ac-core","core/utils/view-util","pdmplugins/unified-share/js/ac-unified-share","pdmplugins/unified-share/js/popupView/templates/us-popup-date-selector-template","i18n!pdmplugins/unified-share/js/nls/ui-strings","i18n!core/nls/ui-strings","pdmplugins/unified-share/js/utils/sc-constants","pdmplugins/unified-share/js/utils/us-utils","pdmplugins/unified-share/js/ops/check-deadline-reminder-error-op","pdmplugins/unified-share/js/views/us-date-selector"],function(e,i,t,s,n,o,a){return t.USPopupDateSelector=t.USDateSelector.extend({initialize:function(){e.DialogView.prototype.initialize.call(this),this._template=_.template(s)({custom:o.CUSTOM,close:o.CLOSE,from:o.FROM,to:o.TO,go:o.GO,invalidDate:o.INVALID_DATE,invalidDateRange:o.INVALID_DATE_RANGE,prevMonth:o.PREVIOUS_MONTH,nextMonth:o.NEXT_MONTH,HOURS_LABEL:this._updateAccessibilityForHour(),MINUTES_LABEL:this._updateAccessibilityForMinutes(),SAVE:o.SAVE,DELETE:o.DELETE,CANCEL:o.CANCEL}),this._currentMonthView=null,this._currentYearView=null,this._currentActiveDateElement=1},_getAriaLabelForTime:function(e,i){return _.template(n.GENERIC_ARIA_LABEL_STRING,{prefix:e,suffix:i})},_updateAccessibilityForHour:function(){var e=this._getAriaLabelForTime(this.$(".clock-hour").val(),o.HOUR);return this.$(".clock-hour").attr("aria-label",e),e},_updateAccessibilityForMinutes:function(){var e=this._getAriaLabelForTime(this.$(".clock-minute").val(),o.MINUTES);return this.$(".clock-minute").attr("aria-label",e),e},render:function(){return e.DialogView.prototype.render.call(this),this._appendToDialog(this._template),this._initWrappers(),this._initAdditionalWrappers(),this._fillCurrentMonthCalender(),this._updateLocalDates(),this._setCss(),this._updateTimeInUI(),this._setDefaultDate(),this._addUiEventListeners(),this._goToSetDateMonth(),this.__toggleButtonsVisibilityAndText(),this._adjustLayout(),this.$usPopupView.addClass("popup-for-calendar"),this},_initAdditionalWrappers:function(){this.$clockHour=this.$(".clock-hour"),this.$clockMinute=this.$(".clock-minute"),this.$usPopupView=$("#us-popup-view"),this.$day=this.$(".day"),this.$dateSelectorGoButton=this.$(".date-selector-go-button"),this.$dateSelectorDELButton=this.$(".date-selector-del-button"),this.$dateSelectorCancelButton=this.$(".date-selector-cancel-button"),this.$spectrumTextField=this.$(".spectrum-Textfield")},_setCss:function(){this.$dlg.width("280px"),this.$dlg.css("min-width","280px"),this.$dlg.css("padding","0px 0px 10px 0px"),this.$dlg.css("font-size","12px"),this.$dlg.css("box-shadow","0px 1px 4px rgba(0, 0, 0, 0.15)"),this.$titleBar.hide(),"deadline"===this.options.mode?(this.$dlg.css("margin-left","-340px"),this.$dlg.css("margin-top","-260px")):(this.$dlg.css("margin-left","-340px"),this.$dlg.css("margin-top","-290px"))},_updateCss:function(){"deadline"===this.options.mode&&"checkbox"===this.options.origin&&this.$dlg.css("margin-left","-300%")},_updateTimeInUI:function(e){var i,t="deadline"===this.options.mode?"23":"18",s="deadline"===this.options.mode?"59":"00",n=this.options.mode,o=this.options.origin;("hyperlink"===o||e)&&(i=this.getLocalDate(n),t=this._prefixZero(i.getHours()),s=this._prefixZero(i.getMinutes())),this.$clockHour.val(t),this.$clockMinute.val(s)},_addUiEventListeners:function(){$("#popup-mask").on("click",this._onCalCloseClick),$(".date-selector-cancel-button").on("click",this._onCalCloseClick),$(".clock-hour").on("change",this._updateAccessibilityForHour),$(".clock-minute").on("change",this._updateAccessibilityForMinutes),this.$spectrumTextField.on("input",this._onTimeInput),this.$day.hover(this._onDateHover,void 0),this.$dateSelectorGoButton.on("click",this._updateDateBeenSelected),this.$dateSelectorDELButton.on("click",this._onDeleteClick)},_onDeleteClick:function(){"deadline"===this.options.mode?(this.options.sendFilesUiModel.set("set_reminder",!1),this.options.sendFilesUiModel.set("set_deadline",!1),this.options.sendFilesUiModel.set("reminder",""),this.options.sendFilesUiModel.set("deadline","")):(this.options.sendFilesUiModel.set("set_reminder",!1),this.options.sendFilesUiModel.set("reminder","")),this.clearLocalDate(),this._onCalCloseClick()},_updateDateBeenSelected:function(){"deadline"===this.options.mode?(this.options.sendFilesUiModel.set("set_deadline",!0),this.options.sendFilesUiModel.set("deadline",this.deadline)):(this.options.sendFilesUiModel.set("set_reminder",!0),this.options.sendFilesUiModel.set("reminder",this.reminder)),this._setSelectedTime(),this._onCalCloseClick()},__toggleButtonsVisibilityAndText:function(){"checkbox"===this.options.origin?(this.$dateSelectorGoButton.text(o.SAVE),this.$dateSelectorCancelButton.show(),this.$dateSelectorDELButton.hide()):(this.$dateSelectorGoButton.text(n.USM_UPDATE),this.$dateSelectorDELButton.show(),this.$dateSelectorCancelButton.hide())},_adjustLayout:function(){this._areButtonsOverflowing()&&(this.$dateSelectorDELButton.css({padding:"0px 6px 0px 6px","font-size":"11px"}),this.$dateSelectorGoButton.css({padding:"0px 6px 0px 6px","font-size":"11px"}),this.$dateSelectorCancelButton.css({padding:"0px 6px 0px 6px","font-size":"11px","margin-right":"5px"})),this._areButtonsOverflowing()&&(this.$dateSelectorDELButton.css({padding:"0px 2px 0px 2px","font-size":"10px"}),this.$dateSelectorGoButton.css({padding:"0px 2px 0px 2px","font-size":"10px"}),this.$dateSelectorCancelButton.css({padding:"0px 2px 0px 2px","font-size":"10px","margin-right":"5px"}))},_areButtonsOverflowing:function(){if(this.$dateSelectorGoButton.position()&&this.$dateSelectorCancelButton.position()&&this.$dateSelectorDELButton.position()){var e=this.$dateSelectorGoButton.position().top,i=this.$dateSelectorCancelButton.position().top>0?this.$dateSelectorCancelButton.position().top:this.$dateSelectorDELButton.position().top;return e!=i?!0:!1}return!1},_goToSetDateMonth:function(){var e=this.getLocalDate(this.options.mode);this._createMonthCalender(e.getMonth(),e.getFullYear())},_showSelection:function(){var e,i,t=this.deadline,s=this.reminder,n=this._currentYearView,o=this._currentMonthView,a=this.options.mode,l=new Date,r=new Date(l.getFullYear(),l.getMonth(),l.getDate()),d=this._getTitleForDate;e="deadline"===a?t:s,e&&(isNaN(e)||$(".curr tr").each(function(){$("td",this).each(function(){var s=this;if($(this).removeClass("disabled"),$(this).removeClass("selected"),$(this).removeClass("today"),$(this).removeClass("ui-theme theme-calendar-day"),$(this).removeClass("theme-keyboard-focus"),""!=s.innerHTML){i=d(n,o,s.innerHTML),$(this).attr("aria-label",i),$(this).addClass("ui-theme theme-calendar-day");var l=new Date(n,o,s.innerHTML);l.valueOf()==r.valueOf()&&$(this).addClass("today"),l.getDate()==e.getDate()&&l.getMonth()==e.getMonth()&&l.getFullYear()==e.getFullYear()?($(this).addClass("selected"),$(this).focus()):r>l||"reminder"===a&&l>=t?($(this).addClass("disabled"),$(this).removeClass("ui-theme theme-calendar-day")):($(this).removeClass("disabled"),$(this).removeClass("selected"))}})}))},_onCalFrameDblClick:function(e){var i=e.target;i.className.includes("day")&&0==i.className.includes("disabled")&&this._updateDateBeenSelected()},_onCalCloseClick:function(){var e=new t.CheckDeadlineReminderErrorOp({uiModel:this.options.sendFilesUiModel,appApi:this.options.appApi,returnPromise:!1}),i=e.run();this.$usPopupView.removeClass("popup-for-calendar"),$(".date-selector-cancel-button").off("click",this._onCalCloseClick),$("#popup-mask").off("click",this._onCalCloseClick),this.close(!1),i.isError&&this.showErrorBubble(i.errorType,i.errTitle,i.errMessage)},_setDefaultDate:function(){if("checkbox"===this.options.origin){var e=new Date;if("deadline"===this.options.mode)this._setTime(e),this.setLocalDate(this.options.mode,e);else{var i,t,s=6e4,n=this.options.sendFilesUiModel.get("deadline"),o=new Date(e.getFullYear(),e.getMonth(),e.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds());n>o||e.getHours()>=18||60*s>=n-e?(i=new Date(n.valueOf()-60*s),e>i&&(i=new Date(e.valueOf()+2e4)),this.setLocalDate(this.options.mode,i),this._updateTimeInUI(!0)):(t=new Date(n.getFullYear(),n.getMonth(),n.getDate()),this.setLocalDate(this.options.mode,t),this._setTime(t))}}this._updateAccessibilityForHour(),this._updateAccessibilityForMinutes(),this._showSelection()},_onCalFrameClick:function(e){var i=$(e.target);if(i.attr("title")){var t=new Date(this._currentYearView,this._currentMonthView,i.text()),s=new Date,n=new Date(s.getFullYear(),s.getMonth(),s.getDate());this._setTime(t),t>=n&&("deadline"===this.options.mode||t<=this.getLocalDate("deadline"))&&this.setLocalDate(this.options.mode,t),this._showSelection()}},setLocalDate:function(e,i){"deadline"===e?this.deadline=i:this.reminder=i},getLocalDate:function(e){return"deadline"===e?this.deadline:this.reminder},clearLocalDate:function(){this.deadline="",this.reminder=""},_updateLocalDates:function(){"checkbox"===this.options.origin&&"deadline"===this.options.mode?this.clearLocalDate():"checkbox"===this.options.origin&&"reminder"===this.options.mode?(this.deadline=this.options.sendFilesUiModel.get("deadline"),this.reminder=""):(this.deadline=this.options.sendFilesUiModel.get("deadline"),this.reminder=this.options.sendFilesUiModel.get("reminder"))},showErrorBubble:function(e,i,t){return $("#us-popup-view").on("click",this.hideErrorBubble),e==a.DEADLINE_ERROR?($(".us-popup-deadline-error-dialog").show(),$(".us-popup-deadline-error-dialog").find(".us-popup-error-dialog-content-text").text(t)):e==a.REMINDER_ERROR&&($(".us-popup-reminder-error-dialog").show(),$(".us-popup-reminder-error-dialog").find(".us-popup-error-dialog-content-text").text(t)),$("#us-popup-view").addClass("popup-for-error-dialog"),$.Deferred().resolve().promise()},hideErrorBubble:function(){$("#us-popup-view").off("click",this.hideErrorBubble),$(".us-popup-error-dialog-container:visible").hide(),$("#us-popup-view").removeClass("popup-for-error-dialog")}}),t.USPopupDateSelector}),define("pdmplugins/unified-share/js/popupView/views/us-popup-date-selector-container-view",["core/ac-core","core/utils/view-util","pdmplugins/unified-share/js/ac-unified-share","i18n!pdmplugins/unified-share/js/nls/ui-strings","pdmplugins/unified-share/js/popupView/views/us-popup-date-selector"],function(e,i,t){return t.USPopupDateSelectorContainer=e.View.extend({initialize:function(){e.View.prototype.initialize.call(this)},render:function(){e.View.prototype.render.call(this),this._showCalender()},_showCalender:function(){var i=e.uiModelFactory.create("DialogsUiModel"),s=_.extend({},this.options,{dialogsUiModel:i,parentView:this}),n=new t.USPopupDateSelector(s);n.open(s.parentView)}}),t.USPopupDateSelectorContainer}),define("pdmplugins/unified-share/js/popupView/views/us-popup-deadline-selector",["core/ac-core","core/utils/view-util","pdmplugins/unified-share/js/ac-unified-share","pdmplugins/unified-share/js/popupView/templates/us-popup-deadline-selector-template","i18n!pdmplugins/unified-share/js/nls/ui-strings","pdmplugins/unified-share/js/utils/us-utils","pdmplugins/unified-share/js/utils/sc-constants","pdmplugins/unified-share/js/popupView/views/us-popup-date-selector-container-view"],function(e,i,t,s,n,o,a){return t.PopupDeadlineSelector=e.View.extend({events:{"click .popup-select-date":"_opencalendar"},initialize:function(){e.View.prototype.initialize.call(this),this._template=_.template(s)},render:function(){e.View.prototype.render.call(this),0===this.$el.children().length&&(this.$el.html(this._template({SELECT_DEADLINE:n.USM_ADD_DEADLINE,SELECT_REMINDER:n.USM_ADD_REMINDER})),this._initWrappers()),this._renderDeadlineReminderSelectors(),this._processRecipients(),this._addUiModelEventListeners(),this._addKeyEventListeners()},_initWrappers:function(){this.$popupDeadlineSelectorContainer=this.$(".popup-deadline-selector-container"),this.$popupReminderSelectorContainer=this.$(".popup-reminder-selector-container"),this.$deadlineSelector=this.$("#deadline-selector"),this.$reminderSelector=this.$("#reminder-selector"),this.$popupSelectDeadlineText=this.$(".popup-select-deadline-text"),this.$popupSelectReminderText=this.$(".popup-select-reminder-text"),this.$deadlineSelected=this.$("#deadline-selected"),this.$reminderSelected=this.$("#reminder-selected"),this.$popupSelectDate=this.$(".popup-select-date"),this.$dateSelected=this.$(".date-selected")},_processRecipients:function(){this._toggleDeadlineSelector(),this._toggleReminderSelector()},_addUiModelEventListeners:function(){var e=this.options.sendFilesUiModel;e.get("email_addr_collection").on("all",this._processRecipients),e.on("change:us_mode",this._onModeChange),e.on("change:set_deadline",this._checkUncheckDeadlineSelector),e.on("change:deadline",this._onDeadlineChange),e.on("change:reminder",this._onReminderChange)},_addKeyEventListeners:function(){this.$popupSelectDate.keypress(this._onKeyPress),this.$dateSelected.keypress(this._onKeyPress)},_showCalendar:function(e,i){var s=_.extend({},{origin:i,mode:e,sendFilesUiModel:this.options.sendFilesUiModel});this.removeAllChildViews(),"deadline"===e?this._renderChildView("_popupDeadlineSelectorContainer",t.USPopupDateSelectorContainer,this.$popupDeadlineSelectorContainer,s):this._renderChildView("_popupReminderSelectorContainer",t.USPopupDateSelectorContainer,this.$popupReminderSelectorContainer,s)},_setDeadline:function(){var e=this.options.sendFilesUiModel.get("set_deadline")?"hyperlink":"checkbox";this._showCalendar("deadline",e);var i=this.options.sendFilesUiModel.get("ShareVariant"),t=a.USE,s="Add deadline";this.options.appApi.siteCatalystApi.logScEvent([i,t,s])},_setReminder:function(){var e=this.options.sendFilesUiModel.get("set_reminder")?"hyperlink":"checkbox";this._showCalendar("reminder",e);var i=this.options.sendFilesUiModel.get("ShareVariant"),t=a.USE,s="Setup reminder";this.options.appApi.siteCatalystApi.logScEvent([i,t,s])},_onKeyPress:function(e){var i=$(e.currentTarget);e&&13==e.which&&i.trigger("click")},_opencalendar:function(e){var i=$(e.currentTarget),t=i.attr("id");"deadline-selected"===t||"popup-select-deadline"===t?this._setDeadline():this._setReminder()},_renderDeadlineReminderSelectors:function(){this.$deadlineSelector.hide(),this.$reminderSelector.hide()},_onModeChange:function(){setTimeout(_.bind(this._toggleDeadlineReminderSelector,this),100)},_toggleDeadlineReminderSelector:function(){this._toggleDeadlineSelector(),this._toggleReminderSelector()},_toggleDeadlineSelector:function(){var e=(this.options.sendFilesUiModel.get("email_addr_collection"),this.options.sendFilesUiModel.get("us_mode"));"#review-mode"===e?(this.$deadlineSelector.slideDown(200),this.$deadlineSelected.attr("tabindex","0")):(this.$deadlineSelector.slideUp(200),this.$deadlineSelected.attr("tabindex","-1"))},_toggleReminderSelector:function(){},_checkUncheckDeadlineSelector:function(){},_onDeadlineChange:function(){var e=this.options.sendFilesUiModel,i=e.get("deadline");i?(this.$popupSelectDeadlineText.text(n.DUE_BY),this.$deadlineSelected.text(this._formatdate(i))):(this.$deadlineSelected.text(n.USM_ADD_DEADLINE),this.$popupSelectDeadlineText.text("")),this._toggleReminderSelector(),this._onReminderChange()},_onReminderChange:function(){var e=this.options.sendFilesUiModel,i=e.get("reminder");i?(this.$popupSelectReminderText.text(n.REMIND_BY),this.$reminderSelected.text(this._formatdate(i))):(this.$reminderSelected.text(n.USM_ADD_REMINDER),this.$popupSelectReminderText.text(""))},_reset:function(){this._resetDeadline(),this._resetReminder()},_resetDeadline:function(){var e=this.options.sendFilesUiModel;this.$popupSelectDeadlineText.text(n.USM_ADD_DEADLINE),e.set("deadline",""),e.set("set_deadline",!1)},_resetReminder:function(){var e=this.options.sendFilesUiModel;this.$popupSelectReminderText.text(n.USM_REMINDER),e.set("reminder",""),e.set("set_reminder",!1)},_formatdate:function(e){var i=this.options.appApi.localeApi.getLocale(),t={day:"numeric"},s=e.toLocaleDateString(i,t),n=this._getMonth(e.getMonth()),o=(e.getFullYear(),e.getHours()),a=e.getMinutes();return 10>o&&(o="0"+o),10>a&&(a="0"+a),s+" "+n+", "+o+":"+a},_getMonth:function(e){return o.getMonthName(e)}}),t.PopupDeadlineSelector}),define("pdmplugins/unified-share/js/popupView/templates/us-popup-share-success-template",[],function(){return'<div id="us-popup-success-view-container"><button class="us-popup-success-view-image" tabindex = "-1"/><div class="doc-sent-container"><div class="review-generated-heading ui-theme theme-text"><%= REVIEW_GENERATED_MSG %></div><div class="doc-sent-text-heading popup-success-view-text-heading ui-theme theme-text"><%= DOC_SENT_HEADING %></div><div class="doc-sent-text-summary us-popup-sent-text-summary ui-theme theme-text"><%= DOC_SENT_SUMMARY %></div></div><div class="us-popup-success-buttons-container"><button tabindex = "0" class="control-button button-grey us-popup-track-files-button ui-theme theme-text theme-share-grey-button" id="us-popup-send-again-link" aria-describedby="share-again-button" aria-label="<%= SHARE_AGAIN %>"><%= SHARE_AGAIN %></button><button tabindex = "0" class="control-button ui-theme theme-text theme-button theme-button-label floating-window-button-text" id="us-popup-success-goto-sent-files"  aria-describedby="goto-sent-files-button" aria-label="<%= GO_TO_SENT_FILES %>"><%= GO_TO_SENT_FILES %></button></div></div>'
}),define("pdmplugins/unified-share/js/popupView/views/us-popup-share-success-view",["core/ac-core","pdmplugins/unified-share/js/ac-unified-share","pdmplugins/unified-share/js/popupView/templates/us-popup-share-success-template","i18n!pdmplugins/unified-share/js/nls/ui-strings","pdmplugins/unified-share/js/utils/sc-constants","pdmplugins/unified-share/js/ops/close-app-op"],function(e,i,t,s,n){return i.UsPopupShareSuccessView=e.View.extend({events:{"click #us-popup-success-goto-sent-files":"_onClickSentLink","click #us-popup-send-again-link":"_onClickSendAgain"},initialize:function(){e.View.prototype.initialize.call(this),this._template=_.template(t)},render:function(){if(e.View.prototype.render.call(this),0===this.$el.children().length){var i=this.options.sendFilesUiModel.get("us_mode"),t=this.options.sendFilesUiModel.isMultipleFilesSelected(),n=(this.options.sendFilesUiModel.getRecipientsArray().length>1,"#send-mode"==i&&t?s.USM_SUCCESS_VIEW_MESSAGE:s.USM_SUCCESS_VIEW_MESSAGE),o=t?s.USM_SUCCESSFULLY_SENT_MULTIPLE:s.USM_SUCCESSFULLY_SENT,a=t?s.TRACK_FILES:s.TRACK_FILE;this.$el.html(this._template({SUCCESS_CLOSE:s.CLOSE_STRING,GO_TO_SENT_FILES:a,DOC_SENT_HEADING:o,DOC_SENT_SUMMARY:n,REVIEW_GENERATED_MSG:s.REVIEW_GENERATED_MSG,SHARE_AGAIN:s.SHARE_AGAIN_BUTTON_TEXT})),this._initWrappers(),"#review-mode"===i?(this.$sentHeading.hide(),this.$sentSuccessSummary.hide(),this.$ManageFilesButton.hide()):this.$reviewHeading.hide()}},_initWrappers:function(){this.$ManageFilesButton=this.$("#us-popup-success-goto-sent-files"),this.$usModalSuccessViewContainer=this.$("#us-popup-success-view-container"),this.$sentSuccessSummary=this.$(".doc-sent-text-summary"),this.$sentHeading=this.$(".doc-sent-text-heading"),this.$reviewHeading=this.$(".review-generated-heading")},_onClickSentLink:function(){var i="sentfiles";this.options.appApi.rnaApi.done(_.bind(function(t){if(t.isRunningInBrowser())this.options.appApi.sessionApi.ensureSignedIn().done(_.bind(function(){e.opFactory.create("GettingSsoUriOp",this.options).run(i).done(function(e){e&&window.open(e.uri)})},this));else{var s={};s.op="setHighlightWorkflowId",s.workflowID=this.options.sendFilesUiModel.attributes.parcel.parcel_id,s.sourcePlugin="unifiedShare",s.assetFileName="",s.assetWorkflowId="",t.stApi.updateInAppDMStateAPI(s),t.selectLeftRailItem("sentfiles")}this.options.appApi.siteCatalystApi.logScEvent([n.TOOLS,this.options.sendFilesUiModel.get("ShareVariant"),n.TRACK_BUTTON,n.CLICKED])},this))},_onClickSendAgain:function(){this.options.sendFilesUiModel.resetUITodefault(),this.$("us-share-popup-address-input").focus(),this.options.appApi.siteCatalystApi.logScEvent([n.TOOLS,this.options.sendFilesUiModel.get("ShareVariant"),n.SHARE_AGAIN_BUTTON,n.CLICKED])}}),i.UsPopupShareSuccessView}),define("pdmplugins/unified-share/js/popupView/views/us-popup-share-view",["core/ac-core","files/ac-files","core/utils/file-types","pdmplugins/unified-share/js/ac-unified-share","pdmplugins/unified-share/js/popupView/templates/us-popup-share-template","pdmplugins/unified-share/js/popupView/templates/us-popup-free-user-upsell-template","i18n!pdmplugins/unified-share/js/nls/ui-strings","pdmplugins/unified-share/js/utils/sc-constants","pdmplugins/unified-share/js/utils/ts-utils","pdmplugins/unified-share/js/popupView/views/us-popup-email-addr-view","pdmplugins/unified-share/js/popupView/views/us-popup-deadline-selector","pdmplugins/unified-share/js/popupView/views/us-popup-share-success-view","pdmplugins/unified-share/js/ops/desktop-do-upload-op","pdmplugins/unified-share/js/ops/finding-upload-folder-op","pdmplugins/unified-share/js/ops/begin-desktop-upload-op","pdmplugins/unified-share/js/ops/share-files-op","pdmplugins/unified-share/js/ops/close-app-op","pdmplugins/unified-share/js/ops/upload-and-run-sfs-op","pdmplugins/unified-share/js/ops/check-deadline-reminder-error-op","core/utils/sc-analytics","core/ops/op"],function(e,i,t,s,n,o,a,l,r){return s.UsPopupShareView=e.View.extend({events:{"click .share-files-button":"_onShareClickDebounced","click #close-share-button":"_onClickClose","input  #us-share-popup-subject-input":"_onSubjectInput","input  .us-share-popup-message-input":"_onMessageInput","paste  #us-share-popup-subject-input":"_onSubjectPaste","paste  .us-share-popup-message-input":"_onMessagePaste","blur  #us-share-popup-subject-input":"_onSubjectBlur","blur  .us-share-popup-message-input":"_onMessageBlur","click #popup-ip-allow-comments-checkbox":"_onAllowComments","click #popup-invite-summary-learn-more":"_launchLearnMoreInvite","click .us-upsell-close-btn":"_onUpsellCloseClicked","click .us-upsell-get-started-btn":"_onUpsellGetStartedClicked","click #us-upsell-learn-more-btn":"_onUpsellLearnMoreClicked","click #popup-share-learn-more":"_launchLearnMoreAction","click #get-link-hyperlink":"redirectToGetLink","click .ui-popup-learn-more":"_onLearnMoreBtnClick"},initialize:function(){e.View.prototype.initialize.call(this),this._template=_.template(n),this._templateUpsell=_.template(o),e.Util.isReader()&&(this.sharingForInitallySignedOutReader=!1)},render:function(){e.View.prototype.render.call(this),this.$("#popup-share-in-window-tooltip-dc").hide(),0===this.$el.children().length&&(this.$el.html(this._template({INVITE_PEOPLE_HEADING:a.SHARE_WITH_OTHERS,SHARE_BUTTON:a.SHARE_BUTTON,SEND_INVITATIONS:a.SEND_BUTTON_TOOLTIP,SHARE_CLOSE:a.SHARE_SUCCESS_CLOSE,LEARN_MORE:a.LEARN_MORE,SHARE_REVIEW:a.SHARE_REVIEW,LEARN_MORE_LABEL:a.LEARN_MORE_LABEL,LEARN_MORE_LINK:a.LEARN_MORE,TOOLTIP_INFO:a.POP_SHARE_CREATE_LINK_INFO_TOOLTIP_LOCAL+a.POP_SHARE_CREATE_LINK_INFO_TOOLTIP_DC,TOOLTIP_INFO_DC:a.POP_SHARE_CREATE_LINK_INFO_TOOLTIP_DC,CL_LEARN_MORE_LINK:a.POP_SHARE_CREATE_LINK_LEARN_MORE,CREATE_LINK_ALLOW_COMMENTS:a.USM_ALLOW_COMMENTS})),this._initUpsellDialog(),this._initWrappers(),this._addEventListeners()),e.Util.isReader()&&1==this.sharingForInitallySignedOutReader||(this._addUiModelEventListeners(),this._renderChildViews(),this._processRecipients(!0),this._toggleAddFilesButton(),this._checkUncheckAllowComments(),this._addUiEventListeners(),this._addKeyEventListener(),this._toggleAllowCommentsVisibility(),this._updateToggleTheme(),this._toggleMessage(),this._onUsShareStateChange(),this._adjustTooltipPosition(),this._setupListener(),this.$(".us-share-popup-message-input").attr("placeholder",a.SHARE_MESSAGE_PROMPT_REVIEW_5),s.QueryParams&&"true"===s.QueryParams.showTooltip&&(this.$(".us-share-popup-icon-cell").hide(),this.$("#popup-share-in-window-tooltip").show()),this.options.appApi.rnaApi.done(_.bind(function(e){var i=e.getOpenedFile();i.invoke("determineFileSource").then(_.bind(function(e){"root"===e?(this.$("#popup-share-in-window-tooltip").hide(),this.$("#popup-share-in-window-tooltip-dc").show()):(this.$("#popup-share-in-window-tooltip-dc").hide(),this.$("#popup-share-in-window-tooltip").show())},this))},this)))},_initUpsellDialog:function(){var e=this._templateUpsell({USM_SEND_FOR_REVIEW:a.USM_SEND_FOR_REVIEW,USM_REVIEW_UPSELL_1:a.USM_REVIEW_UPSELL_1,USM_REVIEW_UPSELL_2:a.USM_REVIEW_UPSELL_2,USM_REVIEW_UPSELL_3:a.USM_REVIEW_UPSELL_3,USM_REVIEW_UPSELL_4:a.USM_REVIEW_UPSELL_4,LEARN_MORE:a.LEARN_MORE,US_SHARE_SFS_CTA:a.US_SHARE_SFS_CTA,CLOSE:a.SHARE_SUCCESS_CLOSE});this.$("#upsell-container-invite-tab").append(e),this.$(".us-floating-upsell-container").addClass("us-floating-upsell-container-bottom-arrow"),this.$(".us-floating-dialog").hide(),this.$(".us-popup-upsell-arrow").hide()},_initWrappers:function(){this.$emailAddressView=this.$("#popup-share-email-address-template-container"),this.$shareButton=this.$(".share-files-button"),this.$closeShareButton=this.$("#close-share-button"),this.$sharePopupButtonBar=this.$(".popup-share-button-bar"),this.$deadlineSelectorContainer=this.$("#deadline-popup-selector-container"),this.$PopupIpAllowCommentsCheckBox=this.$("#popup-ip-allow-comments-checkbox"),this.$PopupIpOptions=this.$(".popup-share-options-container"),this.$usPrimaryView=this.$("#us-popup-share-primary-view"),this.$usSuccessView=this.$("#us-success-view"),this.$shareLoader=this.$("#popup-share-progress-view"),this.$Loadertext=this.$("#popup-share-uploading-text"),this.$progressBar=this.$(".popup-share-progress-bar"),this.$popupShareInfo=this.$("#popup-share-info"),this.$popupAllowCommentsContainer=this.$("#popup-share-allow-comments-container")},_addEventListeners:function(){this.$popupShareInfo.mouseenter(this._onHoverInviteReviewInfo),this.$popupShareInfo.blur(_.bind(function(){setTimeout(_.bind(function(){this.$popupShareInfo.removeClass("hovered")},this),100)},this)),this.$popupShareInfo.hover(_.bind(function(){this.$popupShareInfo.addClass("hovered"),this._infoTooltipOpentime=Date.now(),this.options.appApi.siteCatalystApi.logScEvent([l.TOOLS,this.options.sendFilesUiModel.get("ShareVariant"),l.INVITE_MODE,l.INFO_TOOLTIP,l.OPEN])},this),_.bind(function(){this.$popupShareInfo.removeClass("hovered");var e=0;this._infoTooltipOpentime&&(e=(Date.now()-this._infoTooltipOpentime)/1e3),this.options.appApi.siteCatalystApi.logScEvent([l.TOOLS,this.options.sendFilesUiModel.get("ShareVariant"),l.INVITE_MODE,l.INFO_TOOLTIP,l.CLOSE,e])},this))},_renderChildViews:function(){this._renderChildView("_emailAddressView",s.UsPopupEmailAddrView,this.$emailAddressView),this._renderChildView("_deadlineSelectorContainer",s.PopupDeadlineSelector,this.$deadlineSelectorContainer)},_addUiModelEventListeners:function(){var e=this.options.sendFilesUiModel;e.get("email_addr_collection").on("all",this._onRecipientsChange),e.on("change:local_file_objects",this._onFilesChange),e.get("metadata_collection").on("all",this._onFilesChange),e.on("change:connector_file_objects",this._onFilesChange),e.on("change:ccloud_file_objects",this._onFilesChange),e.on("change:us_mode",this._onModeChange),e.on("change:US_tab_open",this._onUsTabChanged),e.on("change:us_share_state",this._onUsShareStateChange),e.on("change:share_loader_text",this._updateLoaderText),e.on("change:reset_model",this._resetUI),this.options.canSignUiModel.on("change:can_sign_state",this._onCanSignStateChanged),this.options.canSignUiModel.on("change:advancedSignClick",this._onAdvancedSignOptionsClickDebounced)},_addUiEventListeners:function(){$("#unified-share-container").on("click",this.hideErrorBubble)},_setupListener:function(){this.options.appApi.rnaApi.done(_.bind(function(e){e.rnaUnifiedSharePopupAPI.initListener().done(_.bind(function(e){e._addEventListener("custom:SetShareMode",_.bind(function(e,i){var t=i.params,s=this.options.sendFilesUiModel.get("us_mode");t!=s&&(this.options.sendFilesUiModel.setUSMode(t),this._onAllowComments())},this),null,null)},this),this)},this))},_processRecipients:function(){this.options.sendFilesUiModel.get("email_addr_collection");this._toggleSendButton()},_onRecipientsChange:function(){this._onDebouncedRecipientsChange()},_onFilesChange:function(){var e=this.options.sendFilesUiModel,i=e.get("local_file_objects"),t=e.get("metadata_collection");this._toggleSendButton(),i.length+t.length==1&&this._checkReviewPossible()},_onModeChange:function(){this._toggleAddFilesButton(),this._checkMaximumFiles(),this._toggleMessage(),this._toggleBetweenSendAndNext(),this._checkReviewPossible()},_onUsTabChanged:function(){console.log("us-share-tab-view : _onUsTabChanged"),this._toggleAddFilesButton(),this._toggleBetweenSendAndNext(),this._checkMaximumFiles(),this._toggleMessage()},_onCanSignStateChanged:function(){var e=this.options.canSignUiModel.get("can_sign_state");switch(console.log("state changed to : "+e),e){case"authorising":break;case"authorised":var i=this.options.esAuthUiModel.get("access_token");console.log("Authorised , authToken generated : "+String(i));break;case"uploading":break;case"uploaded":console.log("uploaded : all files uploaded to echo sign server ");break;case"failed":console.log("uploading or authorising failed"),this._showShareButton()}},_toggleBetweenSendAndNext:function(){var e=this.options.sendFilesUiModel.get("us_mode");this.$shareButton.text("#sign-mode"==e?a.NEXT_BUTTON:a.SHARE_BUTTON)},_checkMaximumFiles:function(){var e=this.options.sendFilesUiModel,i=e.get("us_mode"),t=e.get("US_tab_open");if("share"===t){if("#review-mode"===i&&e.isMultipleFilesSelected()){var s=(this.options.appApi.dialogApi,a.SHARE_TOO_MANY_FILES_DLG_TITLE),n=a.ERROR_MULTIPLE_FILES_REVIEW1+". "+a.ERROR_MULTIPLE_FILES_REVIEW2;e.setUSMode("#send-mode"),e.setCLMode("#send-mode");var o=this.options.sendFilesUiModel.get("ShareVariant"),r=l.ERROR,d="Multiple files selected for review";return this.options.appApi.siteCatalystApi.logScEvent([o,r,d]),this.showErrorBubble(l.INVITE_PEOPLE_ERROR,s,n),!1}var p,e=this.options.sendFilesUiModel,h=e.get("limits_model"),i=e.get("us_mode"),c=e.get("local_file_objects").length+e.get("metadata_collection").length;if(p=_.isUndefined(h)?50:h.get("#send-mode"===i?"max_files":"max_review_files"),c>p){var u=(this.options.appApi.dialogApi,a.SHARE_TOO_MANY_FILES_DLG_TITLE),m=_.template(a.SHARE_TOO_MANY_FILES_DLG_MSG,{maxNumber:p});return this.showErrorBubble(l.INVITE_PEOPLE_ERROR,u,m,!0),!1}}return!0},_checkUncheckAllowComments:function(){var e=this.options.sendFilesUiModel.get("us_mode");if("#review-mode"==e?(this.$PopupIpAllowCommentsCheckBox.attr("checked",!0),this.$PopupIpAllowCommentsCheckBox.attr("aria-label","Allow Comment Toggle on")):(this.$PopupIpAllowCommentsCheckBox.attr("checked",!1),this.$PopupIpAllowCommentsCheckBox.attr("aria-label","Allow Comment Toggle off")),this.$PopupIpOptions&&this.$popupAllowCommentsContainer){var i=this.$PopupIpOptions.width()-this.$popupAllowCommentsContainer.width();this.$deadlineSelectorContainer&&i>0&&this.$deadlineSelectorContainer.css({"max-width":i+"px"})}var t=this.options.sendFilesUiModel.get("ShareVariant"),s=l.INVITE_MODE,n=l.ALLOW_COMMENTS_DEFAULT;this.options.appApi.siteCatalystApi.logScEvent([t,s,n,e])},_toggleAllowCommentsVisibility:function(){var e=!0;this.options.appApi.rnaApi.done(_.bind(function(i){e=i.stApi.shouldAdobeReviewVisible(),e?this.$PopupIpOptions.show():this.$PopupIpOptions.hide()},this))},_updateToggleTheme:function(){"LightTheme"===s.QueryParams.theme?($("#invite-people-toggle").removeClass("darkTheme"),$("#invite-people-toggle").addClass("lightTheme")):"DarkTheme"===s.QueryParams.theme&&($("#invite-people-toggle").removeClass("lightTheme"),$("#invite-people-toggle").addClass("darkTheme"))},_checkNameLength:function(e){var i,t=this.options.sendFilesUiModel,s=t.get("limits_model");if(i=_.isUndefined(s)?1e3:s.get("max_subject_length"),e.length>i){var n=(this.options.appApi.dialogApi,a.SHARE_NAME_SIZE_ERROR_DLG_TITLE),o=_.template(a.SHARE_NAME_SIZE_ERROR_DLG_MSG,{maxNumber:i});return this.showErrorBubble(l.INVITE_PEOPLE_ERROR,n,o,!0),!1}return!0},_checkMessageLength:function(e){var i,t=this.options.sendFilesUiModel,s=t.get("limits_model");if(i=_.isUndefined(s)?1e3:s.get("max_message_length"),e.length>i){var n=(this.options.appApi.dialogApi,a.SHARE_MSG_SIZE_ERROR_DLG_TITLE),o=_.template(a.SHARE_MSG_SIZE_ERROR_DLG_MSG,{maxNumber:i});return this.showErrorBubble(l.INVITE_PEOPLE_ERROR,n,o,!0),!1}return!0},_toggleAddFilesButton:function(){var e=this.options.sendFilesUiModel,i=e.get("us_mode"),t=e.get("allow_comments"),s=e.get("US_tab_open"),n=e.get("cl_active_view");"share"===s?e.set("enable_add_files","#review-mode"!==i):"attachToEmail"===s?e.set("enable_add_files",!0):"createLink"===s?e.set("enable_add_files",!t&&"complete"!==n):"sendForSignature"===s&&e.set("enable_add_files",!1),e.trigger("change:enable_add_files")},_toggleSubject:function(){var e=this.options.sendFilesUiModel,i=(e.get("us_mode"),e.get("is_subject_user_input")),t=this._getSubjectText(!1),s="";s=i?t:a.SHARE_INITIAL_SUBJECT,this._emailAddressView.setSubject(s),e.setSubjectText(s)},_toggleMessage:function(){var e=this.options.sendFilesUiModel,i=e.get("us_mode"),t=e.get("is_message_user_input"),s=this._getMessageText(),n="";n=t?s:"#sign-mode"===i?a.SHARE_MESSAGE_PROMPT_SIGN:n,this._emailAddressView.setMessage(n),e.setMessageText(n)},_toggleSendButton:function(){var e=this.options.sendFilesUiModel,i=e.get("local_file_objects"),t=this.options.sendFilesUiModel.get("email_addr_collection"),s=e.get("metadata_collection"),n=e.get("ccloud_file_objects"),o=e.get("us_share_state");0===i.length&&0===s.length||0===t.length||n.length>0||"Sharing"===o?(this.$shareButton.addClass("disabled").attr("disabled","disabled"),this.$shareButton.attr("tabindex","-1")):(this.$shareButton.removeClass("disabled").removeAttr("disabled"),this.$shareButton.attr("tabindex","0"))},_onUpsellCloseClicked:function(){this.$(".us-floating-dialog").hide(),this.options.appApi.siteCatalystApi.logScEvent([l.TOOLS,this.options.sendFilesUiModel.get("ShareVariant"),l.SHARE_UPSELL_DIALOG,l.CLOSE,l.CLICKED])},_onUpsellLearnMoreClicked:function(){this.options.appApi.rnaApi.done(_.bind(function(e){e.openDecoratedUrl(a.REVIEW_LEARN_MORE_LINK_GO_URL)},this)),this.options.appApi.siteCatalystApi.logScEvent([l.TOOLS,this.options.sendFilesUiModel.get("ShareVariant"),l.SHARE_UPSELL_DIALOG,l.LEARN_MORE,l.CLICKED])},_onUpsellGetStartedClicked:function(){this.options.appApi.rnaApi.done(_.bind(function(e){e.openDecoratedUrl(this.options.limitsModel.get("upgrade_url"))},this)),e.Util.isCEF()&&this.options.appApi.sessionApi.ensureSignedIn(),this.$(".us-floating-dialog").hide(),this.options.appApi.siteCatalystApi.logScEvent([l.TOOLS,this.options.sendFilesUiModel.get("ShareVariant"),l.SHARE_UPSELL_DIALOG,l.GET_STARTED,l.CLICKED])},redirectToGetLink:function(){var e=this.options.sendFilesUiModel.get("ShareVariant"),i=l.USE,t="Redirect To Get Link on Send Limit reached.";this.options.appApi.siteCatalystApi.logScEvent([e,i,t]),this.hideErrorBubble(),this._hidePopup(),this._openGetLinkPopup()},_onDebouncedRecipientsChange:function(){this._processRecipients(!0)},_onClickClose:function(){var e=new s.CloseAppOp(this.options);e.run()},_onAllowComments:function(){if(console.log("On share Allow Comments..."),this.$PopupIpAllowCommentsCheckBox.blur(),this.options.sendFilesUiModel.get("isReviewVisible")){var e=this.options.sendFilesUiModel;e.get("allow_comments_enabled")===!0&&(1==this.$PopupIpAllowCommentsCheckBox.is(":checked")?(this.options.sendFilesUiModel.setUSMode("#review-mode"),this.$PopupIpAllowCommentsCheckBox.attr("aria-label","Allow Comment Toggle on")):(this.options.sendFilesUiModel.setUSMode("#send-mode"),this.$PopupIpAllowCommentsCheckBox.attr("aria-label","Allow Comment Toggle off"))),this._toggleAddFilesButton(),this._checkMaximumFiles()}else this.$(".us-floating-dialog").show(),this.$("#us-upsell-learn-more-btn").focus(),this.$PopupIpAllowCommentsCheckBox.attr("checked",!1);var i=this.options.sendFilesUiModel.get("ShareVariant"),t=l.INVITE_MODE,s=l.ALLOW_COMMENTS_TOGGLED,n=this.options.sendFilesUiModel.get("us_mode");this.options.appApi.siteCatalystApi.logScEvent([i,t,s,n])},_onShareClickDebounced:function(){this.options.appApi.rnaApi.done(function(e){e.logPerformance("ShareAFile","start")}),this.options.appApi.siteCatalystApi.logEvent("CSE","InvitePeople","InvitePeople_Invoked"),e.Util.isCEF()?(this._debouncedShareClick||(this._debouncedShareClick=_.debounce(this._onShareClick,1e3,!0)),this._debouncedShareClick()):this._onShareClick()},_reorderCollections:function(e){var i=[],t=$.Deferred(),s=0,n=[],o=this.options.sendFilesUiModel,a=o.get("limits_model"),r=0;if(!this.options.localFiles.length)return t.resolve().promise();if(this.avFlag=!1,this.formFlag=!1,_.each(this.options.localFiles,_.bind(function(t){var l;"postUpload"===e&&(t.id=this.options.assetIdarray[s],l=this.options.sendFilesUiModel.addFilesToCollection([t.id],void 0,o.get("share_collection"),!0,!0),i.push(l[0]),s++),"preUpload"===e&&(_.isUndefined(t.get("path"))||"\\\\www.adobe.com\\go\\homeacrordrunified18_2018"!==t.get("path")&&"http://www.adobe.com/go/homeacrordrunified18_2018"!==t.get("path")?_.isEmpty(t.get("ext"))?(this.options.sendFilesUiModel.removeLocalFile([t]),l=this._showErrorDialogMsg("noExtension"),i.push(l)):_.isEmpty(t.get("assetId"))||this.options.sendFilesUiModel.get("bHFileIsDirty")&&t.get("assetId")===this.options.sendFilesUiModel.get("openedFileAssetId")?!a.get("can_send_av")&&o.hasAudioVideoExt(t.get("ext"))?(this.avFlag=!0,n[r++]=t,l=$.Deferred().resolve().promise(),i.push(l)):o.get("enable_form_send")||"form"!==t.get("ext")?(l=$.Deferred().resolve().promise(),i.push(l)):(this.formFlag=!0,n[r++]=t,l=$.Deferred().resolve().promise(),i.push(l)):(this.options.sendFilesUiModel.removeLocalFile([t]),l=this.options.sendFilesUiModel.addFilesToCollection([t.get("assetId")]),i.push(l[0])):console.log("Welcome.pdf"))},this)),n.length){var d;this.options.appApi.siteCatalystApi.logScEvent([l.TOOLS,this.options.sendFilesUiModel.get("ShareVariant"),l.FILES_SHARED_DLG,l.DISALLOWED,l.WARNING,l.SHOWN]),d=this.options.isType2OR3?this._showErrorDialogMsg("type2or3",n):this.avFlag&&!this.formFlag?this._showErrorDialogMsg("avError",n):!this.avFlag&&this.formFlag?this._showErrorDialogMsg("fileTypeError",n,"formError"):this._showErrorDialogMsg("fileTypeError",n,"avFormError"),i.push(d)}return $.when.apply($,i).then(_.bind(function(){this.options.localFiles=this.options.sendFilesUiModel.get("local_file_objects"),this.options.files=this.options.sendFilesUiModel.get("metadata_collection"),t.resolve()},this),_.bind(function(){t.reject()},this)),t.promise()},_showErrorDialogMsg:function(e,i,t){{var s,n,o=this.options.appApi.dialogApi;this.options.sendFilesUiModel.get("limits_model")}if("noExtension"===e)return s=a.ADD_FILES_REJECTED_TITLE,n=a.ADD_FILES_REJECTED_MESSAGE,this.showErrorBubble(l.INVITE_PEOPLE_ERROR,s,n,a.SHARE_SUCCESS_CLOSE);if("avError"===e){var r=_.extend({},{okButtonClass:"us-upsell-learn-more",cancelButtonClass:"us-upsell-close"});s=a.SHARE_AV_UPSELL_TITLE,n=a.SHARE_AV_UPSELL_MSG;var d=o.displayHtmlAlert(o.SEVERITY_WARNING,s,n,a.LEARN_MORE,a.CLOSE_STRING,r);return $(".alert-dlg-buttons-rhp").css({"text-align":"right",direction:"rtl"}),$(".us-upsell-learn-more").css({"padding-left":"15px","padding-right":"15px","margin-left":"10px","margin-right":"5px"}),d.then(_.bind(function(){return this._onUpsell(),$.Deferred().reject().promise()},this),_.bind(function(){return _.each(i,_.bind(function(e){this.options.sendFilesUiModel.removeLocalFile([e])},this)),$.Deferred().reject().promise()},this)).always(_.bind(function(){$(".alert-dlg-buttons-rhp").css({"text-align":"center",direction:"ltr"})},this))}if("type2or3"===e){var s=a.COULD_NOT_SEND,n=a.ENTERPRISE_USERS_ACCESS_ERROR;return this.showErrorBubble(l.INVITE_PEOPLE_ERROR,s,n,a.SHARE_SUCCESS_CLOSE).then(_.bind(function(){return _.each(i,_.bind(function(e){this.options.sendFilesUiModel.removeLocalFile([e])},this)),$.Deferred().reject().promise()},this))}return"fileTypeError"===e?(s=a.SEND_UPSELL_UPGRADE_REQUIRED,"formError"===t?(n=a.SHARE_FORMS_ERROR_DESKTOP,this.options.appApi.siteCatalystApi.logScEvent([l.TOOLS,this.options.sendFilesUiModel.get("ShareVariant"),l.ATTEMPTED_TO_SHARE_FORM])):"avFormError"===t&&(n=a.SHARE_AV_FORMS_ERROR+a.SHARE_AV_UPGRADE_MESSAGE),this.showErrorBubble(l.INVITE_PEOPLE_ERROR,s,n,a.SHARE_SUCCESS_CLOSE).then(_.bind(function(){return _.each(i,_.bind(function(e){this.options.sendFilesUiModel.removeLocalFile([e])},this)),$.Deferred().reject().promise()},this))):void 0},_checkReviewPossible:function(){"#review-mode"===this.options.sendFilesUiModel.get("us_mode")?s.opFactory.create("CanSendForReviewOp",this.options).run().then(_.bind(function(){this.$PopupIpAllowCommentsCheckBox.prop("checked",!0)},this),_.bind(function(e){this.$PopupIpAllowCommentsCheckBox.prop("checked",!1),this.options.sendFilesUiModel.setUSMode("#send-mode");var i=this.options.sendFilesUiModel.get("ShareVariant"),t=l.ERROR,s=e.analyticsEvent;this.options.appApi.siteCatalystApi.logScEvent([i,t,s]),this.showErrorBubble(l.INVITE_PEOPLE_ERROR,a.FILE_CANT_BE_SENT,e.msg)},this)):this.$PopupIpAllowCommentsCheckBox.prop("checked",!1)},_onUpsell:function(i){var t=this.options.limitsModel,s=t.get("upgrade_url");this.options.appApi.rnaApi.done(_.bind(function(e){e.openDecoratedUrl(s)},this)),e.Util.isCEF()&&this.options.appApi.sessionApi.ensureSignedIn()},_onShareClick:function(){var e=this.options.sendFilesUiModel;if(e.isAVSharingPermitted())if("onlyRHP"===this.options.sendFilesUiModel.get("layout")&&this.options.sendFilesUiModel.get("checkForSave"))this.options.appApi.rnaApi.done(_.bind(function(e){e.rnaServicesAPI.checkOpenedDocAndPromptForSaveApi().then(_.bind(function(){var e=this.options.sendFilesUiModel.get("us_mode");"#sign-mode"===e?this._onShareNextClick("AUTHORING"):this._onShareSendClick()},this))},this));else{var i=this.options.sendFilesUiModel.get("us_mode");"#sign-mode"===i?this._onShareNextClick("AUTHORING"):this._onShareSendClick()}else e.setShareState("avNotAllowed")},_onShareNextClick:function(e){var i=new s.UploadAndRunSFSOp(this.options);if(this.options.appApi.sessionApi.isSignedIn()){var t=this.options.appApi.usersMeApi.getUserIdentity().email;_.isUndefined(t)||(this.options.sendFilesUiModel.isSenderOnlyRecipient(t)?this.showErrorBubble(l.INVITE_PEOPLE_ERROR,a.ERROR_STRING,a.ERROR_SINGLE_SIGNER_IS_SENDER):this.options.appApi.rnaApi.done(_.bind(function(t){t.esApi.isAnySFSWorkflowsRunning().then(_.bind(function(t){t?this.showErrorBubble(l.INVITE_PEOPLE_ERROR,a.ERROR_STRING,a.SFS_MULTIPLE_WORKFLOWS_DENIED):(this._setSFSWorkflowInProgress(),i.run().then(_.bind(function(){console.log("upload Success"),this._clearSFSWorkflowInProgress(),this._launchSFSWithData(e)},this),_.bind(function(e){console.log("upload failed"+e),this._clearSFSWorkflowInProgress(),this._onCanSignUploadError(e)},this)))},this))},this)))}},_onCanSignUploadError:function(){this._onShareError()},_onAdvancedSignOptionsClickDebounced:function(){e.Util.isCEF()?(this._debouncedAdvSign||(this._debouncedAdvSign=_.debounce(this._onAdvancedSignOptions,1e3,!0)),this._debouncedAdvSign()):this._onAdvancedSignOptions()},_onAdvancedSignOptions:function(){this.options.sendFilesUiModel.get("checkForSave")?this.options.appApi.rnaApi.done(_.bind(function(e){e.rnaServicesAPI.checkOpenedDocAndPromptForSaveApi().then(_.bind(function(){this._onShareNextClick("DRAFT")},this))},this)):this._onShareNextClick("DRAFT")},_acceptPGCRecipients:function(i){var t=[];i.map(_.bind(function(i){if(_.isUndefined(i.get("token"))){var s=_.extend({},this.options,{newContactEmail:i.get("email")});e.opFactory.create("AcceptingNewPGCSuggestionOp",s).run()}else t.push(i.get("token"))},this));var s=_.extend({},this.options,{tokens:t});e.opFactory.create("AcceptingPGCSuggestionsOp",s).run()},_onShareSendClick:function(){var i,t,n,o,r,d,p,h,c,u,m,E,g,S,f,A,v,R,b=[],I=[];if(this.$shareButton.hasClass("disabled"))return void this.options.appApi.siteCatalystApi.logScEvent([l.TOOLS,this.options.sendFilesUiModel.get("ShareVariant"),l.SHARE_BUTTON,l.DISABLED]);if(0!=this._checkMaximumFiles()){var M=this.options.sendFilesUiModel.get("us_mode");if(this.options.appApi.siteCatalystApi.logScEvent([l.TOOLS,this.options.sendFilesUiModel.get("ShareVariant"),l.SHARE_BUTTON,l.CLICKED,M]),v=new s.CheckDeadlineReminderErrorOp({uiModel:this.options.sendFilesUiModel,appApi:this.options.appApi,returnPromise:!1}),R=v.run(),R.isError)return void this.showErrorBubble(R.errorType,R.errTitle,R.errMessage);n=this.options.sendFilesUiModel,o=n.get("metadata_collection"),p=n.get("local_file_objects"),r="createLink"===n.get("US_tab_open"),d="share"===n.get("US_tab_open"),u=n.get("customize_recipient_page");var C=!1;if(e.Util.isReader()){var L=this.options.appApi.sessionApi.isSignedInReader(),T=this.options.sendFilesUiModel.get("ShareVariant"),U=L?"Signed In":"Signed out";this.options.appApi.siteCatalystApi.logScEvent([T,l.INVITE_MODE,,U]),L?this.sharingForInitallySignedOutReader=!1:(C=!0,this.sharingForInitallySignedOutReader=!0)}return e.Util.isCEF()&&!this.options.appApi.networkConnectivityApi.isOnline()?(this._renderOfflineView(),this._onShareError(t,l.NO_CONNECTIVITY),void this._resetAfterError(t)):void this.options.appApi.sessionApi.ensureSignedIn().then(_.bind(function(){if(d){b=n.getRecipientsArray();var v=_.clone(this.options.autoCCollection),R=this.options.autoCCollection.filter(function(e){return _.contains(b,e.get("email"))});v.reset(R),_.each(b,function(e){v.add({email:e})}),this._acceptPGCRecipients(v),A=!1}h=this._getSubjectText(!0),""===h.trim()&&(h=this.options.sendFilesUiModel.get("cl_subject_text")),c=this._getMessageText();var M="#review-mode"==n.get("us_mode");if(c=this._getMessageText()?this._getMessageText():M?a.SHARE_MESSAGE_PROMPT_REVIEW_4:a.SHARE_MESSAGE_PROMPT2,this._checkNameLength(h)&&this._checkMessageLength(c)&&(e.Util.isCEF()||this._checkMaximumRecipients(b)!==!1))if(i={uiModel:n,files:o,localFiles:p,recipients:b,is_public:r,is_individual:d,can_make_comments:A,email_subject:h,email_message:c,displayApi:this.options.appApi.displayApi,appApi:this.options.appApi,rootView:this.options.rootView,is_branding:u,sendFilesUiModel:this.options.sendFilesUiModel,assetIdarray:I,is_review:M},t=_.extend({},{filesModelBackup:o.clone(),localFilesBackup:p}),e.Util.isCEF()&&(i=_.extend({},i,{recipientsAreFinalized:!0})),m=_.bind(function(){var i,o,r=this.options;if(e.Util.isCEF()){var d=n.get("deadline")?n.get("deadline").toISOString():"",u=n.get("reminder")?n.get("reminder").toISOString():"";M?this.options.appApi.rnaApi.done(_.bind(function(i){e.Util.isReader()&&1==this.sharingForInitallySignedOutReader&&(this.sharingForInitallySignedOutReader=!1);var t=!1,s=this.options.sendFilesUiModel.get("limits_model");!_.isUndefined(s)&&s.get("original_sharing_enabled")&&(t=!0);var n={email_message:c,email_subject:h,deadLineDate:d,reminderDate:u,participants:b,original_sharing_enabled:t};i.stApi.UnifiedShareInitiateAsyncReview(n),i.rnaUnifiedSharePopupAPI.hidePopup(),this._drawNextPane()},this)):this.options.sendFilesUiModel.get("isShareViewSyncEnabled")?this.options.appApi.rnaApi.done(_.bind(function(i){e.Util.isReader()&&1==this.sharingForInitallySignedOutReader&&(this.sharingForInitallySignedOutReader=!1);var t=!1,s=this.options.sendFilesUiModel.get("limits_model");!_.isUndefined(s)&&s.get("original_sharing_enabled")&&(t=!0);var n={email_message:c,email_subject:h,participants:b,original_sharing_enabled:t};i.stApi.UnifiedShareInitiateAsyncView(n),i.rnaUnifiedSharePopupAPI.hidePopup(),this._drawNextPane()},this)):this._reorderCollections("preUpload").then(_.bind(function(){r=this.options,i=new s.BeginDesktopUploadOp(r),f=new s.FindingUploadFolderOp(r),o=_.bind(function(){r.parentId=f.id,_.isUndefined(f.persistence)||(r.persistence=f.persistence),n.get("local_file_objects").length>0&&n.set("share_loader_text",a.SHARE_LOADER_UPLOAD3),i.run().then(_.bind(function(){this._updateProgressBarStatus("100%"),this._onShareClickFinish(r,t)},this),_.bind(function(){this._onShareError(t,l.ERROR_UPLOAD),this._resetAfterError(t)},this))},this),p.length?f.run().then(o,_.bind(function(){this.options.appApi.networkConnectivityApi.isOnline()||this._onShareError(t,l.NO_CONNECTIVITY),this._resetAfterError(t)},this)):o()},this),_.bind(function(){this._resetAfterError(t)},this))}else i=new s.DoUploadOp(r),f=new s.FindingUploadFolderOp(r),o=_.bind(function(){r.parentId=f.id,_.isUndefined(f.persistence)||(r.persistence=f.persistence),i.run().then(_.bind(function(){this._updateProgressBarStatus("100%"),this._onShareClickFinish(r)},this),_.bind(function(){this._onShareError(t,l.ERROR_UPLOAD),this._resetAfterError(t)},this))},this),p.length?f.run().then(o):o()},this),S=_.bind(function(){var e=(this.options.appApi.dialogApi,_.template('<div class = "learn-more-sharing"><%=LEARN_MORE%></div>')({LEARN_MORE:a.LEARN_MORE}),a.FILE_CANT_BE_SENT),i=a.SHARE_ERROR_ENTERPRISE_SEND_DLG_MSG,s=this.options.sendFilesUiModel.get("ShareVariant"),n=l.USE,o="Sharing Restriction Error Prompt Shown";this.options.appApi.siteCatalystApi.logScEvent([s,n,o]),this.showErrorBubble(l.INVITE_PEOPLE_ERROR,e,i,!0),$(".learn-more-sharing").click(this._onSharingLearnMore),this._resetAfterError(t)},this),E=_.bind(function(e){if(e){var i=this.options.limitsModel.get("restrictions_white_list");
if(-1!==$.inArray("all",i))m();else if(-1!==$.inArray("none",i))S();else{var t=this.options.sendFilesUiModel.getRecipientsArray(),s=_.find(t,function(e){var t=e.split("@").pop();return-1===$.inArray(t,i)?!0:!1});_.isUndefined(s)?m():S()}}else m()},this),g=_.bind(function(){n.setShareState("Sharing");var e=this.options.appApi.rnaApi;e.done(_.bind(function(e){E(e.isFeatRunning()?!1:!1)},this))},this),this.options=_.extend({},this.options,i),e.Util.isCEF()){if(this.options.appApi.sessionApi.isSignedInReader()){if(C){var L=this.options.sendFilesUiModel.get("ShareVariant"),T="SignedInViaSignInDialog";this.options.appApi.siteCatalystApi.logScEvent([L,l.INVITE_MODE,,T]),this.options.appApi.rnaApi.done(_.bind(function(e){e.rnaUnifiedSharePopupAPI.restoreUnifiedSharePopup("ShareViaInvite")},this))}n.setShareState("Sharing"),this._updateProgressBarStatus("50%")}this.options.appApi.sessionApi.ensureSignedIn().then(_.bind(function(){n.setShareState("Sharing"),this._updateProgressBarStatus("50%"),setTimeout(_.bind(function(){this._resolveRecipientsAddressesList(this.options.recipients).always(_.bind(function(){this.options=_.extend({},this.options,this._postSignInFunction()),this.options.readRegistry=!1,s.opFactory.create("DesktopGettingSubscriptionLevels",this.options).run().then(_.bind(function(){return this._checkMaximumRecipients(this.options.recipients)===!1?void this._resetAfterError(t):void g()},this),_.bind(function(e){423==e.status?this.options.appApi.rnaApi.done(_.bind(function(e){e.invokeMethod({methodName:"triggerMigrationInProgressError",methodArgs:{}})},this)):this._onShareError(t,l.UNKNOWN_SERVICE_ERROR),this._resetAfterError(t)},this))},this))},this),100)},this),_.bind(function(e){e&&"NoAccessToPdfServices"===e.errorString&&this._displayNoAccessToUser(e.errorCode)},this))}else this.options.appApi.sessionApi.isSignedIn()?m():this.options.appApi.sessionApi.ensureSignedIn().then(_.bind(function(){s.opFactory.create("GettingAuthenticatedModelsOp",this.options).run().then(m)},this))},this),_.bind(function(e){e&&"NoAccessToPdfServices"===e.errorString&&this._displayNoAccessToUser(e.errorCode)},this))}},_onShareClickFinish:function(i,t){{var n,o,r,d=this.options.sendFilesUiModel.get("share_collection"),p=this.options.sendFilesUiModel.get("metadata_collection");this.options.brandingModel}d.reset(),e.Util.isReader()&&1==this.sharingForInitallySignedOutReader&&(this.sharingForInitallySignedOutReader=!1),this.options.is_review&&this._resetAppId(),p.each(_.bind(function(e){var i=new s.FileMetadataModel;i.set(_.clone(e.attributes)),d.add(i)},this)),this.options=_.extend({},this.options,i),r=_.extend({shareFiles:d},i),this._reorderCollections("postUpload").then(_.bind(function(){r.shareFiles.length&&(n=new s.ShareFilesOp(r),n.run().then(_.bind(function(e){this._updateProgressBarStatus("100%");var i;if(i=_.bind(function(e){var i;e&&(i=$.trim(e.toLowerCase()),this.options.autoCCollection.add({email:i}));var t=this.options.sendFilesUiModel.get("ShareVariant"),s=l.USE,n="Share For View";"#review-mode"===this.options.sendFilesUiModel.get("us_mode")&&(n="Share For Review"),this.options.appApi.siteCatalystApi.logScEvent([t,s,n])},this),_.each(this.options.recipients,i),!this.options.is_review){var t={};t.op="addParcel",t.parcel=e.parcel,this.options.appApi.rnaApi.done(_.bind(function(e){e.stApi.updateInAppDMStateAPI(t)},this))}this.options.sendFilesUiModel.set({active_view:"success",parcel:e.parcel}),this._logFormShareSuccess();var s=this.options.sendFilesUiModel.get("ShareVariant"),n=l.SUCCESS,o="Send";this.options.appApi.siteCatalystApi.logScEvent([s,n,o]),this._drawNextPane(),this.$shareButton.show()},this),_.bind(function(i){function s(e){var i={Unauthorized:a.SHARE_UNVERIFIED_ID_MSG,PDFIsPortfolio:a.REVIEW_DISABLE_REASON_PORTFOLIO_MODAL,PDFIsPasswordProtected:a.REVIEW_DISABLE_PROTECTED_MODAL,PDFIsCertificateProtected:a.REVIEW_DISABLE_PROTECTED_MODAL,PDFIsUnknownProtected:a.REVIEW_DISABLE_PROTECTED_MODAL,PDFIsPolicyProtected:a.REVIEW_DISABLE_PROTECTED_MODAL,PDFIsPDFA:a.REVIEW_DISABLE_REASON_PDFA_MODAL,UnsupportedCommentsPDF:a.REVIEW_DISABLE_REASON_UNSUPPORTED_ANNOTS_MODAL,PDFIsSecure:a.REVIEW_DISABLE_PROTECTED_MODAL,PDFIsInvalid:a.REVIEW_DISABLE_REASON_INVALID_FILE_MODAL,InvalidComment:a.REVIEW_DISABLE_REASON_UNSUPPORTED_ANNOTS_MODAL,InvalidCommentBodyLength:a.REVIEW_DISABLE_INVALID_COMMENT_LENGTH_MODAL,CommentCountExceeded:a.REVIEW_DISABLE_COMMENT_COUNT_EXCEEDED_MODAL,CommentsExtractionSizeExceeded:a.REVIEW_DISABLE_COMMENT_EXTRACTION_ERROR,Unknown:a.REVIEW_DISABLE_UNKNOWN_ERROR};try{var t=JSON.parse(e.responseText);n=t.error.code}catch(s){}if(_.isUndefined(n))try{var t=JSON.parse(e.responseText);n=t.parcels[0].reason_for_failed_state}catch(s){}n&&(r=i[n])}var n,r;s(i);var d=this.options.appApi.dialogApi;if("SendLimitExceeded"===n){var p=this.options.limitsModel.get("can_upgrade_send");if(p)this._displayShareUpsellDialog(a.SHARE_LIMIT_EXCEEDED_DLG_TITLE,a.SHARE_UPSELL_MSG);else if(this.options.limitsModel.get("restrictions"))d.displayHtmlAlert(d.SEVERITY_ERROR,a.SHARE_LIMIT_EXCEEDED_DLG_TITLE,a.SHARE_LIMIT_EXCEEDED_DLG_MSG,a.CLOSE_STRING);else{var h=this.options.sendFilesUiModel.get("ShareVariant"),c=l.USE,u="Invite Send limit reached.";this.options.appApi.siteCatalystApi.logScEvent([h,c,u]);var m=_.template(a.SHARE_RECIPIENTS_LIMIT_PER_DAY_REACHED,{GET_LINK_HTML:_.template("<span id='get-link-hyperlink'><%=GET_LINK %></span>",{GET_LINK:a.SHARE_PUBLIC})});this.showErrorBubble(l.INVITE_PEOPLE_ERROR,a.SHARE_LIMIT_EXCEEDED_DLG_TITLE,m,!0)}}else if("UnsupportedSharingMimeType"===n)this.showErrorBubble(l.UNSUPPORTED_FILE_ERROR,a.SHARE_ERROR_UNSUPPORTED_DLG_TITLE,a.SHARE_ERROR_UNSUPPORTED_DLG_MSG);else if(_.isUndefined(r)){var E=this.options.sendFilesUiModel,g=E.get("local_file_objects").length+E.get("metadata_collection").length,S=g>1?a.SHARE_ERROR_SEND_MUL_DLG_MSG:a.SHARE_ERROR_SEND_DLG_MSG;this.showErrorBubble(l.INVITE_PEOPLE_ERROR,a.SHARE_ERROR_SEND_DLG_TITLE,S)}else this.showErrorBubble(l.INVITE_PEOPLE_ERROR,a.SHARE_ERROR_SEND_DLG_TITLE,r);try{o=JSON.parse(i.responseText).error.code}catch(f){}o&&0===o.indexOf("CannotConvertForm")&&this._logFormShareError(o),e.Util.isCEF()&&this._resetAfterError(t)},this)))},this),_.bind(function(){this._onShareError(t,l.NO_CONNECTIVITY),this._resetAfterError(t)},this))},_launchSFSWithData:function(e){return console.log("launching SFS app .... "),this.options.appApi.rnaApi.then(_.bind(function(i){var t=this.options.sendFilesUiModel.getRecipientsArray(),s=[{transientDocIds:this.options.canSignUiModel.get("transient_Doc_Ids"),esAccessToken:"Bearer "+this.options.esAuthUiModel.get("access_token"),emailSubject:this._getSubjectText(!0),emailMessage:this._getMessageText(),recipients:t,agreementStatus:e}];return i.stApi.launchSendForSignWithTransientDocIdsAPI(s).then(_.bind(function(){return $.Deferred().resolve().promise()},this),_.bind(function(){return $.Deferred().reject().promise()},this))},this),_.bind(function(){return $.Deferred().reject().promise()},this))},_showLoader:function(){this.$closeShareButton.hide()},_showShareButton:function(){this.$shareButton.show(),this._toggleSendButton()},_getSubjectText:function(e){var i=this.options.sendFilesUiModel,t=i.get("us_subject_text");return e&&(t=t.replace(a.SHARE_INITIAL_SUBJECT_PREFIX,"")),t},_getMessageText:function(){var e=this._emailAddressView._getMessageText();return e},_onShareError:function(e,i){if(i===l.NO_CONNECTIVITY)this.showErrorBubble(l.INVITE_PEOPLE_ERROR,a.SHARE_NO_INTERNET_CONNECTION,a.SHARE_NO_INTERNET_CONNECTION_MSG);else if(i===l.UNKNOWN_SERVICE_ERROR)this.showErrorBubble(l.INVITE_PEOPLE_ERROR,a.COULD_NOT_COMPLETE_REQUEST,a.COULD_NOT_COMPLETE_REQUEST_MSG);else if(i===l.REVIEW_NOT_PERMITTED){var t=this.options.sendFilesUiModel.get("ShareVariant"),s=l.USE,n="Review not supported";this.options.appApi.siteCatalystApi.logScEvent([t,s,n]),this.showErrorBubble(l.INVITE_PEOPLE_ERROR,a.SHARE_REVIEW_RESTRICTED,a.SHARE_REVIEW_RESTRICTED_MSG).done(_.bind(function(){this.options.sendFilesUiModel.setUSMode("#send-mode"),this.options.sendFilesUiModel.setCLMode("#send-mode")},this))}else this.showErrorBubble(l.INVITE_PEOPLE_ERROR,a.SHARE_UPLOAD_ERROR_TITLE,a.SHARE_UPLOAD_ERROR_MSG)},_onSharingLearnMore:function(){this.options.appApi.rnaApi.then(_.bind(function(e){e.stApi.launchSendTrackRestrictionsLearnMoreUrl()}))},_launchLearnMoreInvite:function(){this.options.appApi.rnaApi.done(_.bind(function(e){e.openDecoratedUrl(a.INVITE_LEARN_MORE_GO_URL)},this))},_resetAfterError:function(i){var t=this.options.sendFilesUiModel;t.setShareState("preShare"),this.$shareButton.show(),t.set("metadata_collection",i.filesModelBackup.clone()),t.set("local_file_objects",i.localFilesBackup),e.Util.isReader()&&1==this.sharingForInitallySignedOutReader&&(this.sharingForInitallySignedOutReader=!1)},_onSubjectInput:function(){console.log("_onSubjectInput us-share-tab-view");var e=this._getSubjectText(!1);this.options.sendFilesUiModel.setSubjectText(e)},_onSubjectPaste:function(){console.log("_onSubjectPaste us-share-tab-view"),_.delay(_.bind(function(){var e=this._getSubjectText(!1);this.options.sendFilesUiModel.setSubjectText(e)},this),100)},_onSubjectBlur:function(){console.log("_onSubjectBlur us-share-tab-view");var e=this._getSubjectText(!1);this._checkNameLength(e)},_onMessageInput:function(){console.log("_onMessageInput");var e=this._getMessageText();this.options.sendFilesUiModel.setMessageText(e)},_onMessagePaste:function(){console.log("_onMessagePaste");var e=$(".us-share-popup-message-input").scrollTop(),i=$(".us-share-popup-message-input").prop("scrollHeight");_.delay(_.bind(function(){var t=this._getMessageText();this.options.sendFilesUiModel.setMessageText(t);var s=$(".us-share-popup-message-input").prop("scrollHeight");$(".us-share-popup-message-input").scrollTop(e+(s-i))},this),100)},_onMessageBlur:function(){console.log("_onMessageBlur us-share-tab-view");var e=this._getMessageText();this._checkMessageLength(e)},_renderOfflineView:function(){console.log("Render offlineView")},_fetchingSubscriptionWait:function(e){e?(this.$fullOverlay=this.options.appApi.displayApi.showFullOverlay(!0),this.$fullOverlay.addClass("progress-fetch-subscription")):(this.$fullOverlay.removeClass("progress-fetch-subscription"),this.options.appApi.displayApi.showFullOverlay(!1))},_resolveRecipientsAddressesList:function(e){return this.options.appApi.rnaApi.then(_.bind(function(i){if(_.isUndefined(e)||0===e.length)return this._getResolvedPromise();var t=this.options.recipients;return i.stApi.getLastUsedPreferences().then(_.bind(function(s){return s&&1==s.remeberChoice?this._getResolvedPromise():i.stApi.getResolvedEmailAddressesListAPI(e).then(_.bind(function(e){var i;return 0===e.length?$.Deferred().reject().promise():(i=e.split(";"),i.pop(),this.options.recipients=[],i.every(_.bind(function(e){return-1!==e.indexOf("@")?(this.options.recipients.push(e),!0):(this.options.recipients=t,!1)},this)),$.Deferred().resolve().promise())},this),_.bind(function(){return $.Deferred().reject().promise()},this))},this),_.bind(function(){return $.Deferred().reject().promise()},this))},this),_.bind(function(){return $.Deferred().reject().promise()},this))},_postSignInFunction:function(){var e,i,t=this.options,s=this.options.is_public,n=this.options.recipients,o=this.options.is_individual;return i=this.options.appApi.baseFilesUrisApi.getAlternateUploadUri(),this.options.appApi.siteCatalystApi.logScEvent([l.TOOLS,this.options.sendFilesUiModel.get("ShareVariant"),l.SHARE_BUTTON,"async"]),this._logSharingParams(s,o,n),e=this.options.appApi.baseFilesUrisApi.getSendApiUri(),e=r.extractRootUrl(e),t={rootUrl:e,uploadUrl:i}},_resetPageToDefault:function(){console.log("Draw the success view for Create Link")},_drawNextPane:function(){console.log("Draw the success view for share");var e=this.options.sendFilesUiModel;e.setShareState("postShare")},_onUsShareStateChange:function(){console.log("on share state changed");var e=this.options.sendFilesUiModel,i=e.get("us_share_state");this.$shareLoader.hide(),this._toggleSendButton(),"avNotAllowed"===i?(this._renderChildView("_subscribeNowView",s.UsPopupSubscribeNow,this.$usSubscribeNowView),this.$shareLoader.hide(),this.$Loadertext.hide()):"preShare"===i?(this.$usSuccessView.hide(),this.$usPrimaryView.show(),this.$shareLoader.hide(),this.$Loadertext.hide(),this._emailAddressView.enable(!0),this.$PopupIpAllowCommentsCheckBox.removeAttr("disabled"),this.$popupAllowCommentsContainer.removeClass("disabled"),this._updateProgressBarStatus("0%")):"postShare"===i?(this.$shareLoader.hide(),this.$Loadertext.hide(),"#send-mode"!==e.get("us_mode")||e.get("isShareViewSyncEnabled")?"#review-mode"===e.get("us_mode")&&this._hidePopup():(this._renderChildView("_shareSuccessView",s.UsPopupShareSuccessView,this.$usSuccessView),this.$usSuccessView.show(),this.$usPrimaryView.hide()),this._emailAddressView.enable(!0),this.$PopupIpAllowCommentsCheckBox.removeAttr("disabled"),this.$popupAllowCommentsContainer.removeClass("disabled"),this.$("#us-popup-send-again-link").focus(),this._updateProgressBarStatus("0%")):(this.$shareLoader.show(),this._setLoaderText(),this._emailAddressView.enable(!1),this.$PopupIpAllowCommentsCheckBox.attr({disabled:"disabled"}),this.$popupAllowCommentsContainer.addClass("disabled"))},_setLoaderText:function(){this.$Loadertext.text(a.USM_SENDING),this.$Loadertext.show()},_updateLoaderText:function(){var e=this.options.sendFilesUiModel,i=e.get("us_mode");this.$Loadertext.show(),"#send-mode"===i&&this.$Loadertext.text(e.get("share_loader_text"))},_hidePopup:function(){this.options.appApi.rnaApi.done(_.bind(function(e){e.rnaUnifiedSharePopupAPI.hidePopup()},this))},_resetAppId:function(){this.options.appApi.rnaApi.done(_.bind(function(e){e.rnaUnifiedSharePopupAPI.resetAppId()},this))},_openGetLinkPopup:function(){this.options.appApi.rnaApi.done(_.bind(function(e){e.rnaUnifiedSharePopupAPI.openGetLinkPopup()},this))},_updateProgressBarStatus:function(e){this.$progressBar.width(e)},_resetUI:function(){this._emailAddressView._resetMessageInput(),this._toggleMessage()},_adjustTooltipPosition:function(){var e=$(".us-share-popup-icon-cell").position();if(e){var i=e.left;$(".us-share-popup-icon-cell .popup-share-tooltip-position").css({"margin-left":-1*i+"px"}),$(".us-share-popup-icon-cell .popup-tooltip-arrow").css({"margin-left":i-9+"px"})}},_logSharingParams:function(e,i,t){var s,n,o,a,r=this.options.appApi.siteCatalystApi;e&&r.logScEvent([l.TOOLS,this.options.sendFilesUiModel.get("ShareVariant"),l.SHARE_WITH,l.PUBLIC]),a=l.DEFAULT,r.logScEvent([l.TOOLS,this.options.sendFilesUiModel.get("ShareVariant"),l.SUBJECT,a]),i&&(n=[l.TOOLS,this.options.sendFilesUiModel.get("ShareVariant"),l.SHARE_WITH,l.PERSONAL],r.logScEvent(n),s=t.length,o=1===s?l[1]:5>=s?l["2_TO_5"]:10>=s?l["6_TO_10"]:l["11_OR_MORE"],n.push(o),r.logScEvent(n),a=l.ENTERED,r.logScEvent([l.TOOLS,this.options.sendFilesUiModel.get("ShareVariant"),l.MESSAGE,a])),this._logFormShareStarted()},_logFormShareStarted:function(){var e,i,t=this.options.appApi.siteCatalystApi;this._parcelHasForms()&&(e=[l.TOOLS,l.FSS,l.FORM,l.OUTPUT,l.SAVE_TO_PDF,l["1_STARTED"],l.SEND_TAB],i=e.join(":"),t.logScEvent(e,{featureType:i}))},_logFormShareSuccess:function(){var e,i,t,s=this.options.appApi.siteCatalystApi;this._parcelHasForms()&&(e=[l.TOOLS,l.FSS,l.FORM,l.OUTPUT,l.SAVE_TO_PDF,l["2_COMPLETED"],l.SEND_TAB],i=e.join(":"),t=[l.TOOLS,l.FSS,l.FORM,l.COMPLETED].join(":"),s.logScEvent(e,{featureType:i,sectionName:t}))},_logFormShareError:function(e){var i,t,s,n=this.options.appApi.siteCatalystApi;if(this._parcelHasForms()){var o="ServerError";switch(e){case"CannotConvertFormTimeout":o="TimeOut";break;case"CannotConvertFormRestrictedEditPermission":o="PermSet"}i=[l.TOOLS,l.FSS,l.FORM,l.OUTPUT,l.SAVE_TO_PDF,l.ERROR,o,l.SEND_TAB],t=i.join(":"),s=[l.TOOLS,l.FSS,l.FORM,l.OUTPUT,l.SAVE_TO_PDF,l.ERROR].join(":"),n.logScEvent(i,{featureType:t,sectionName:s})}},_parcelHasForms:function(){var e,i,s,n=!1;return e=this.options.sendFilesUiModel,i=e.get("metadata_collection"),s=e.get("enable_form_send"),s&&(n=i.some(function(e){return t.isFormMimeType(e.get("content_type"))})),n},_displayShareUpsellDialog:function(e,i){var t=_.extend({},{okButtonClass:"us-upsell-learn-more",cancelButtonClass:"us-upsell-close"}),s=this.options.appApi.dialogApi,n=s.displayHtmlAlert(s.SEVERITY_WARNING,e,i,a.LEARN_MORE,a.CLOSE_STRING,t);return $(".alert-dlg-buttons-rhp").css({"text-align":"right",direction:"rtl"}),$(".us-upsell-learn-more").css({"padding-left":"15px","padding-right":"15px","margin-left":"10px","margin-right":"5px"}),n.then(_.bind(function(){this._onUpsell()},this)).always(_.bind(function(){$(".alert-dlg-buttons-rhp").css({"text-align":"center",direction:"ltr"})},this))},_checkMaximumRecipients:function(e){var i,t=this.options.sendFilesUiModel,s=t.get("limits_model"),n=!1,o=t.get("us_mode");if(e)if(i=_.isUndefined(s)?250:s.get("#send-mode"===o?"max_recipients":"max_review_recipients"),e.length>i){var l=s.get("can_upgrade_send"),r=s.get("can_send_to_individuals");r?(l?this._displayShareUpsellDialog(a.SHARE_LIMIT_EXCEEDED_DLG_TITLE,a.SHARE_UPSELL_MSG):this._displayTooManyRecipients(e.length,i),n=!1):n=!0}else n=!0;return n},_displayTooManyRecipients:function(e,i){console.log("Too many recipients");var t=(this.options.appApi.dialogApi,a.SHARE_TOO_MANY_RECIPIENTS_DLG_TITLE),s=_.template(a.SHARE_TOO_MANY_RECIPIENTS_DLG_MSG,{maxRecipients:i});this.showErrorBubble(l.INVITE_PEOPLE_ERROR,t,s,!0)},_displayNoAccessToUser:function(e){{var i,t;this.options.appApi.dialogApi}i=a.COULD_NOT_SEND,t="UserEncrypted"===e?a.ENCRYPTION_KEY_DISABLED_MESSAGE:a.ENTERPRISE_USERS_ACCESS_ERROR,this.showErrorBubble(l.INVITE_PEOPLE_ERROR,i,t)},_setSFSWorkflowInProgress:function(){this.options.appApi.rnaApi.done(_.bind(function(e){e.esApi.setSFSWorkflowInProgress(!0)},this))},_clearSFSWorkflowInProgress:function(){this.options.appApi.rnaApi.done(_.bind(function(e){e.esApi.setSFSWorkflowInProgress(!1)},this))},showErrorBubble:function(e,i,t,s){this.$shareLoader.hide(),this.$Loadertext.hide(),e==l.INVITE_PEOPLE_ERROR?($(".us-popup-share-error-dialog").show(),s===!0?$(".us-popup-share-error-dialog").find(".us-popup-error-dialog-content-text").html(t):$(".us-popup-share-error-dialog").find(".us-popup-error-dialog-content-text").text(t)):e==l.DEADLINE_ERROR?($(".us-popup-deadline-error-dialog").show(),$(".us-popup-deadline-error-dialog").find(".us-popup-error-dialog-content-text").text(t)):e==l.REMINDER_ERROR&&($(".us-popup-reminder-error-dialog").show(),$(".us-popup-reminder-error-dialog").find(".us-popup-error-dialog-content-text").text(t));var n=_.invert(a);if(n[t]){var o=n[t];this.options.appApi.siteCatalystApi.logScEvent([this.options.sendFilesUiModel.get("ShareVariant"),l.INVITE_MODE,l.ERROR_BUBBLE_SHOWN,o])}return $.Deferred().resolve().promise()},hideErrorBubble:function(e){void 0!==e&&e.target.classList.contains("share-files-button")||$(".us-popup-error-dialog-container").hide()},_addKeyEventListener:function(){this.options.appApi.keyApi.pushKeyHandler(this)},_onKeyDown:function(e){var i=!1,t=e.which;if(!$(".us-popup-error-dialog-container:visible").length||9!=t&&40!=t&&38!=t&&27!=t||(this.hideErrorBubble(),i=!0),13==t&&($("#popup-invite-summary-learn-more").is(":focus")?(this._launchLearnMoreInvite(),i=!0):"popup-ip-allow-comments-checkbox"==e.target.id?(e.target.click(),e.target.focus(),i=!0):"popup-share-info"==e.target.id?this.$popupShareInfo.addClass("hovered"):"ui-popup-learn-more"==e.target.classList[0]&&this._onLearnMoreBtnClick()),9==t){var s=$("*[tabindex = 0]:visible"),n=$("*[tabindex = 1]:visible"),o=s.index(e.target);0==o&&e.shiftKey?(s.eq(s.length-1).focus(),i=!0,e.preventDefault()):o!=s.length-1||e.shiftKey||(s.eq(0).focus(),i=!0,e.preventDefault()),n.length>0&&(o=n.index(e.target),0==o&&e.shiftKey?(n.eq(n.length-1).focus(),i=!0,e.preventDefault()):o!=n.length-1||e.shiftKey||(n.eq(0).focus(),i=!0,e.preventDefault()))}return i},_launchLearnMoreAction:function(){var e=this.options.sendFilesUiModel.get("us_mode");this.options.appApi.rnaApi.done("#review-mode"===e?_.bind(function(e){e.openDecoratedUrl(a.REVIEW_LEARN_MORE_LINK_GO_URL)},this):_.bind(function(e){e.openDecoratedUrl(a.INVITE_LEARN_MORE_GO_URL)},this))},_onLearnMoreBtnClick:function(){var e=a.POP_SHARE_CREATE_LINK_LEARN_MORE_LINK;_.isEmpty(e)||this.options.appApi.rnaApi.done(_.bind(function(i){i.openDecoratedUrl(e)},this))}}),s.UsPopupShareView}),define("pdmplugins/send-for-sign/js/ac-send-for-sign",["plugins-common/ac-plugins"],function(e){var i=e.SendForSign;return i||(i=e.SendForSign={}),i.PLUGIN_ID||(i.PLUGIN_ID="send_for_sign"),i}),define("pdmplugins/unified-share/js/popupView/templates/us-popup-send-mail-template",[],function(){return'<div id="us-popup-send-mail-container"><div id="sm-default-state"><div colspan="100%" style="padding-bottom:10px;" class=" popup-sm-heading ui-theme theme-text"> <%= EMAIL_OPENED %> </div><div class="ui-theme theme-header-text us-sm-desc-text"><text  id="sm-mail-sent-desc"></text><text id="pref_launcher" class="ui-theme theme-text theme-share-add-files"><%= PREFERENCES %></text></div><div class = "share-popup-button-bar" ><button class="control-button theme-button theme-button-label ui-theme theme-text floating-window-button-text" id="sm-send-again"><%= SEND_AGAIN %></button></div></div><div id="sm_no_default_state"><div class = "sm-mode-selector"></div><div class = "sm-profile-selector"></div><div id="sm-include-link-options-container" class="ui-theme toggle-theme sm-include-link-options-container"><div id="sm-include-link-container"><label class="switch"><input tabindex= "0" id="sm-include-link-checkbox" type="checkbox" role="switch"><span id ="send-by-email-toggle" class="slider round"></span></label><span class="ui-theme theme-text"><%= INCLUDE_LINK %></span></div><span class="ui-theme theme-text" id="sm-include-link-info-text"><%= INCLUDE_LINK_INFO %> <span class="ui-theme theme-text" id="sm-include-link-sign-in-info"><%= SIGN_IN_REQUIRED %></span></span></div><div class = "us-popup-error-dialog-container us-popup-send-mail-error-dialog ui-theme theme-share-border"><span class = "us-popup-error-dialog-arrow us-popup-error-dialog-send-mail-arrow"></span><div class="us-popup-error-dialog-content us-popup-send-mail-error-dialog-content"><div class= "us-popup-error-dialog-content-text"></div></div></div><div class = "share-popup-button-bar"><button tabindex = "0" class="sm-button control-button theme-button theme-button-label floating-window-button-text" id="sm-continue" aria-label ="<%= SM_CONTINUE %>" ><%= SM_CONTINUE %></button></div></div></div>'}),define("pdmplugins/unified-share/js/popupView/templates/us-popup-send-mail-template-add-signers",[],function(){return'<div id="us-popup-send-mail-get-sign-container" class="us-popup-send-mail-get-sign-container ui-theme theme-container theme-share-grey-container">      	<div id="send-by-mail-nv-popup-heading-table-close-container">          <div id="sm-nv-table-container">				<div id="send-email-container" tabindex="0" class="send-by-mail-nv-popup-table-content ui-theme theme-text theme-share-grey-container">             		<table id="send-email-table" class="ui-theme theme-text theme-share-grey-container" aria-label="<%= SEND_BY_EMAIL_NV %>" >              			<tr>                			<td id="td-send-mail-radio-button">					 			<div id="send-email-radio-button-container" class="send-by-mail-nv-popup-table-radio-button popup-radio-cell">									<input tabindex="-1" type="radio" id="send-email-radio-button" name="send-email-radio-button" value="locked-copy" checked>								</div>				 			</td>                			<td>								<div id="send-by-email-header" tabindex="-1" class="send-by-mail-nv-popup-table-heading ui-theme theme-text"> <%= SEND_BY_EMAIL_NV %> </div>				 			</td>              			</tr>            		</table><div id="send-email-content"><div id="sm-default-state"><div colspan="100%" style="padding-bottom:10px;" class=" popup-sm-heading ui-theme theme-text"> <%= EMAIL_OPENED %> </div><div class="ui-theme theme-header-text us-sm-desc-text"><text  id="sm-mail-sent-desc"></text><text id="pref_launcher" class="ui-theme theme-text theme-share-add-files"><%= PREFERENCES %></text></div></div><div id="sm_no_default_state"><div class = "sm-mode-selector" ></div><div class = "sm-profile-selector" ></div><div id="sm-include-link-options-container" class="ui-theme toggle-theme attach-link-container-nv"><div id="sm-include-link-container-nv"><label id="link-toggle-btn" class="switch"><input tabindex= "0" id="sm-include-link-checkbox" type="checkbox"><span id="send-by-email-toggle" class="slider round"></span></label><span id="attach-link-text-nv" class="ui-theme theme-text"><%= INCLUDE_LINK %></span><div id="attach-link-info-nv" class="ui-theme theme-text" aria-label ="<%= attach_link_info %>"> <%= attach_link_info %> </div></div></div></div>					</div>				</div>            <table id="send-by-mail-nv-request-signature-table" tabindex= "0" aria-label="<%= GET_SIGNATURES_NV %>" class="send-by-mail-nv-popup-table-content ui-theme theme-text theme-share-grey-container">              <tr>                <td>					<div id="request-signature-radio-button-container" class="send-by-mail-nv-popup-table-radio-button popup-radio-cell">						<input tabindex="-1" type="radio" id="request-signature-radio-button" name="request-signature-radio-button" value="request-signature">					</div>				 </td>                <td>					<div id="send-by-mail-request-signature-text" class="send-by-mail-nv-popup-table-heading ui-theme theme-text"> <%= GET_SIGNATURES_NV %> </div>				 </td>              </tr>              <tr>				 <td colspan="2">					<div id="send-by-mail-nv-request-sig-info-container">						<div id = "send-by-mail-nv-request-sig-info" class="ui-theme theme-text"><%= request_signature_info %></div>					</div>				 </td>              </tr>            </table>          </div>    	</div> <div style="display:flex;height:100%"><div style="flex:1 1 auto;"> </div></div>     <div class = "sfs-nv-generic-error-parent hidden">           <table class = "sfs-nv-generic-error-table">              <tr>                 <td><div class="sm-popup-req-sig-caution-img"></td>                 <td><div class="sfs-nv-generic-error-msg"></div></td>                 <td><span id="sfs-nv-generic-error-close-button" class="theme-text"><span></td>               <tr>           </table>    </div><div class = "send-mail-popup-button-bar-nv"><button tabindex="0" class="sm-button control-button theme-button theme-button-label floating-window-button-text" id="sm-continue" aria-label ="<%= SM_CONTINUE %>" ><%= SM_CONTINUE %></button><button class="control-button theme-button theme-button-label ui-theme theme-text floating-window-button-text" id="sm-send-again"><%= SEND_AGAIN %></button>	</div>	<div id="add-signers-screen-nv"><div id="sm-add-signers-container"><div id="sm-popup-req-sig-landing-page-content" class="ui-theme theme-container">     <div class="sm-popup-req-sig-view-title theme-text" aria-label="<%= add_signers_title %>" > <%= add_signers_title %></div></div>  <div id="sm-popup-req-sig-scrollable-div">  <div class = "sm-popup-req-sig-info-content-container sm-popup-req-sig-add-signers-div">   	<div id="popup-sm-email-address-template-container" class ="ui-theme theme-share-container"></div>     	<div id="us-popup-sm-more-options" class="sm-popup-req-sig-more-options">         	<a id="more-op" class="ui-theme theme-hyperlink" style="float:left" ><%=more_options%></a>     	</div> 		</div> 	</div>     <div class = "sm-popup-req-sig-email-error-parent hidden">           <table class = "sm-popup-req-sig-email-error">              <tr>                 <td><div class="sm-popup-req-sig-caution-img"></td>                 <td><div class="sm-popup-req-sig-email-error-msg"></div></td>                 <td><span id="sm-popup-req-sig-close-button" class="theme-text"><span></td>               <tr>           </table>    </div>    <div class="sm-popup-req-sig-bottom-CTA-row">        <input type="button" id = "sm-popup-req-sig-cancel-btn" class=" control-button button-grey site-catalyst ui-theme theme-text" tabindex="9" aria-label="<%= back %>" value="<%= back %>"/>        <input type="button" id = "specify-where-to-sign-btn" class=" control-button sm-popup-req-sig-file-action-btn-new 1 site-catalyst theme-button theme-button-label" tabindex="8" aria-label="<%= specify_where_to_sign %>" value="<%= specify_where_to_sign %>"/>    </div> 	</div>      <div class="sm-popup-req-sig-loader-container hidden">          <div id="uploading-to-adobe-sign-text" class= "ui-theme theme-text"><%= uploadingText %></div>      </div>     <div class = "sm-popup-server-error-parent hidden">           <table class = "sm-popup-server-error">              <tr>                 <td>					<div class="sm-popup-server-error-img"></div>					<div class="sm-popup-server-error-header  ui-theme theme-text"></div>					</td>               </tr>              <tr>                 <td><div class="sm-popup-server-error-content  ui-theme theme-text"></div></td>               </tr>           </table>        <input type="button" id = "sm-popup-server-error-back-btn" class=" control-button button-grey site-catalyst ui-theme theme-text" tabindex="9" aria-label="<%= back %>" value="<%= back %>"/>    </div></div>'}),define("pdmplugins/unified-share/js/popupView/templates/us-popup-sm-service-selector-view-template",[],function(){return'<div><div id="sm-service-header-title" style="padding-bottom:10px;" class=" popup-sm-heading ui-theme theme-text"> <%= ATTACH_EMAIL_HEADER %> </div><div class="custom-select"><select tabindex = "0" name="sm_mode" class="ui-theme theme-text theme-container theme-border webmail-profile-select"><option class="ui-theme theme-text profile-option" id="sm_default_mail" selected><%= DEFAULT_EMAIL %></option><option class="ui-theme theme-text profile-option hidden" id="sm_outlook"><%= MS_OUTLOOK %></option><option class="ui-theme theme-text profile-option" id="sm_webmail"><%= USE_WEBMAIL %></option></select></div></div>'}),define("pdmplugins/unified-share/js/popupView/views/us-popup-sm-service-selector-view",["core/ac-core","pdmplugins/unified-share/js/ac-unified-share","pdmplugins/unified-share/js/popupView/templates/us-popup-sm-service-selector-view-template","i18n!pdmplugins/unified-share/js/nls/ui-strings","core/utils/util"],function(e,i,t,s,n){return i.USPopupSMServiceSelectorView=e.View.extend({events:{"change select":"_selectService"},initialize:function(){e.View.prototype.initialize.call(this),this.showHeaderTitle=!0,!i.QueryParams||"SharePopup_RequestSignatures"!==i.QueryParams.shareVariant&&"SharePopup_RequestSignatures_Disclosed"!==i.QueryParams.shareVariant||"attachToEmail"!==i.QueryParams.launchApp||(this.showHeaderTitle=!1),this.mouseUp=!1},_showHideHeaderTitle:function(e){e?this.$headerTitle.show():this.$headerTitle.hide()},render:function(){this.$el;e.View.prototype.render.call(this),this._template=_.template(t);var o=s.DEFAULT_EMAIL_APP;!i.QueryParams||"SharePopup_RequestSignatures"!==i.QueryParams.shareVariant&&"SharePopup_RequestSignatures_Disclosed"!==i.QueryParams.shareVariant||"attachToEmail"!==i.QueryParams.launchApp||(o=s.SEND_BY_EMAIL_NV_DEFAULT_EMAIL_APP),0===this.$el.children().length&&(this.$el.html(this._template({DEFAULT_EMAIL:o,USE_WEBMAIL:s.USE_WEBMAIL,MS_OUTLOOK:s.EMAIL_CLIENT_OUTLOOK,DEFAULT_EMAIL_TITLE:o,USE_WEBMIAL_TITLE:s.USE_WEBMAIL,ATTACH_EMAIL_HEADER:s.SEND_BY_EMAIL_NV,ATTACH_USING:s.SEND_MAIL_ATTACH_USING})),this._initWrappers(),this._addEventListeners()),this._addUiModelEventListeners(),this._setEmailClientName(),this._selectModeFromServiceSelected(),n.isMac()&&this.options.appApi.rnaApi.then(_.bind(function(e){e.stApi.canShowOutlookUIOption()&&this._showOutlookUIOption()},this))},_initWrappers:function(){this.$SmDefaultMail=this.$("#sm_default_mail"),this.$smWebmail=this.$("#sm_webmail"),this.$headerTitle=this.$("#sm-service-header-title"),this.$outlookOption=this.$("#sm_outlook"),this._showHideHeaderTitle(this.showHeaderTitle)
},_addUiModelEventListeners:function(){var e=this.options.SendMailUiModel;e.on("change:send_mail_mode",this._onSendMailModeChange)},_onSendMailModeChange:function(){this.render()},_addEventListeners:function(){$(document).mouseup(_.bind(function(e){e.target.className.includes("service-selector-label")&&(this.mouseUp=!0)},this))},_selectService:function(e){var i=this.options.SendMailUiModel,t=$(e.currentTarget);if(t.length>0&&t[0].selectedOptions.length>0){var s=t[0].selectedOptions[0].id;i.set("send_mail_mode",s)}this.mouseUp&&t.blur(),this.mouseUp=!1},_setEmailClientName:function(){var e=s.DEFAULT_EMAIL_APP;!i.QueryParams||"SharePopup_RequestSignatures"!==i.QueryParams.shareVariant&&"SharePopup_RequestSignatures_Disclosed"!==i.QueryParams.shareVariant||"attachToEmail"!==i.QueryParams.launchApp||(e=s.SEND_BY_EMAIL_NV_DEFAULT_EMAIL_APP);var t=e+" ("+this.options.SendMailUiModel.get("default_email_client")+")";this.$SmDefaultMail.text(t)},_showOutlookUIOption:function(){var e=4;this.options.appApi.rnaApi.then(_.bind(function(i){i.stApi.isEmailClientInstalled(e).then(_.bind(function(e){2===e?(this.options.SendMailUiModel.set("show_outlook_option",!0),this.$outlookOption.show()):this.options.SendMailUiModel.set("show_outlook_option",!1)},this))},this))},_selectModeFromServiceSelected:function(){var e=this.options.SendMailUiModel.get("send_mail_mode");this.$("#"+e).attr("selected","selected")},_hideDisableWebmailUI:function(){this.$smWebmail.attr("disabled",!0),this.$smWebmail.addClass("disabled")}}),i.USPopupSMServiceSelectorView}),define("pdmplugins/unified-share/js/popupView/templates/us-popup-sm-webmail-profile-selector-template",[],function(){return'<div class = "ui-theme theme-text webmail-advisory" ><%= WEBMAIL_ADVISORY %></div><div class = "custom-select"><select class = " ui-theme theme-text theme-container theme-border webmail-profile-select"></select></div>'}),define("pdmplugins/unified-share/js/popupView/views/us-popup-sm-webmail-profile-selector",["core/ac-core","pdmplugins/unified-share/js/ac-unified-share","pdmplugins/unified-share/js/popupView/templates/us-popup-sm-webmail-profile-selector-template","i18n!pdmplugins/unified-share/js/nls/ui-strings"],function(e,i,t,s){return i.USPopupSMProfileSelector=e.View.extend({events:{"change .webmail-profile-select":"_onProfileSelect"},initialize:function(){e.View.prototype.initialize.call(this)},render:function(){this.$el;e.View.prototype.render.call(this),this._template=_.template(t),0===this.$el.children().length&&(this.$el.html(this._template({WEBMAIL_ADVISORY:s.WEBMAIL_ADVISORY})),this._initWrappers()),this._addUiModelEventListeners(),this._updateProfilesListUI(),this.updateSelectedProfileInUI()},_initWrappers:function(){this.$WebmailProfileSelect=this.$(".webmail-profile-select")},_addUiModelEventListeners:function(){var e=this.options.SendMailUiModel;e.on("change:email_addresses",this._updateProfilesListUI),e.on("change:selected_profile",this.updateCssOnProfileSelected)},updateCssOnProfileSelected:function(){var e=this.options.SendMailUiModel.get("selected_profile");""===e||e===s.SELECT_OPTION?this.$WebmailProfileSelect.css("font-style","italic"):this.$WebmailProfileSelect.css("font-style","normal")},_updateProfilesListUI:function(){var e=this.options.SendMailUiModel,i=_.clone(e.get("email_addresses")),t=Object.getOwnPropertyNames(i);t.reverse(),this.resetProfilesListUiToDefault();for(var s=0;s<t.length;s++)this.$WebmailProfileSelect.children("option").eq(1).before($("<option></option>").val(t[s]).text(t[s]));this.$WebmailProfileSelect.children("option").addClass("ui-theme theme-text profile-option"),this.$WebmailProfileSelect.children("option").first().hide()},_onProfileSelect:function(){var e=this.$WebmailProfileSelect.find("option:selected").text();this.options.SendMailUiModel.set("selected_profile",e)},resetProfilesListUiToDefault:function(){this.$WebmailProfileSelect.empty(),this.$WebmailProfileSelect.append($("<option></option>").val(s.SELECT_OPTION).text(s.SELECT_OPTION)),this.$WebmailProfileSelect.append($("<option></option>").val(s.ADD_GMAIL).text(s.ADD_GMAIL)),this.$WebmailProfileSelect.children("option").addClass("ui-theme theme-text profile-option"),this.$WebmailProfileSelect.children("option").first().hide()},updateSelectedProfileInUI:function(){var e=this.options.SendMailUiModel.get("selected_profile");this.$WebmailProfileSelect.val(""===e?s.SELECT_OPTION:e)}}),i.USPopupSMProfileSelector}),define("pdmplugins/unified-share/js/popupView/views/us-popup-send-mail-view",["core/ac-core","files/ac-files","pdmplugins/unified-share/js/ac-unified-share","pdmplugins/send-for-sign/js/ac-send-for-sign","pdmplugins/unified-share/js/popupView/templates/us-popup-send-mail-template","pdmplugins/unified-share/js/popupView/templates/us-popup-send-mail-template-add-signers","i18n!pdmplugins/unified-share/js/nls/ui-strings","pdmplugins/unified-share/js/utils/sc-constants","pdmplugins/unified-share/js/utils/ts-utils","core/utils/util","pdmplugins/unified-share/js/popupView/views/us-popup-sm-service-selector-view","pdmplugins/unified-share/js/popupView/views/us-popup-sm-webmail-profile-selector","pdmplugins/unified-share/js/popupView/views/us-popup-email-addr-view","pdmplugins/unified-share/js/ops/upload-and-run-sfs-op","pdmplugins/unified-share/js/models/ui/send-mail-ui-model","core/utils/sc-analytics","core/ops/op"],function(e,i,t,s,n,o,a,l,r,d){return t.UsPopupSendMailView=e.View.extend({events:{"click .sm-button":"_onContinueClick","click #sm_switch_tab_link":"_onTryNowClick","click #sm-send-again":"_onContinueClick","click #pref_launcher":"_launchPreferenceDialog","click #sm-include-link-checkbox":"_onToggleInstantLink","keypress #link-toggle-btn":"_onToggleInstantLink","click #send-email-table":"_SendEmailSelected","keypress #send-email-table":"_keypressOnSendEmail","click #send-by-mail-nv-request-signature-table":"_RequestSignatureSelected","keypress #send-by-mail-nv-request-signature-table":"_keypressOnRequestSignature","click #sm-popup-req-sig-cancel-btn":"_addSignersBackBtnClicked","click #us-popup-sm-more-options":"_onAdvancedSignOptions","click #specify-where-to-sign-btn":"_onSpecifyWhereToSignClicked","click #sm-popup-req-sig-close-button":"_closeAddSignerError","keypress #sm-popup-req-sig-close-button":"_closeAddSignerError","click #sfs-nv-generic-error-close-button":"_closeGenericError","keypress #sfs-nv-generic-error-close-button":"_closeGenericError","click #sm-popup-server-error-back-btn":"_resetSMPopup","keypress #sm-popup-server-error-back-btn":"_resetSMPopup"},_setTemplate:function(){this._template=_.template(this._sharePopup_RequestSignatures?o:n)},initialize:function(){e.View.prototype.initialize.call(this),this._nv_SelectSendEmail=!0,this._nv_DefaultSelectSendEmail=!0,this._firstRender=!0,this._sharePopup_RequestSignatures=!1,this._showOptionsInExpandedState=!1,t.QueryParams&&"SharePopup_RequestSignatures_Disclosed"===t.QueryParams.shareVariant&&(this._showOptionsInExpandedState=!0),!t.QueryParams||"SharePopup_RequestSignatures"!==t.QueryParams.shareVariant&&this._showOptionsInExpandedState!==!0||"attachToEmail"!==t.QueryParams.launchApp||"attachToEmail"!==this.options.sendFilesUiModel.get("US_tab_open")||(this._sharePopup_RequestSignatures=!0,"true"===t.QueryParams.unsignedFieldDetected&&(this._nv_DefaultSelectSendEmail=!1)),this._setTemplate(),this.options.SendMailUiModel=new t.SendMailUiModel,e.Util.isReader()&&(this.generatingLinkForInitallySignedOutReader=!1),this.signedInReaderInitially=!0},render:function(){this.$el;e.View.prototype.render.call(this);var i=this.options.appApi,s=!1;s=i.isAppUsingAV2UI(),this._setTemplate(),0===this.$el.children().length&&(this.$el.html(this._template({SM_CONTINUE:a.NEXT_BUTTON,SEND_MAIL_DESC_HEADER:a.SEND_MAIL_DESC_HEADER,SEND_LINK_AS_ATTACHMENT:a.SEND_LINK_AS_ATTACHMENT,SEND_LARGE_FILE_AS_ATTACHMENT:a.SEND_LARGE_FILE_AS_ATTACHMENT,SEND_MAIL_REVIEWERS_CMNT:a.SEND_MAIL_REVIEWERS_CMNT,TRY_NOW:a.SEND_MAIL_TRY_NOW,REMEMBER_CHOICE:a.REMEMBER_CHOICE,PREFERENCES:a.PREFERENCES,EMAIL_OPENED:a.EMAIL_OPENED,SEND_AGAIN:a.SEND_AGAIN,INCLUDE_LINK:a.INCLUDE_LINK,INCLUDE_LINK_INFO:this.options.sendFilesUiModel.get("workflowFile")?"":"#review-mode"==this.options.sendFilesUiModel.get("cl_mode")?a.INCLUDE_LINK_REVIEW_INFO:"false"==t.QueryParams.canSendForReview?a.INCLUDE_LINK_CANNOT_SEND_REVIEW_INFO:a.INCLUDE_LINK_VIEW_INFO,SIGN_IN_REQUIRED:a.SIGN_IN_REQUIRED,SEND_BY_EMAIL_NV:a.SEND_BY_EMAIL_NV,GET_SIGNATURES_NV:this._showOptionsInExpandedState?a.GET_SIGNATURES_NV_V2:a.GET_SIGNATURES_NV,NEXT_BUTTON_NV:a.NEXT_BUTTON_NV,TOOLTIP_INFO:a.REQUEST_SIGNATURES_NV,attach_link_info:this.options.sendFilesUiModel.get("workflowFile")?"":"#review-mode"==this.options.sendFilesUiModel.get("cl_mode")?a.INCLUDE_LINK_REVIEW_INFO:"false"==t.QueryParams.canSendForReview?a.INCLUDE_LINK_CANNOT_SEND_REVIEW_INFO:a.INCLUDE_LINK_VIEW_INFO,to_email_placeholder:a.ADD_SIGNERS_PLACEHOLDER,roledropdown_signer:a.SIGNER_ROLE,roledropdown_approver:a.APPROVER_ROLE,more_options:a.ADD_SIGNERS_MORE_OPTIONS,subject_placeholder:a.ADD_SIGNERS_SUBJECT_PLACEHOLDER,back:a.ADD_SIGNERS_BACK_CTA,add_signers_title:a.ADD_SIGNERS_HEADING,specify_where_to_sign:a.SPECIFY_WHERE_TO_SIGN_CTA,message_placeholder:a.ADD_SIGNERS_MESSAGE_PLACEHOLDER,request_signature_info:this._showOptionsInExpandedState?s?a.AV2_REQUEST_SIGNATURES_INFO_NV_V2:a.REQUEST_SIGNATURES_INFO_NV_V2:s?a.AV2_REQUEST_SIGNATURES_INFO_NV:a.REQUEST_SIGNATURES_INFO_NV,uploadingText:a.ADD_SIGNERS_UPLOAD_TEXT})),this._initWrappers()),this.options.appApi.rnaApi.done(_.bind(function(e){var i=e.getOpenedFile();i.invoke("determineFileSource").then(_.bind(function(e){"root"===e&&(this.$("#sm-include-link-info-text").attr("aria-label",a.INCLUDE_LINK_INFO_DC),document.getElementById("sm-include-link-info-text").innerHTML=a.INCLUDE_LINK_INFO_DC)},this))},this)),e.Util.isReader()&&1==this.generatingLinkForInitallySignedOutReader||(this._getDefaultEmailClient(),this._addUiModelEventListeners(),this._allowComments(),this._sharePopup_RequestSignatures&&(this._initWrappers_nv(),this._addEventListeners_nv()),this._renderChildViews(),this.toggleProfileSelectorVisibility(),this.toggleProceedButton(),this.fetchAllProfiles(!1),this.getLastUsedChoices(),this._addKeyEventListener(),this._setupListener(),this._initAttachLink(),this._updateToggleTheme(),this._sharePopup_RequestSignatures&&(this._selectOption_nv(this._nv_DefaultSelectSendEmail),this.$addSignersScreen.hide(),this.$(".sm-popup-server-error-parent").hide(),this.$smUpfrontScreen.show(),!t.QueryParams||"SharePopup_RequestSignatures"!==t.QueryParams.shareVariant&&"SharePopup_RequestSignatures_Disclosed"!==t.QueryParams.shareVariant||"false"!==t.QueryParams.ASEnabled||"attachToEmail"!==t.QueryParams.launchApp||"attachToEmail"!==this.options.sendFilesUiModel.get("US_tab_open")||(this.$requestSignatureTable_nv.hide(),this._nv_DefaultSelectSendEmail=!0,this._selectOption_nv(this._nv_DefaultSelectSendEmail))),this._sharePopup_RequestSignatures&&t.QueryParams&&"false"===t.QueryParams.ASEnabled&&!e.Util.isReader()&&this._updateSendMailUIWhenRequestSignatureDisabled(),this.options.sendFilesUiModel.get("workflowFile")?(this.$smIncludeLinkContainer.addClass("disabled"),this.$smIncludeLinkCheckBox.attr("disabled","disabled")):(this.$smIncludeLinkCheckBox.removeAttr("disabled"),this.$smIncludeLinkContainer.removeClass("disabled")),this._updateSendMailBackgroundForModernSharesheet())},_updateSendMailUIWhenRequestSignatureDisabled:function(){var e="row-selected-border-nv";this._removeStyleClassWithCheck(this.$sendEmailContainer_nv,e),this.$smRadioButton.remove(),this.$smUpfrontScreen.attr("style","margin-top:15px"),this.$smEmailHeader.attr("style","margin-left:0;padding-bottom:10px;font-size:16px"),this.$sendEmailContainer_nv.attr("style","cursor:default;background:transparent"),this.$sendByEmailTable.attr("style","background:transparent"),this.$smSignContainer.removeClass("theme-share-grey-container"),this.$sendEmailContainer_nv.removeClass("theme-share-grey-container"),this.$sendByEmailTable.removeClass("theme-share-grey-container")},_updateToggleTheme:function(){t.QueryParams&&"attachToEmail"===t.QueryParams.launchApp&&"LightTheme"===t.QueryParams.theme?($("#send-by-email-toggle").removeClass("darkTheme"),$("#send-by-email-toggle").addClass("lightTheme")):t.QueryParams&&"attachToEmail"===t.QueryParams.launchApp&&"DarkTheme"===t.QueryParams.theme&&($("#send-by-email-toggle").removeClass("lightTheme"),$("#send-by-email-toggle").addClass("darkTheme"))},_updateSendMailBackgroundForModernSharesheet:function(){t.QueryParams&&"attachToEmail"===t.QueryParams.launchApp&&"true"===t.QueryParams.sharesheetEnabled&&"LightTheme"===t.QueryParams.theme&&($("#unified-share-container").attr("style","background-color: #ffffff !important"),$("#us-popup-send-mail-get-sign-container").attr("style","background-color: #ffffff !important"))},teardown:function(){this.setLastUsedchoices()},_initWrappers_nv:function(){this.$sendEmailContainer_nv=this.$("#send-email-container"),this.$sendEmailRadioButton_nv=this.$("#send-email-radio-button"),this.$requestSignatureTable_nv=this.$("#send-by-mail-nv-request-signature-table"),this.$requestSignatureRadioButton_nv=this.$("#request-signature-radio-button"),this.$requestSignatureInfo=this.$("#request-signature-info"),this.$popupIncludeLinkInfo=this.$("#popup-include-link-info"),this.$infoToolTipText=this.$("#popup-tooltip-text-content"),this.$sendEmailContent=this.$("#send-email-content"),this.$sendAgainButton=this.$("#sm-send-again"),this.$sendMailTooltipContainer=this.$("#send-mail-tooltip-container"),this.$popupTooltipArrow=this.$("#popup-tooltip-arrow"),this.$smUpfrontScreen=this.$("#send-by-mail-nv-popup-heading-table-close-container"),this.$smRequestSignatureContent=this.$("#send-by-mail-nv-request-sig-info-container"),this.$addSignersScreen=this.$("#add-signers-screen-nv"),this.$emailAddressView=this.$("#popup-sm-email-address-template-container"),this.$smGenericErrorBlock=this.$(".sfs-nv-generic-error-parent"),this.$smAddSignersErrorBlock=this.$(".sm-popup-req-sig-email-error-parent"),this.$sfsNvLoaderNew=this.$(".sm-popup-req-sig-loader-container"),this.$requestSignatureText=this.$("#send-by-mail-request-signature-text"),this.$smSignContainer=this.$("#us-popup-send-mail-get-sign-container")},_commonShowToolTip:function(e,i,t){this.$infoToolTipText.text(t);{var s=i.get()[0].getBoundingClientRect(),n=5;s.left+n,s.right-s.left-2*n}},_showToolTipForRequestSignaturesInfo:function(){},_commonInfoToolTipHandler_nv:function(e,i,t){e.hover(_.bind(function(){this._commonShowToolTip(e,i,t)},this),_.bind(function(){},this))},_addEventListeners_nv:function(){this._commonInfoToolTipHandler_nv(this.$popupIncludeLinkInfo,this.$sendEmailContainer_nv,a.INCLUDE_LINK_INFO)},_removeStyleClassWithCheck:function(e,i){e.hasClass(i)&&e.removeClass(i)},_selectOption_nv:function(e){if(e!=this._nv_SelectSendEmail||this._firstRender){var i="row-unselected-border-nv",t="row-selected-border-nv",s="requrest-signature-left-width";this._firstRender&&!this._firstRender,e?(this._nv_SelectSendEmail=!0,this._removeStyleClassWithCheck(this.$sendEmailContainer_nv,i),this.$sendEmailContainer_nv.addClass(t),this._showOptionsInExpandedState||this.$sendEmailContent.show(),this._removeStyleClassWithCheck(this.$requestSignatureTable_nv,t),this.$requestSignatureTable_nv.addClass(i),this._removeStyleClassWithCheck(this.$requestSignatureText,s),this.$sendEmailRadioButton_nv.prop("checked",!0),this.$requestSignatureRadioButton_nv.prop("checked",!1),this._showOptionsInExpandedState||this.$smRequestSignatureContent.hide()):(this._nv_SelectSendEmail=!1,this._removeStyleClassWithCheck(this.$sendEmailContainer_nv,t),this.$sendEmailContainer_nv.addClass(i),this._showOptionsInExpandedState||this.$sendEmailContent.hide(),this.$requestSignatureText.addClass(s),this._removeStyleClassWithCheck(this.$requestSignatureTable_nv,i),this.$requestSignatureTable_nv.addClass(t),this.$sendEmailRadioButton_nv.prop("checked",!1),this.$requestSignatureRadioButton_nv.prop("checked",!0),this._showOptionsInExpandedState||this.$smRequestSignatureContent.show())}},_SendEmailSelected:function(){if(!this._sharePopup_RequestSignatures||!t.QueryParams||"false"!==t.QueryParams.ASEnabled){this._selectOption_nv(!0);var e=this.options.sendFilesUiModel.get("ShareVariant")+"_ATE",i="SendMail",s="Selected";this.options.appApi.siteCatalystApi.logScEvent([e,i,s])}},_RequestSignatureSelected:function(){this._selectOption_nv(!1),this.$smButton.removeClass("disabled").removeAttr("disabled");var e=this.options.sendFilesUiModel.get("ShareVariant")+"_ATE",i="RequestSignatures",t="Selected";this.options.appApi.siteCatalystApi.logScEvent([e,i,t])},_isSelectedKeypress_nv:function(e){return!e||"keypress"!=e.type||13!=e.keyCode&&32!=e.keyCode&&0!=e.keyCode?!1:!0},_keypressOnSendEmail:function(e){this._isSelectedKeypress_nv(e)&&this._SendEmailSelected()},_keypressOnRequestSignature:function(e){this._isSelectedKeypress_nv(e)&&this._RequestSignatureSelected()},_initWrappers:function(){this.$smModeSelector=this.$(".sm-mode-selector"),this.$smButton=this.$(".sm-button"),this.$smProfileSelector=this.$(".sm-profile-selector"),this.$shareTab=$("#share-tab"),this.$rememberChoice=$("#popup-remember-choice-checkbox"),this.$smMailSentDesc=this.$("#sm-mail-sent-desc"),this.$smMainContainer=this.$("#sm_no_default_state"),this.$smDefaultSetContainer=this.$("#sm-default-state"),this.$smIncludeLinkCheckBox=this.$("#sm-include-link-checkbox"),this.$smIncludeLinkContainer=this.$("#sm-include-link-options-container"),this.$smIncludeLinkInfoText=this.$("#sm-include-link-info-text"),this.$smLastUsedChoiceUpdated=!1,this.$smMailSent=!1,this.$smSignInRequiredInfoText=this.$("#sm-include-link-sign-in-info"),this.$smSignInRequiredInfoText.hide(),this.$sendByEmailTable=this.$("#send-email-table"),this.$smRadioButton=this.$("#td-send-mail-radio-button"),this.$smEmailHeader=this.$("#send-by-email-header"),this.$attachLinkInfoText=this.$("#attach-link-info-nv")},_addUiModelEventListeners:function(){var e=this.options.SendMailUiModel;e.on("change:send_mail_mode",this._onSendMailModeChange),e.on("change:selected_profile",this._onProfileSelected),this.options.sendFilesUiModel.on("change:US_tab_open",this._onUsTabChanged),e.on("change:cl_show_context_board",this._showContextBoard),this.options.canSignUiModel.on("change:can_sign_state",this._onCanSignStateChanged)},_allowComments:function(){var e=this.options.sendFilesUiModel;"#review-mode"==e.get("cl_mode")?e.set("allow_comments",!0):e.set("allow_comments",!1)},_setupListener:function(){this.options.instantLinkRetrievedPromise=$.Deferred(),this.options.appApi.rnaApi.done(_.bind(function(e){e.rnaUnifiedSharePopupAPI.initListener().done(_.bind(function(i){i._addEventListener("custom:PollParcel",_.bind(function(e,i){if(i.params){this.options.parcelCreationPromise=$.Deferred();var s=_.extend({parcel_id:i.params,pollCount:1,MAX_POLL_COUNT:50},this.options),n=new t.ShareFilesOp(s);n._pollParcelStandalone(),this.options.parcelCreationPromise.then(_.bind(function(){this._onPollingComplete(i.params,!0)},this),_.bind(function(){var e=i.params;this._onPollingComplete(e,!1)},this))}},this),null,null),i._addEventListener("custom:RegenerateLink",_.bind(function(){this.hideErrorBubble()},this),null,null),i._addEventListener("custom:setWorkflowFileLink",_.bind(function(e,i){var t=this.options.sendFilesUiModel;if(t.get("workflowFile")){var s=i.params;s&&""!=s&&(t.set("instant_link",s),this._instantLinkMapped=!0,t.set("cl_active_view","complete"),this.options.instantLinkRetrievedPromise.resolve())}else this.options.instantLinkRetrievedPromise.reject()},this),null,null),i._addEventListener("custom:PopupOpenEvent",_.bind(function(){e.stApi.getLastUsedPreferences().then(_.bind(function(e){e&&e.defaultSet&&(this._sendMailDefault(),this._hidePopup())},this))},this),null,null)},this),this)},this))},_onPollingComplete:function(e,i){this.options.appApi.rnaApi.done(_.bind(function(t){t.rnaUnifiedSharePopupAPI.onPollingComplete(e,i)},this))},_onUsTabChanged:function(){"attachToEmail"===this.options.sendFilesUiModel.get("US_tab_open")&&this.$smLastUsedChoiceUpdated&&this.options.SendMailUiModel.get("default_mail_set")===!0&&0==this.$smMailSent&&this._sendMailDefault()},_renderChildViews:function(){this._renderChildView("_smModeSelector",t.USPopupSMServiceSelectorView,this.$smModeSelector),this._renderChildView("_smProfileSelector",t.USPopupSMProfileSelector,this.$smProfileSelector),this._sharePopup_RequestSignatures&&"attachToEmail"===this.options.sendFilesUiModel.get("US_tab_open")&&(this._renderChildView("_emailAddressView",t.UsPopupEmailAddrView,this.$emailAddressView),this.$sendAgainButton.hide()),this.$smDefaultSetContainer.hide()},_getDefaultEmailClient:function(){this.options.appApi.rnaApi.then(_.bind(function(e){e.stApi.getDefaultEmailClient().then(_.bind(function(e){this.options.SendMailUiModel.set("default_email_client",this._getEmailClientName(e)),this._setEmailClientName(),this._smModeSelector&&this._smModeSelector.render()},this),_.bind(function(){return $.Deferred().reject().promise()},this))},this),_.bind(function(){return $.Deferred().reject().promise()},this))},_onSendMailModeChange:function(){this.toggleProfileSelectorVisibility(),this.toggleProceedButton()},_onProfileSelected:function(){this.toggleProceedButton();var e=this.options.SendMailUiModel,i=e.get("selected_profile");i===a.ADD_OTHER?(console.log("configure email"),this._configureProfile(l.BASICMAIL)):i===a.ADD_GMAIL&&(console.log("configure GMAIL"),this._configureProfile(l.GMAIL))},toggleProfileSelectorVisibility:function(){var e=this.options.SendMailUiModel,i=e.get("send_mail_mode");"sm_webmail"===i?this.$smProfileSelector.show():this.$smProfileSelector.hide()},toggleProceedButton:function(){var e=this.options.SendMailUiModel,i=e.get("send_mail_mode"),t=e.get("selected_profile");"sm_default_mail"===i||"sm_outlook"===i||t!==a.SELECT_OPTION&&""!==t&&t!==a.ADD_OTHER&&t!==a.ADD_GMAIL&&t!==a.ADD_YAHOO?this.$smButton.removeClass("disabled").removeAttr("disabled"):this.$smButton.addClass("disabled").attr("disabled","disabled")},_onTryNowClick:function(e){this.$shareTab.click(),e&&this.$shareTab.focus()},_onRemeberChoiceClick:function(){var e=this.options.sendFilesUiModel.get("ShareVariant"),i=l.USE,t="Send Mail Remember Choice Clicked";this.options.appApi.siteCatalystApi.logScEvent([e,i,t])},_addSignersBackBtnClicked:function(){this.$smUpfrontScreen.show(),this.$(".send-mail-popup-button-bar-nv").show(),this.$(".us-share-popup-subject-input").hide(),this.$addSignersScreen.hide()},_showAddSignersScreen:function(e){e?(this.$smUpfrontScreen.hide(),this.$(".sm-popup-server-error-parent").hide(),this.$(".send-mail-popup-button-bar-nv").hide(),this.$(".us-share-popup-subject-input").show(),this.$("#sm-add-signers-container").show(),this.$addSignersScreen.show(),this._emailAddressView._focusOnEmailTextarea()):(this.$smUpfrontScreen.hide(),this.$(".sm-popup-server-error-parent").hide(),this.$(".send-mail-popup-button-bar-nv").hide(),this.$(".us-share-popup-subject-input").hide(),this.$addSignersScreen.hide())},_onAdvancedSignOptions:function(){this._onShareNextClick("DRAFT")},_onSpecifyWhereToSignClicked:function(){this._onShareNextClick("AUTHORING")},_showUploadSpinner:function(){_.delay(_.bind(function(){this.$("#sm-add-signers-container").hide(),this.$(".sm-popup-server-error-parent").hide(),this.$("#sm-popup-server-error-back-btn").hide(),this.$sfsNvLoaderNew.removeClass("hidden"),this.options.appApi.displayApi.showSpinner(!0)},this),250)},_hideUploadSpinner:function(){this.$sfsNvLoaderNew.addClass("hidden"),this.options.appApi.displayApi.showSpinner(!1)},_onShareNextClick:function(e){var i=this.options.sendFilesUiModel.get("ShareVariant"),s="SpecifyWhereToSign",n=l.CLICKED;if(this.options.appApi.siteCatalystApi.logScEvent([i,s,n]),!this.options.appApi.networkConnectivityApi.isOnline())return void this._showErrorRedLine(a.ADD_SIGNERS_ERR_OFFLINE,!1,!0);if(this.options.appApi.sessionApi.isSignedIn()){if(this.options.sendFilesUiModel.isEmailBoxEmpty()&&"DRAFT"!==e)return void this._showErrorRedLine(a.ADD_SIGNERS_NO_EMAIL_ERROR,!0,!0);var o=new t.UploadAndRunSFSOp(this.options),r=this.options.appApi.usersMeApi.getUserIdentity().email;_.isUndefined(r)||(this.options.sendFilesUiModel.isSenderOnlyRecipient(r)&&"DRAFT"!==e?this._showErrorRedLine(a.ERROR_SINGLE_SIGNER_IS_SENDER,!0,!0):this.options.appApi.rnaApi.done(_.bind(function(i){i.esApi.isAnySFSWorkflowsRunning().then(_.bind(function(i){i?this._showErrorRedLine(a.SFS_MULTIPLE_WORKFLOWS_DENIED,!1,!0):(this._setSFSWorkflowInProgress(),this._showUploadSpinner(),o.run().then(_.bind(function(){console.log("upload Success"),this._clearSFSWorkflowInProgress(),this._launchSFSWithData(e)},this),_.bind(function(e){console.log("upload failed"+e),this._clearSFSWorkflowInProgress(),this._onCanSignUploadError(e)},this)))},this))},this)))}},_getSubjectText:function(){var e=this._emailAddressView._getSubjectText();return e=e.replace(/[\\]/gm,"\\\\").replace(/[\"]/gm,'\\"').replace(/(\r\n|\n|\r)/gm,"\\n")},_getMessageText:function(){var e=this._emailAddressView._getMessageText();return e=e.replace(/[\\]/gm,"\\\\").replace(/[\"]/gm,'\\"').replace(/(\r\n|\n|\r)/gm,"\\n")},_resetSendMailPopupView:function(){this.options.appApi.rnaApiObj.esApi.invokeMethod({methodName:"ResetSendMailPopupView"})},_launchSFSWithData:function(e){return console.log("launching SFS app .... "),this.options.appApi.rnaApi.then(_.bind(function(i){var t=this.options.sendFilesUiModel.getRecipientsArray(),s=[{transientDocIds:this.options.canSignUiModel.get("transient_Doc_Ids"),esAccessToken:"Bearer "+this.options.esAuthUiModel.get("access_token"),emailSubject:this._getSubjectText(!0),emailMessage:this._getMessageText(),recipients:t,agreementStatus:e,agreementName:this.options.sendFilesUiModel.get("us_subject_text")}];return i.stApi.launchSendForSignWithTransientDocIdsAPI(s).then(_.bind(function(){return this._resetSendMailPopupView(),$.Deferred().resolve().promise()},this),_.bind(function(){return $.Deferred().reject().promise()},this))},this),_.bind(function(){return $.Deferred().reject().promise()},this))},_showLoader:function(){this.$(".us-share-popup-subject-input").hide(),this.options.appApi.displayApi.showSpinner(!0)},_resetSMPopup:function(){this._hideUploadSpinner(),this._addSignersBackBtnClicked()},_onCanSignStateChanged:function(){var e=this.options.canSignUiModel.get("can_sign_state");switch(console.log("state changed to : "+e),e){case"authorising":break;case"authorised":{this.options.esAuthUiModel.get("access_token")}console.log("Authorised , authToken generated");break;case"uploading":this.options.sendFilesUiModel.setShareState("Sharing");break;case"uploaded":console.log("uploaded : all files uploaded to echo sign server ");break;case"failed":console.log("uploading or authorising failed"),this.options.appApi.displayApi.clearSpinnerRefs(),this._showErrorFullScreen(a.SHARE_UPLOAD_ERROR_TITLE,a.SHARE_SIGN_UPLOAD_ERROR_MSG)}},_onCanSignUploadError:function(){this._onShareError()},_setSFSWorkflowInProgress:function(){this.options.appApi.rnaApi.done(_.bind(function(e){e.esApi.setSFSWorkflowInProgress(!0)},this))},_clearSFSWorkflowInProgress:function(){this.options.appApi.rnaApi.done(_.bind(function(e){e.esApi.setSFSWorkflowInProgress(!1)},this))},_onContinueClick:function(){if(this.options.appApi.rnaApi.done(function(e){e.logPerformance("SendMail","start"),e.logPerformance("ShareAFile","start")}),this.options.sendFilesUiModel.get("workflowFile")||this.options.appApi.siteCatalystApi.logEvent("CSE","Send_by_Mail","Send_by_Mail_Invoked"),!this._nv_SelectSendEmail){this._showOptionsInExpandedState?(this._hidePopup(),this.options.appApi.rnaApiObj.esApi.invokeMethod({methodName:"openRequestSignaturesApp"})):this._showAddSignersScreen(!0);var e=this.options.sendFilesUiModel.get("ShareVariant"),i=this._nv_SelectSendEmail?"NextButton_WithSendMail":"NextButton_WithRequestSignatures",t=l.CLICKED;return void this.options.appApi.siteCatalystApi.logScEvent([e,i,t])}this._onGenerateLink();var s=this.options.SendMailUiModel,n=s.get("send_mail_mode"),o=s.get("selected_profile"),a=s.get("email_addresses")[o];this._hidePopup();var e=this.options.sendFilesUiModel.get("ShareVariant"),i=l.BUTTON_NEXT,t=this.options.sendFilesUiModel.get("workflowFile")?"Shared_"+l.CLICKED:l.CLICKED;this.options.appApi.siteCatalystApi.logScEvent([e,i,t]),this._sendMailFinal(n,o,a)},_showContextBoard:function(){var e=this.options.sendFilesUiModel.get("cl_mode");this.$smIncludeLinkCheckBox.is(":checked")&&("#review-mode"==e?this._openDummyReview():this._openDummyView())},_sendMailFinal:function(e,i,t){var s=this.options.sendFilesUiModel.get("ShareVariant"),n=l.USE,o=this.options.sendFilesUiModel.get("workflowFile")?"Shared_":"";if("sm_default_mail"===e)o+=l.DEFAULT_EMAIL_APPLICATION,this._sendMail(!1,"none",0);else if("sm_outlook"===e)o+=l.MS_OUTLOOK,this._sendMail(!1,"none",4);else{if(i===a.SELECT_OPTION||""===i||i===a.ADD_OTHER||i===a.ADD_GMAIL||i===a.ADD_YAHOO)return;o+=l.WEBMAIL_APPLICATION,this._sendMail(!0,t,0)}this.options.appApi.siteCatalystApi.logScEvent([s,n,o])},_handleInstantLinkRetrievedPromise:function(e,i,t){this.options.instantLinkRetrievedPromise&&this.options.instantLinkRetrievedPromise.then(_.bind(function(){var s=this.options.sendFilesUiModel,n=this.options.SendMailUiModel,o=this.options.appApi.usersMeApi.getUserIdentity().display_name,r="\r\n",p=_.template(a.ATTACH_LINK_SUBJECT_MSG,{FILENAME:s.get("filename")});if(s.get("instant_link")){var h=s.get("instant_link"),c=r;c+=_.template("#review-mode"===s.get("cl_mode")?a.ATTACH_LINK_REVIEW_FILE_MSG:a.ATTACH_LINK_VIEW_FILE_MSG,{DISPLAYNAME:o,FILENAME:s.get("filename")}),c+=r+h+r,d.isMac()&&("sm_outlook"===n.get("send_mail_mode")||"sm_default_mail"===n.get("send_mail_mode")&&n.get("default_email_client")===a.EMAIL_CLIENT_OUTLOOK)||(c+=r+"________________"+r+a.ATTACH_LINK_INFO_MSG);var u={useWebmail:e,profile:i,message:c,instantLink:!0,subject:p};t&&(u.emailClient=t),this._instantLinkMapped||(this._instantLinkMapped=!0,this._mapInstantLink()),this._setSendMailAttachLinkURL(h),this._callsendMailWithoutFLD(u);var m=this.options.sendFilesUiModel.get("ShareVariant"),E=l.SUCCESS,g=this.options.sendFilesUiModel.get("workflowFile")?"Shared_"+l.SEND_MAIL_LINK:l.SEND_MAIL_LINK;this.options.appApi.siteCatalystApi.logScEvent([m,E,g])}},this),_.bind(function(){var s={useWebmail:e,profile:i};t&&(s.emailClient=t),this._callsendMailWithoutFLD(s);var n=this.options.sendFilesUiModel.get("ShareVariant"),o=l.SUCCESS,a=this.options.sendFilesUiModel.get("workflowFile")?"Shared_"+l.SEND_MAIL_FILE:l.SEND_MAIL_FILE;this.options.appApi.siteCatalystApi.logScEvent([n,o,a])},this))},_sendMail:function(i,t,s){if(this.$smMailSent=!0,this.options.sendFilesUiModel.isMultipleFilesSelected()||"contentPlusRHP"===this.options.sendFilesUiModel.get("layout")){var n=[],o={},a=this.options.sendFilesUiModel.get("local_file_objects"),r=this.options.sendFilesUiModel.get("metadata_collection"),d=this.options.sendFilesUiModel.get("connector_file_objects"),p=d.length+r.length;_.each(a,_.bind(function(e){e.get("assetId")?(n.push(e.get("assetId")),++p):n.push(e._proxy)},this)),_.each(r.models,_.bind(function(e){n.push(e.get("id"))},this)),o.selectedFileIds=n,o.useWebmailObj=i,o.profileObj=t,o.filesToDownloadLengthObj=p,s&&(o.emailClient=s),this.options.appApi.rnaApi.then(_.bind(function(e){e.stApi.attachToEmail(o).then(_.bind(function(){this.setLastUsedchoices(),this.switchUI()},this),_.bind(function(){return $.Deferred().reject().promise()},this))},this),_.bind(function(){return $.Deferred().reject().promise()},this))}else if(this.$smIncludeLinkCheckBox.is(":checked")&&this.options.instantLinkRetrievedPromise)e.Util.isReader()?this.options.appApi.rnaApi.done(_.bind(function(e){e.rnaUnifiedSharePopupAPI.isUserSignedIn().done(_.bind(function(e){return 0==e?void this._checkRestrictionsAndUpload({handleInstantLinkPromise:!0,useWebMail:i,Profile:t,emailClient:s}):void this._handleInstantLinkRetrievedPromise(i,t,s)
},this))},this)):this._handleInstantLinkRetrievedPromise(i,t,s);else{var o={useWebmail:i,profile:t};s&&(o.emailClient=s),this._setSendMailAttachFileName(),this._callsendMailWithoutFLD(o);var h=this.options.sendFilesUiModel.get("ShareVariant"),c=l.SUCCESS,u=this.options.sendFilesUiModel.get("workflowFile")?"Shared_"+l.SEND_MAIL_FILE:l.SEND_MAIL_FILE;this.options.appApi.siteCatalystApi.logScEvent([h,c,u])}},_callsendMailWithoutFLD:function(e){this.options.appApi.rnaApi.then(_.bind(function(i){i.isFeatRunning()||i.stApi.sendMailWithoutFLD(e).then(_.bind(function(){this.setLastUsedchoices(),this.switchUI()},this),_.bind(function(){return $.Deferred().reject().promise()},this))},this),_.bind(function(){return $.Deferred().reject().promise()},this))},_checkMaximumFiles:function(){var e=this.options.sendFilesUiModel,i=e.get("US_tab_open");if("attachToEmail"===i){if(e.get("allow_comments")&&e.isMultipleFilesSelected()){var t=(this.options.appApi.dialogApi,a.SHARE_TOO_MANY_FILES_DLG_TITLE),s=a.ERROR_MULTIPLE_FILES_REVIEW1+". "+a.ERROR_MULTIPLE_FILES_REVIEW2;this.$PopupCLAllowCommentsCheckBox.prop("checked",!1),e.setCLMode("#send-mode"),e.set("allow_comments",!1);var n=this.options.sendFilesUiModel.get("ShareVariant"),o=l.ERROR,r="Multiple files selected for review";return this.options.appApi.siteCatalystApi.logScEvent([n,o,r]),this.showErrorBubble(l.FILE_LIST_ERROR,t,s),!1}var d,e=this.options.sendFilesUiModel,p=e.get("limits_model"),h=e.get("cl_mode"),c=e.get("local_file_objects").length+e.get("metadata_collection").length;if(d=_.isUndefined(p)?50:p.get("#send-mode"===h?"max_files":"max_review_files"),c>d){var u=(this.options.appApi.dialogApi,a.SHARE_TOO_MANY_FILES_DLG_TITLE),m=_.template(a.SHARE_TOO_MANY_FILES_DLG_MSG,{maxNumber:d});return this.showErrorBubble(l.FILE_LIST_ERROR,u,m,!0),!1}}return!0},_createInstantLink:function(i){var s,n,o=this.options.sendFilesUiModel.get("share_collection"),r=this.options.sendFilesUiModel.get("metadata_collection");o.reset(),r.each(_.bind(function(e){var i=new t.FileMetadataModel;i.set(_.clone(e.attributes)),o.add(i)},this)),n=_.extend({shareFiles:o},this.options),s=new t.CreateInstantLinkOp(n),s.run().then(_.bind(function(i){var t=this.options.sendFilesUiModel;this._instantLinkMapped=!1,t.set("instant_link",i.public_link),t.set("instant_link_token",i.public_link_token),t.set("instant_link_expiry",i.expiry_time),this.options.appApi.rnaApi.done(_.bind(function(e){e.rnaUnifiedSharePopupAPI.storeInstantLinkInfo(t.get("instant_link"),t.get("instant_link_token"),t.get("instant_link_expiry"),t.get("cl_mode"),i.asset_id)},this)),e.Util.isReader()&&1==this.generatingLinkForInitallySignedOutReader&&(this.generatingLinkForInitallySignedOutReader=!1),this.options.instantLinkRetrievedPromise.resolve();var s=this.options.sendFilesUiModel.get("ShareVariant"),n=l.SUCCESS,o=l.INSTANT_LINK,a=l.SEND_MAIL_MODE;this.options.appApi.siteCatalystApi.logScEvent([s,n,o,a]),this.options.SendMailUiModel.set("cl_show_context_board","true")},this),_.bind(function(e){var t="";if(void 0!=e.responseText&&(t=JSON.parse(e.responseText).error.code),"SharingRestrictions"===t){var s=_.template('<div class = "learn-more-sharing"><%=LEARN_MORE%></div>')({LEARN_MORE:a.LEARN_MORE}),n=a.FILE_CANT_BE_SENT,o=a.SHARE_ERROR_ENTERPRISE_SEND_DLG_MSG+s,r=this.options.sendFilesUiModel.get("ShareVariant"),d=l.USE,p="Sharing Restriction Error Prompt Shown";this.options.appApi.siteCatalystApi.logScEvent([r,d,p]),this.showErrorBubble(l.CREATE_LINK_ERROR,n,o,!0),$(".learn-more-sharing").click(this._onSharingLearnMore)}else this.showErrorBubble(l.CREATE_LINK_ERROR,a.SHARE_CL_ERROR_DLG_TITLE,a.SEND_MAIL_PUBLIC_LINK_ERROR);this._resetAfterError(i);var r=this.options.sendFilesUiModel.get("ShareVariant"),d=l.ERROR,p=l.INSTANT_LINK;this.options.appApi.siteCatalystApi.logScEvent([r,d,p]),this.options.instantLinkRetrievedPromise.reject()},this))},_onGenerateLink:function(e){var i=this.options.sendFilesUiModel;if(0==this.$smIncludeLinkCheckBox.is(":checked")?this.$smIncludeLinkCheckBox.attr("aria-label","Attach a Link Toggle off"):this.$smIncludeLinkCheckBox.attr("aria-label","Attach a Link Toggle on"),!(0==this.$smIncludeLinkCheckBox.is(":checked")||!0!==e&&this.options.sendFilesUiModel.isValidInstantLinkPresent())){if(i.get("workflowFile"))return void this.options.appApi.rnaApi.done(_.bind(function(e){e.rnaUnifiedSharePopupAPI.getWorkflowFileLink()},this));this.options.instantLinkRetrievedPromise=$.Deferred(),t.FetchDesktopSubscriptionsPromise=$.Deferred(),this.$smIncludeLinkCheckBox.attr("aria-label","Attach a Link Toggle on"),console.log("Generating link...."),i.isAVSharingPermitted()?"onlyRHP"===this.options.sendFilesUiModel.get("layout")&&this.options.sendFilesUiModel.get("checkForSave")?this.options.appApi.rnaApi.done(_.bind(function(e){e.rnaServicesAPI.checkOpenedDocAndPromptForSaveApi().then(_.bind(function(){this._onShareClick()},this))},this)):this._onShareClick():i.setShareState("avNotAllowed")}},_getBackupOptions:function(){var e=this.options.sendFilesUiModel,i=e.get("metadata_collection"),t=e.get("local_file_objects"),s=_.extend({},{filesModelBackup:i.clone(),localFilesBackup:t});return s},_checkRestrictionsAndPerformAction:function(e){var i=this._getBackupOptions();if(e){var t=_.template('<div class = "learn-more-sharing"><%=LEARN_MORE%></div>')({LEARN_MORE:a.LEARN_MORE}),s=a.FILE_CANT_BE_SENT,n=a.SHARE_ERROR_ENTERPRISE_SEND_DLG_MSG+t,o=this.options.sendFilesUiModel.get("ShareVariant"),r=l.USE,d="Sharing Restriction Error Prompt Shown";this.options.appApi.siteCatalystApi.logScEvent([o,r,d]),this.showErrorBubble(l.CREATE_LINK_ERROR,s,n,!0),$(".learn-more-sharing").click(this._onSharingLearnMore),this._resetAfterError(i)}else this._createInstantLink(i)},_wrapperForcheckRestrictions:function(){var e=this.options.appApi.rnaApi;e.done(_.bind(function(e){this._checkRestrictionsAndPerformAction(e.isFeatRunning()?!1:!1)},this))},_checkRestrictionsAndUpload:function(i){this.options.appApi.sessionApi.ensureSignedIn().then(_.bind(function(){this.options=_.extend({},this.options,this._postSignInFunction()),this.options.readRegistry=!1;var s=!0;e.Util.isReader()&&0==this.signedInReaderInitially&&(s=!1);var n=_.bind(function(){if(this._wrapperForcheckRestrictions(),i&&i.handleInstantLinkPromise){var e=this.options.sendFilesUiModel.get("ShareVariant"),t="SignedInViaSignInDialog";this.options.appApi.siteCatalystApi.logScEvent([e,l.SEND_MAIL_MODE,t]),this._handleInstantLinkRetrievedPromise(i.useWebMail,i.Profile,i.emailClient)}},this);t.FetchDesktopSubscriptionsPromise.then(_.bind(function(){var i=!0;e.Util.isReader()&&!this.signedInReaderInitially&&t.subscriptionFetched&&(i=!1),this._resetACUnifiedShareValues(),i?t.opFactory.create("DesktopGettingSubscriptionLevels",this.options).run().then(_.bind(function(){n()},this),_.bind(function(e){var i=this._getBackupOptions();423==e.status?this.options.appApi.rnaApi.done(_.bind(function(e){e.invokeMethod({methodName:"triggerMigrationInProgressError",methodArgs:{}})},this)):this._onShareError(i,l.UNKNOWN_SERVICE_ERROR),this._resetAfterError(i)},this)):n()},this),_.bind(function(){this._resetACUnifiedShareValues(),this._onShareError(backupOptions,l.NO_CONNECTIVITY),this._resetAfterError(backupOptions)},this)),1==s?t.FetchDesktopSubscriptionsPromise.resolve():0==t.subscriptionFetchTriggered&&t.FetchDesktopSubscriptionsPromise.resolve()},this),_.bind(function(e){e&&"NoAccessToPdfServices"===e.errorString&&this._displayNoAccessToUser(e.errorCode)},this))},_onShareClick:function(){var i,t,s,n,o,a,r,d,p,h=[],c=[];if(this._checkMaximumFiles())return s=this.options.sendFilesUiModel,n=s.get("metadata_collection"),r=s.get("local_file_objects"),o="createLink"===s.get("US_tab_open"),a="share"===s.get("US_tab_open"),d=s.get("customize_recipient_page"),p=s.get("allow_comments"),i={uiModel:s,files:n,localFiles:r,recipients:h,is_public:o,is_individual:a,can_make_comments:p,displayApi:this.options.appApi.displayApi,appApi:this.options.appApi,rootView:this.options.rootView,is_branding:d,sendFilesUiModel:this.options.sendFilesUiModel,assetIdarray:c,recipientsAreFinalized:!0,is_review:p},t=this._getBackupOptions(),this.options=_.extend({},this.options,i),this.options.appApi.networkConnectivityApi.isOnline()?void(e.Util.isReader()?this.options.appApi.rnaApi.done(_.bind(function(e){e.rnaUnifiedSharePopupAPI.isUserSignedIn().done(_.bind(function(e){var i=this.options.sendFilesUiModel.get("ShareVariant"),t=e?"Signed In":"Signed out";return this.options.appApi.siteCatalystApi.logScEvent([i,l.SEND_MAIL_MODE,t]),0==e?(this.signedInReaderInitially=!1,void(this.$smIncludeLinkCheckBox.is(":checked")?(this.$smSignInRequiredInfoText.show(),this.generatingLinkForInitallySignedOutReader=!0):(this.$smSignInRequiredInfoText.hide(),this.generatingLinkForInitallySignedOutReader=!1))):(this.$smSignInRequiredInfoText.hide(),this.signedInReaderInitially=!0,this.generatingLinkForInitallySignedOutReader=!1,this._checkRestrictionsAndUpload(),void 0)},this))},this)):(this.$smSignInRequiredInfoText.hide(),this._checkRestrictionsAndUpload())):(this._onShareError(t,l.NO_CONNECTIVITY),void this._resetAfterError(t))},_onToggleInstantLink:function(){this.$smIncludeLinkCheckBox.blur();var i=this.options.sendFilesUiModel.get("ShareVariant"),t=l.SEND_MAIL_MODE,s=this.options.sendFilesUiModel.get("workflowFile")?"Shared_"+l.INSTANT_LINK_TOGGLED:l.INSTANT_LINK_TOGGLED,n=this.$smIncludeLinkCheckBox.is(":checked")?"On":"Off";this.options.appApi.siteCatalystApi.logScEvent([i,t,s,n]),this.$smIncludeLinkCheckBox.is(":checked")?(this.$smIncludeLinkInfoText.show(),this.$attachLinkInfoText.show(),this._updateToggleTheme(),e.Util.isReader()&&(this.options.appApi.sessionApi.isSignedInReader()||this.$smSignInRequiredInfoText.show())):(this._updateToggleTheme(),this.$smIncludeLinkInfoText.hide(),this.$attachLinkInfoText.hide(),this.$smSignInRequiredInfoText.hide())},_postSignInFunction:function(){var e,i,t=this.options,i=this.options.appApi.baseFilesUrisApi.getAlternateUploadUri();return this.options.appApi.siteCatalystApi.logScEvent([l.TOOLS,this.options.sendFilesUiModel.get("ShareVariant"),l.SHARE_BUTTON,"async"]),e=this.options.appApi.baseFilesUrisApi.getSendApiUri(),e=r.extractRootUrl(e),t={rootUrl:e,uploadUrl:i}},switchUI:function(){this.options.SendMailUiModel.get("default_mail_set")===!0&&(this.$smMainContainer.hide(),this.$smDefaultSetContainer.show(),this._sharePopup_RequestSignatures&&"attachToEmail"===this.options.sendFilesUiModel.get("US_tab_open")&&this.$sendAgainButton.show())},fetchAllProfiles:function(e){this.options.appApi.rnaApi.then(_.bind(function(i){i.stApi.getAllWebmailProfiles().then(_.bind(function(i){e&&this._updateSelectedProfile(i,!0),this._updateProfilesInUiModel(i),this._smProfileSelector.updateSelectedProfileInUI()},this),_.bind(function(){return $.Deferred().reject().promise()},this))},this),_.bind(function(){return $.Deferred().reject().promise()},this))},_configureProfile:function(e){this._disablePopupAutoHide(),this.options.appApi.rnaApi.then(_.bind(function(i){i.stApi.configureProfile(e).then(_.bind(function(){this.fetchAllProfiles(!0),this._enablePopupAutoHide()},this),_.bind(function(e){return this._updateSelectedProfile(e,!1),this._smProfileSelector.updateSelectedProfileInUI(),this._enablePopupAutoHide(),$.Deferred().reject().promise()},this))},this),_.bind(function(){return $.Deferred().reject().promise()},this))},_updateProfilesInUiModel:function(e){for(var i={},t=Object.getOwnPropertyNames(e),s=0;s<t.length;s++){var n=e[t[s]],o=n.EmailAddress;i[o]=t[s]}Object.keys(i).length>0&&this.options.SendMailUiModel.set("email_addresses",i)},_updateSelectedProfile:function(e,i){var t,s=Object.getOwnPropertyNames(e),n=this.options.SendMailUiModel.get("email_addresses");if(i)for(var o=0;o<s.length;o++){var a=e[s[o]],l=a.EmailAddress;if(!n[l]){t=l,this.options.SendMailUiModel.set("selected_profile",t);break}}else this.options.SendMailUiModel.set("selected_profile","")},_getEmailClientName:function(e){switch(e){case 0:return a.EMAIL_CLIENT_OTHER;case 1:return a.EMAIL_CLIENT_EUDORA;case 2:return a.EMAIL_CLIENT_LOTUS_NOTES;case 3:return a.EMAIL_CLIENT_NETSCAPE;case 4:return a.EMAIL_CLIENT_OUTLOOK;case 5:return a.EMAIL_CLIENT_OUTLOOK_EXPRESS;case 6:return a.EMAIL_CLIENT_ENTOURAGE;case 7:return a.EMAIL_CLIENT_MAIL;case 8:return a.UNKNOWN;default:return a.UNKNOWN}},setLastUsedchoices:function(){var e=this.options.SendMailUiModel,i=e.get("selected_profile"),t=!0,s="sm_webmail"===e.get("send_mail_mode"),n=e.get("default_mail_set"),o="sm_outlook"===e.get("send_mail_mode")?4:0;(""!==i||i!==a.SELECT_OPTION)&&(i=e.get("email_addresses")[i]),void 0===i&&(i=""),this.options.appApi.rnaApi.then(_.bind(function(e){e.stApi.setLastUsedPreferences([t,s,i,n,o])},this))},getLastUsedChoices:function(){this.options.appApi.rnaApi.then(_.bind(function(e){e.stApi.getLastUsedPreferences().then(_.bind(function(e){this.updateLastUsedChoices(e),this._smModeSelector._selectModeFromServiceSelected(),this._smProfileSelector.updateSelectedProfileInUI()},this),_.bind(function(){return $.Deferred().reject().promise()},this))},this),_.bind(function(){return $.Deferred().reject().promise()},this))},updateLastUsedChoices:function(e){this.$smLastUsedChoiceUpdated=!0;var i,t,s,n,o,a,l=this.options.SendMailUiModel;e&&(i=e.didLastUsedWebmail,n=e.defaultSet,t=e.useWebmail,o=e.webmailDisabled,a=e.lastUsedEmailClient,l.set("default_mail_set",n),o&&(l.set("send_mail_mode","sm_default_mail"),this._hideOrDisableWebmailUI(),t=!1),t?(l.set("send_mail_mode","sm_webmail"),s=this._convertEncodedToSimpleProfile(e.selectedProfile),l.set("selected_profile",s)):4===a?l.set("send_mail_mode","sm_outlook"):l.set("send_mail_mode","sm_default_mail"),n?(this._onGenerateLink(),this._sendMailDefault(),this._hidePopup()):(this.$smDefaultSetContainer.hide(),this._sharePopup_RequestSignatures&&"attachToEmail"===this.options.sendFilesUiModel.get("US_tab_open")&&this.$sendAgainButton.hide(),this.$smMainContainer.show()))},_getEmailForSelectedProfile:function(e){var i=this.options.SendMailUiModel.get("email_addresses");for(var t in i)if(t===e)return i[t];return""},_sendMailDefault:function(){var e=this.options.SendMailUiModel,i=e.get("send_mail_mode"),t=e.get("selected_profile"),s=this._getEmailForSelectedProfile(t);this._sendMailFinal(i,t,s)},_hideOrDisableWebmailUI:function(){this._smModeSelector._hideDisableWebmailUI()},_convertEncodedToSimpleProfile:function(e){for(var i=this.options.SendMailUiModel,t=i.get("email_addresses"),s=Object.getOwnPropertyNames(t),n=0;n<s.length;n++)if(t[s[n]]===e)return s[n];return""},_onShareErrorNewVariant:function(e,i){if(i===l.NO_CONNECTIVITY)this._showErrorRedLine(a.SHARE_NO_INTERNET_CONNECTION_MSG,!1,!1);else if(i===l.UNKNOWN_SERVICE_ERROR)this._showErrorRedLine(a.COULD_NOT_COMPLETE_REQUEST_MSG,!1,!1);else if(i===l.REVIEW_NOT_PERMITTED){var t=this.options.sendFilesUiModel.get("ShareVariant"),s=l.USE,n="Review not supported";this.options.appApi.siteCatalystApi.logScEvent([t,s,n]),this._showErrorRedLine(a.SHARE_REVIEW_RESTRICTED_MSG,!1,!1).done(_.bind(function(){this.options.sendFilesUiModel.setCLMode("#send-mode"),this.options.sendFilesUiModel.set("allow_comments",!1,!1)},this))}else i===l.ERROR_UPLOAD&&this._showErrorRedLine(a.SHARE_UPLOAD_ERROR_MSG,!1,!1)},_onShareError:function(e,i){if(this._sharePopup_RequestSignatures&&"attachToEmail"===this.options.sendFilesUiModel.get("US_tab_open"))return void this._onShareErrorNewVariant(e,i);if(i===l.NO_CONNECTIVITY)this.showErrorBubble(l.CREATE_LINK_ERROR,a.SHARE_NO_INTERNET_CONNECTION,a.SHARE_NO_INTERNET_CONNECTION_MSG);else if(i===l.UNKNOWN_SERVICE_ERROR)this.showErrorBubble(l.CREATE_LINK_ERROR,a.COULD_NOT_COMPLETE_REQUEST,a.COULD_NOT_COMPLETE_REQUEST_MSG);else if(i===l.REVIEW_NOT_PERMITTED){var t=this.options.sendFilesUiModel.get("ShareVariant"),s=l.USE,n="Review not supported";this.options.appApi.siteCatalystApi.logScEvent([t,s,n]),this.showErrorBubble(l.CREATE_LINK_ERROR,a.SHARE_REVIEW_RESTRICTED,a.SHARE_REVIEW_RESTRICTED_MSG).done(_.bind(function(){this.options.sendFilesUiModel.setCLMode("#send-mode"),this.options.sendFilesUiModel.set("allow_comments",!1)},this))}else i===l.ERROR_UPLOAD&&this.showErrorBubble(l.CREATE_LINK_ERROR,a.SHARE_UPLOAD_ERROR_TITLE,a.SHARE_UPLOAD_ERROR_MSG)},_resetAfterError:function(i){var t=this.options.sendFilesUiModel;t.set("metadata_collection",i.filesModelBackup.clone()),t.set("local_file_objects",i.localFilesBackup),e.Util.isReader()&&1==this.generatingLinkForInitallySignedOutReader&&(this.generatingLinkForInitallySignedOutReader=!1)},_resetACUnifiedShareValues:function(){t.FetchDesktopSubscriptionsPromise=void 0,e.Util.isReader()&&(t.subscriptionFetched=!1,t.subscriptionFetchTriggered=!1)},showErrorBubble:function(e,i,t,s){return $(".us-popup-send-mail-error-dialog").show(),s===!0?$(".us-popup-send-mail-error-dialog").find(".us-popup-error-dialog-content-text").html(t):$(".us-popup-send-mail-error-dialog").find(".us-popup-error-dialog-content-text").text(t),$("#us-popup-view").addClass("popup-for-error-dialog"),$.Deferred().resolve().promise()},_showErrorRedLine:function(e,i,t){var s=!this.$smGenericErrorBlock.hasClass("hidden");s||(t?(this.$smGenericErrorBlock.addClass("hidden"),this.$(".sm-popup-req-sig-email-error-msg").html(e),this.$smAddSignersErrorBlock.removeClass("hidden"),this.$("#sm-popup-req-sig-close-button").focus(),i&&this.$("#us-share-popup-address-input-container-nv").css("border","1px solid red")):(this.$smAddSignersErrorBlock.addClass("hidden"),this.$(".sfs-nv-generic-error-msg").html(e),this.$smGenericErrorBlock.removeClass("hidden"),this.$("#sfs-nv-generic-error-close-button").focus()))},_closeAddSignerError:function(){this.$smAddSignersErrorBlock.hide(),this.$("#us-share-popup-address-input-container-nv").css("border","1px #e1e1e1")},_closeGenericError:function(){this.$smGenericErrorBlock.hide()},hideErrorBubble:function(e){(void 0===e||"sm-continue"!=e.target.id)&&$(".us-popup-error-dialog-container").hide()},_showErrorFullScreen:function(e,i){this._hideUploadSpinner(),this.$(".sm-popup-server-error-parent").show(),this.$("#sm-popup-server-error-back-btn").show(),this.$(".sm-popup-server-error-header").html(e),this.$(".sm-popup-server-error-content").html(i)},_addKeyEventListener:function(){this.options.appApi.keyApi.pushKeyHandler(this),$("#unified-share-container").on("click",this.hideErrorBubble)},_onKeyDown:function(e){var i=!1,t=e.which;if(13==t&&("sm-include-link-checkbox"==e.target.id?(e.target.click(),e.target.focus(),i=!0):$("#sm_switch_tab_link").is(":focus")?(this._onTryNowClick(!0),i=!0):"send-email-table"==e.target.id?(this._SendEmailSelected(),i=!0):"send-by-mail-nv-request-signature-table"==e.target.id?(this._RequestSignatureSelected(),i=!0):"sm-continue"==e.target.id?(this._onContinueClick(),i=!0):"us-popup-sm-more-options"==e.target.id?(this._onAdvancedSignOptions(),i=!0):"specify-where-to-sign-btn"==e.target.id?(this._onSpecifyWhereToSignClicked(),i=!0):"sm-popup-req-sig-cancel-btn"==e.target.id&&(this._addSignersBackBtnClicked(),i=!0)),9==t)if("sm-include-link-checkbox"==e.target.id){var s="row-unselected-border-nv",n="row-selected-border-nv";this._removeStyleClassWithCheck(this.$sendEmailContainer_nv,n),this.$sendEmailContainer_nv.addClass(s),this._showOptionsInExpandedState||this.$sendEmailContent.hide(),this._removeStyleClassWithCheck(this.$requestSignatureTable_nv,s),this.$requestSignatureTable_nv.addClass(n),this._showOptionsInExpandedState||this.$smRequestSignatureContent.show(),this.$requestSignatureTable_nv.focus(),i=!0,e.preventDefault()}else if("send-by-mail-nv-request-signature-table"==e.target.id)this.$("#sm-continue").focus(),i=!0,e.preventDefault();else if("sm-continue"==e.target.id){this._SendEmailSelected();var o=$("*[tabindex = 0]:enabled");o.eq(1).focus(),i=!0,e.preventDefault()}else if("us-share-popup-address-input-nv"==e.target.id)this._emailAddressView._focusOnSubjectArea(),i=!0,e.preventDefault();else if("us-share-popup-subject-list"==e.target.id)this._emailAddressView._focusOnMessageArea(),i=!0,e.preventDefault();else if("us-share-popup-message-list"==e.target.id)this._emailAddressView._blurOnMessageArea(),this.$("#specify-where-to-sign-btn").focus(),i=!0,e.preventDefault();else if("us-popup-sm-more-options"==e.target.id)this.$("#specify-where-to-sign-btn").focus(),i=!0,e.preventDefault();else if("specify-where-to-sign-btn"==e.target.id)this.$("#sm-popup-req-sig-cancel-btn").focus(),i=!0,e.preventDefault();else if("sm-popup-req-sig-cancel-btn"==e.target.id)this._emailAddressView._focusOnEmailTextarea(),i=!0,e.preventDefault();else{var o=$("*[tabindex = 0]:enabled"),a=o.index(e.target);0==a&&e.shiftKey?(o.eq(o.length-1).focus(),i=!0):a!=o.length-1||e.shiftKey?-1==a&&(o.eq(1).focus(),i=!0,e.preventDefault()):(o.eq(0).focus(),i=!0,e.preventDefault())}return i},_setEmailClientName:function(){var e=a.US_EMAIL_OPENED_MESSAGE,i=a.EMAIL_CLIENT_MAIL;"sm_default_mail"===this.options.SendMailUiModel.get("send_mail_mode")&&(i=this.options.SendMailUiModel.get("default_email_client")),e=e.replace('"<%=EMAIL_CLIENT_NAME%>"',i),this.$smMailSentDesc.text(e)},_launchPreferenceDialog:function(){this.options.appApi.rnaApi.done(function(e){e.stApi.invokeMethod({methodName:"launchEmailPref",methodArgs:""})})},_disablePopupAutoHide:function(){this.options.appApi.rnaApi.done(_.bind(function(e){e.rnaUnifiedSharePopupAPI.setPopupAutoHide("false")},this))},_enablePopupAutoHide:function(){this.options.appApi.rnaApi.done(_.bind(function(e){e.rnaUnifiedSharePopupAPI.setPopupAutoHide("true")},this))},_hidePopup:function(){this.options.appApi.rnaApi.done(_.bind(function(e){e.rnaUnifiedSharePopupAPI.hidePopup()},this))},_openDummyView:function(){this.options.appApi.rnaApi.done(_.bind(function(e){e.rnaUnifiedSharePopupAPI.openDummyView()},this))},_openDummyReview:function(){this.options.appApi.rnaApi.done(_.bind(function(e){e.rnaUnifiedSharePopupAPI.openDummyReview()},this))},_mapInstantLink:function(){this.options.appApi.rnaApi.done(_.bind(function(e){e.rnaUnifiedSharePopupAPI.mapInstantLink()},this))},_setLastAttachLinkMode:function(e){this.options.appApi.rnaApi.done(_.bind(function(i){i.rnaUnifiedSharePopupAPI.setLastAttachLinkMode(e)},this))},_setSendMailAttachLinkURL:function(e){this.options.appApi.rnaApi.then(_.bind(function(i){i.stApi.setSendMailAttachLinkURL(e)},this))},_setSendMailAttachFileName:function(){this.options.appApi.rnaApi.then(_.bind(function(e){e.stApi.setSendMailAttachFileName()},this))},_initAttachLink:function(){this.options.appApi.rnaApi.done(_.bind(function(e){e.rnaUnifiedSharePopupAPI.attachAsLinkEnabled()&&this.options.sendFilesUiModel.get("isSnTenabled")?(t.QueryParams&&"true"===t.QueryParams.attachLink?(this.$smIncludeLinkCheckBox.prop("checked",!0),this.$smIncludeLinkCheckBox.attr("aria-label","Attach a Link Toggle on")):(this.$smIncludeLinkInfoText.hide(),this.$attachLinkInfoText.hide(),this.$smSignInRequiredInfoText.hide()),e.rnaUnifiedSharePopupAPI.isUserSignedIn().done(_.bind(function(e){var i=this.options.sendFilesUiModel.get("ShareVariant"),t=e?"Signed In":"Signed out";this.options.appApi.siteCatalystApi.logScEvent([i,l.SEND_MAIL_MODE,t]),0==e&&this.$smIncludeLinkCheckBox.is(":checked")?this.$smSignInRequiredInfoText.show():this.$smSignInRequiredInfoText.hide()},this))):(this.$smIncludeLinkCheckBox.prop("checked",!1),this.$smIncludeLinkCheckBox.attr("aria-label","Attach a Link Toggle off"),this.$smIncludeLinkContainer.hide());var i=this.options.sendFilesUiModel.get("ShareVariant"),s=l.SEND_MAIL_MODE,n=this.options.sendFilesUiModel.get("workflowFile")?"Shared_"+l.INSTANT_LINK_DEFAULT:l.INSTANT_LINK_DEFAULT,o=this.$smIncludeLinkCheckBox.is(":checked")?"On":"Off";this.options.appApi.siteCatalystApi.logScEvent([i,s,n,o])},this))}}),t.UsPopupSendMailView}),define("pdmplugins/unified-share/js/popupView/templates/us-popup-promote-sign-template",[],function(){return'<div id="us-popup-promote-sign-container"><div class = "us-ps-default-state"><div class="us-ps-heading ui-theme theme-text"> <%= US_SIGN_PROMOTION_TITLE %> </div><ul class = "us-ps-list"><li class="us-ps-listitem ui-theme theme-text"><%= US_SIGN_PROMOTION_LI_1 %></li><li class="us-ps-listitem ui-theme theme-text"><%= US_SIGN_PROMOTION_LI_2 %></li><li class="us-ps-listitem ui-theme theme-text"><%= US_SIGN_PROMOTION_LI_3 %></li></ul><div class = "us-ps-button-bar"><button tabindex = "1" class="us-ps-sign-button control-button ui-theme theme-button theme-button-label floating-window-button-text" id="ps-request-sign" aria-label ="<%= REQUEST_SIGNATURES_BUTTON %>" ><%= REQUEST_SIGNATURES_BUTTON %></button><button tabindex = "0" class="us-ps-skip-button control-button ui-theme popup-quiet-button" id="us-ps-skip" aria-label ="<%= SKIP_BUTTON %>" ><%= SKIP_BUTTON %></button></div></div></div>'}),define("pdmplugins/unified-share/js/popupView/views/us-popup-promote-sign-view",["core/ac-core","files/ac-files","pdmplugins/unified-share/js/ac-unified-share","pdmplugins/unified-share/js/popupView/templates/us-popup-promote-sign-template","i18n!pdmplugins/unified-share/js/nls/ui-strings","pdmplugins/unified-share/js/utils/sc-constants","pdmplugins/unified-share/js/utils/ts-utils","core/utils/util"],function(e,i,t,s,n){return t.UsPopupPromoteSignView=e.View.extend({events:{"click #ps-request-sign":"_onRequestSignClick","click #us-ps-skip":"_onSkipToSendMailClick"},initialize:function(){e.View.prototype.initialize.call(this),this._template=_.template(s),this.options.SendMailUiModel=new t.SendMailUiModel},render:function(){this.$el;e.View.prototype.render.call(this),this._template=_.template(s),0===this.$el.children().length&&this.$el.html(this._template({US_SIGN_PROMOTION_TITLE:n.US_SIGN_PROMOTION_TITLE,US_SIGN_PROMOTION_LI_1:n.US_SIGN_PROMOTION_LI_1,US_SIGN_PROMOTION_LI_2:n.US_SIGN_PROMOTION_LI_2,US_SIGN_PROMOTION_LI_3:n.US_SIGN_PROMOTION_LI_3,REQUEST_SIGNATURES_BUTTON:n.SHARE_SIGN3,SKIP_BUTTON:n.ATTACH_TO_EMAIL})),this._addKeyEventListener(),this._fetchAllProfiles(),this._getLastUsedChoices(),this.options.appApi.rnaApi.done(_.bind(function(e){this._rnaApi=e,this._initInstantLinkCreation()},this))},_addKeyEventListener:function(){this.options.appApi.keyApi.pushKeyHandler(this)},_onKeyDown:function(){},_onRequestSignClick:function(){this._rnaApi.rnaUnifiedSharePopupAPI.requestSignatures();var e="SignExperiment",i="PromoteSignAttachEmailPopUp",t="RequestSignClicked";this.options.appApi.siteCatalystApi.logScEvent([e,i,t])},_onSkipToSendMailClick:function(){var e=this.options.SendMailUiModel,i=e.get("send_mail_mode"),t=e.get("selected_profile"),s=e.get("email_addresses")[t];this._hidePopup(),this._sendMail(i,t,s);var n="SignExperiment",o="PromoteSignAttachEmailPopUp",a="SkipToSendMailClicked";this.options.appApi.siteCatalystApi.logScEvent([n,o,a])},_sendMail:function(e,i,t){if("sm_default_mail"===e)this._sendMailFinal(!1,"none");else{if(i===n.SELECT_OPTION||""===i||i===n.ADD_OTHER||i===n.ADD_GMAIL||i===n.ADD_YAHOO)return;this._sendMailFinal(!0,t)}},_sendMailFinal:function(i,t){this._shouldAttachAsLink?e.Util.isReader()&&this._linkCreationDelayed===!0?(this._linkCreationDelayed=!1,this._createLinkAndSendMail(i,t)):this._checkInstantLinkPromiseAndSendMail(i,t):this._sendMailWithAttachment(i,t)},_sendMailWithAttachment:function(e,i){var t={useWebmail:e,profile:i};this._rnaApi.stApi.sendMailWithoutFLD(t)},_createLinkAndSendMail:function(e,i){this._backupOptions=this._createBackup(),this.options.instantLinkRetrievedPromise=t.opFactory.create("CreateInstantLinkForMailOp",this.options).run(),this._checkInstantLinkPromiseAndSendMail(e,i)},_checkInstantLinkPromiseAndSendMail:function(e,i){this.options.instantLinkRetrievedPromise&&this.options.instantLinkRetrievedPromise.then(_.bind(function(){var s=_.extend({},this.options,{useWebmail:e,profile:i});t.opFactory.create("SendMailWithLinkOp",s).run()},this),_.bind(function(){this._backupOptions&&(this._revertToBackup(this._backupOptions),this._backupOptions=void 0),this._sendMailWithAttachment(e,i)},this))},_fetchAllProfiles:function(){t.opFactory.create("FetchMailProfilesOp",this.options).run()},_getLastUsedChoices:function(){t.opFactory.create("FetchLastUsedMailPrefs",this.options).run()},_hidePopup:function(){this._rnaApi.rnaUnifiedSharePopupAPI.hidePopup()},_initInstantLinkCreation:function(){var i=this.options.sendFilesUiModel;if(this._rnaApi.rnaUnifiedSharePopupAPI.attachAsLinkEnabled()&&i.get("isSnTenabled")&&t.QueryParams&&"true"===t.QueryParams.attachLink){if(i.isValidInstantLinkPresent())return;if(!this.options.appApi.networkConnectivityApi.isOnline())return;if(!i.isAVSharingPermitted())return void i.setShareState("avNotAllowed");if(this._shouldAttachAsLink=!0,e.Util.isReader()&&!this.options.appApi.sessionApi.isSignedInReader(this._rnaApi))return void(this._linkCreationDelayed=!0);this._backupOptions=this._createBackup(),this.options.instantLinkRetrievedPromise=t.opFactory.create("CreateInstantLinkForMailOp",this.options).run()}},_createBackup:function(){var e=this.options.sendFilesUiModel,i=e.get("metadata_collection"),t=e.get("local_file_objects");return{filesModelBackup:i.clone(),localFilesBackup:t}},_revertToBackup:function(e){var i=this.options.sendFilesUiModel;i.set("metadata_collection",e.filesModelBackup.clone()),i.set("local_file_objects",e.localFilesBackup)}}),t.UsPopupPromoteSignView}),define("pdmplugins/unified-share/js/popupView/views/us-popup-content-view",["core/ac-core","files/ac-files","pdmplugins/unified-share/js/ac-unified-share","pdmplugins/unified-share/js/popupView/templates/us-popup-content-template","i18n!pdmplugins/unified-share/js/nls/ui-strings","pdmplugins/unified-share/js/utils/sc-constants","core/utils/crypto-util","core/utils/file-types","pdmplugins/unified-share/js/ops/desktop-add-files-op","pdmplugins/unified-share/js/models/ui/selector-ui-model","pdmplugins/unified-share/js/popupView/views/us-popup-create-link-view","pdmplugins/unified-share/js/popupView/views/us-popup-share-view","pdmplugins/unified-share/js/popupView/views/us-popup-send-mail-view","pdmplugins/unified-share/js/popupView/views/us-popup-promote-sign-view","pdmplugins/unified-share/js/ops/close-app-op"],function(e,i,t,s,n,o,a){var l={shareButton:"Send Invitation Selected",createLink:"Get Link Selected",attachToEmail:"Attachment Selected"};return t.USPopupContentView=e.View.extend({events:{"click .share-close":"_onClickClose"},initialize:function(){e.View.prototype.initialize.call(this),this._template=_.template(s)},render:function(){e.View.prototype.render.call(this),0===this.$el.children().length&&(this.$el.html(this._template),this._initWrappers()),this._renderChildViews(),this._updateEscKeyHandler(),this._addUiModelEventListeners(),this._addKeyEventListener(),this._logShareVariant()},_addUiModelEventListeners:function(){var e=this.options.sendFilesUiModel;e.on("change:promoteSign",this._onRefreshView,this)},_addKeyEventListener:function(){this.options.appApi.keyApi.pushKeyHandler(this)},_onKeyDown:function(e){var i=e.which;return 27===i?(this._onClickClose(),this._consumeEvent(e),!0):void 0},_initWrappers:function(){this.$usPopupContainer=this.$("#unified-share-popup-container"),this.$usPopupCreateLinkContainer=this.$("#us-popup-create-link-view"),this.$usPopupShareContainer=this.$("#us-popup-share-view"),this.$usPopupSendMailContainer=this.$("#us-popup-send-mail"),this.$usPopupPromoteSignContainer=this.$("#us-popup-promote-sign")},_startPlugin:function(){var i=this.options,s=this._gettingAuthenticatedModelsPromise;return s||(s=this._gettingAuthenticatedModelsPromise=!e.Util.isCEF()&&i.appApi.sessionApi.isSignedIn()?t.opFactory.create("GettingAuthenticatedModelsOp",i).run():this._getResolvedPromise()),s},_renderChildViews:function(){this.options.sendFilesUiModel.resetFileListModel();var e=this._fetchDocument();_.isUndefined(e)||e.then(_.bind(function(){"createLink"==this.options.sendFilesUiModel.get("launchpad")?(this.options.sendFilesUiModel.set("US_tab_open","createLink"),this._renderChildView("_usPopupCreateLinkView",t.USPopupCreateLinkView,this.$usPopupCreateLinkContainer)):"shareButton"==this.options.sendFilesUiModel.get("launchpad")?(this.options.sendFilesUiModel.set("US_tab_open","share"),this._renderChildView("_usPopupShareView",t.UsPopupShareView,this.$usPopupShareContainer)):"attachToEmail"==this.options.sendFilesUiModel.get("launchpad")&&(this.options.sendFilesUiModel.get("promoteSign")===!0?(this.options.sendFilesUiModel.set("US_tab_open","promoteSign"),this._renderChildView("_usPopupPromoteSign",t.UsPopupPromoteSignView,this.$usPopupPromoteSignContainer)):(this.options.sendFilesUiModel.set("US_tab_open","attachToEmail"),this._renderChildView("_usPopupSendMail",t.UsPopupSendMailView,this.$usPopupSendMailContainer)))
},this))},_onClickClose:function(){var e=new t.CloseAppOp(this.options);e.run()},_updateEscKeyHandler:function(){this.options.appApi.rnaApi.then(_.bind(function(e){e.stApi.handleEscKeyAtCef()},this),_.bind(function(){return $.Deferred().reject().promise()},this))},_fetchDocument:function(){console.log("inside fetch document");var i,t,s,n=this.options;return this._uiModel=n.sendFilesUiModel,i=this._startPlugin(),e.Util.isCEF()?(this._activeView=void 0,this.options.readRegistry=!0,t=this._fetchActiveDocument(),this._uiModel.set("fetchDocPromise",t),console.log("Setting fetchDocPromise to"+this._uiModel.get("fetchDocPromise"))):(this._activeView=this._uiModel.get("active_view"),t=$.Deferred().resolve().promise()),t.then(_.bind(function(){return s=this._activeView,i.then(_.bind(function(){var i=e.Features.getFeature("enable_sender_survey"),t=this._uiModel.get("limits_model"),s=t.get("can_custom_brand"),n=this.options.brandingModel.get("enabled"),o=!1,l=this.options.appApi.usersMeApi.getUserCohorts();l&&"enabled"===l["ts-sender-survey"]&&(o=!0),e.Util.isCEF()&&(n=!1),this._uiModel.set({active:!0,user_action_id:a.getRandomString(),user_action_name:"Share:ShareButton",customize_recipient_page:n,customize_recipient_page_enabled:s,enable_sender_survey:i&&o})},this))},this))},_fetchActiveDocument:function(){console.log("fetch active document");{var i,s,n,o,a,l,r,d,p,h,c=(t.selector.routerArgs,$.Deferred()),u=[];this.options.recentFolderModel}return this.options.appApi.rnaApi.then(_.bind(function(m){i=m.stApi.getSendTrackAppLauncherWithParcel(),d=m.stApi.getSendTrackAppLauncherWithAssets(),p=m.stApi.getSendTrackAppLauncherWithModels(),d?(this.options.appApi.displayApi.showSpinner(!0),r=JSON.parse(d),l=$.map(r,function(e){return e}),this._activeView="workflow",this.options.appApi.sessionApi.ensureSignedIn().then(_.bind(function(){t.opFactory.create("DesktopGettingSubscriptionLevels",this.options).run().always(_.bind(function(){this._uiModel.addFilesToCollection(l),this.options.appApi.displayApi.showSpinner(!1),c.resolve().promise()},this))},this),_.bind(function(){this.options.appApi.displayApi.showSpinner(!1)},this))):p?(this.options.appApi.displayApi.showSpinner(!0),this._activeView="workflow",p.length>0&&(_.each(p,function(i){h=new e.LocalItemModel(void 0,{_proxy:i._proxy}),u.push(h)}),this._uiModel.addFileObjects(u),c.resolve().promise()),this.options.appApi.displayApi.showSpinner(!1)):i?(this.options.appApi.displayApi.showSpinner(!0),this._activeView="workflow",this.options.appApi.sessionApi.ensureSignedIn().then(_.bind(function(){s=this.options.appApi.baseFilesUrisApi.getSendApiUri(),s=tsUtils.extractRootUrl(s),this.options.rootUrl=s,this.options.appApi.displayApi.showSpinner(!1),this._gettingAuthenticatedModelsPromise.then(_.bind(function(){o=this.options.rootUrl,a=new t.AddParcelOp({uiModel:this._uiModel,parcelId:i,rootUrl:o}),t.opFactory.create("DesktopGettingSubscriptionLevels",this.options).run().always(_.bind(function(){a.run()},this)),c.resolve().promise()},this))},this),_.bind(function(){this.options.appApi.displayApi.showSpinner(!1)},this))):(console.log(" launching app :  "+this._uiModel.get("launchpad")),n=m.getOpenedFile(),_.isEmpty(n)?(this._activeView="welcome",c.resolve().promise(),console.log("Reloading CEF view as opened file info not found"),m.rnaUnifiedSharePopupAPI.reloadCEFView()):(this._activeView="workflow",this.options.appApi.rnaApi.done(_.bind(function(e){if(n.invoke("determineFileSource").then(_.bind(function(e){if("root"===e||"unsupported"===e||"local"===e||"desktop_sharepoint"===e||"native"===e||"native_v2"===e)console.log("add file objects"),this._uiModel.addFileObjects(n);else if("box"===e||"dropbox"===e||"onedrive"===e||"onedrivebusiness"===e||"googleDrive"===e)this._uiModel.addFileObjects(n),this._uiModel.addConnectorFileObjects(n);else if("ccloud"==e)this._uiModel.addFileObjects(n),this._uiModel.addCCloudFileObjects(n);else{var i,s=[];i=new t.DisallowedFileModel({name:n.get("name"),source:e,reason:"non-native"}),s.push(i),this._uiModel.set("disallowed_files",s,{silent:!1})}},this),_.bind(function(){this._uiModel.addFileObjects(n)},this)),this.options.sendFilesUiModel.set("openedFileAssetId",n.get("assetId")),""==n.get("assetId")){var i=e.rnaServicesAPI.getActiveDocAssetFromNative();i.then(_.bind(function(e){this.options.sendFilesUiModel.set("openedFileAssetId",e)},this))}this._isDirty(n,e).then(_.bind(function(){this.options.sendFilesUiModel.set("bHFileIsDirty",!1),c.resolve().promise()},this),_.bind(function(){this.options.sendFilesUiModel.set("bHFileIsDirty",!0),c.resolve().promise()},this));var s=n.get("name");this.options.sendFilesUiModel.set("filename",s),this._setOpenedDocNameAsSubject(s,!1),n.on("change:name",_.bind(function(e,i){var t=i;this.options.sendFilesUiModel.updateOpenedFile(e),this.options.sendFilesUiModel.get("is_subject_user_input")||this._setOpenedDocNameAsSubject(t,!0)},this))},this))))},this)),c.promise()},_isDirty:function(e,i){return i.rnaServicesAPI.isDirtyApi(e._proxy).then(_.bind(function(e){return e?$.Deferred().reject().promise():$.Deferred().resolve().promise()},this),_.bind(function(){return $.Deferred().reject().promise()},this))},_setOpenedDocNameAsSubject:function(e,i){var t=this.options.sendFilesUiModel;if(i||!t.get("us_subject_text")){var s=e.substring(0,e.lastIndexOf("."));s=s?s:e,t.set("us_subject_text",s),t.set("cl_subject_text",s)}},_onRefreshView:function(){this.removeAllChildViews(),this._renderChildViews(),this._logShareVariant()},_logShareVariant:function(){var e=this.options.sendFilesUiModel;if("attachToEmail"!=e.get("launchpad")||e.get("promoteSign")!==!0){var i=e.get("ShareVariant"),t=o.DISCOVER,s="Open Share Panel";this.options.appApi.siteCatalystApi.logScEvent([i,t,s]);var n=e.get("launchpad");s=l[n],this.options.appApi.siteCatalystApi.logScEvent([i,t,s])}}}),t.USPopupContentView}),define("pdmplugins/unified-share/js/views/us-content-view",["core/ac-core","files/ac-files","pdmplugins/unified-share/js/ac-unified-share","pdmplugins/unified-share/js/templates/us-content-template","i18n!pdmplugins/unified-share/js/nls/ui-strings","pdmplugins/unified-share/js/utils/sc-constants","core/utils/file-types","core/utils/truncate","core/utils/crypto-util","core/views/plugin-content-view","pdmplugins/unified-share/js/models/limits-model","pdmplugins/unified-share/js/models/ui/send-files-ui-model","pdmplugins/unified-share/js/models/ui/can-sign-ui-model","pdmplugins/unified-share/js/ops/desktop-add-files-op","pdmplugins/unified-share/js/ops/close-app-op","pdmplugins/unified-share/js/views/us-rhp-content-view","pdmplugins/unified-share/js/modalView/views/us-modal-view-content-view","pdmplugins/unified-share/js/popupView/views/us-popup-content-view"],function(e,i,t,s,n,o){return t.PluginView=e.PluginContentView.extend({initialize:function(){e.PluginContentView.prototype.initialize.call(this),this.tabSelectorUIModel=t.uiModelFactory.create("SelectorUiModel"),this._template=_.template(s),t.opFactory.create("StartingPluginOp",this.options).run()},render:function(){e.PluginContentView.prototype.render.call(this),window.location.href.includes("unified_share")&&(0===this.$el.children().length&&($("body").addClass("unified-share-main"),this.$el.html(this._template()),this._initWrappers()),this._renderChildViews())},_updateSendMailBackgroundForModernSharesheet:function(){if(t.QueryParams&&"attachToEmail"===t.QueryParams.launchApp&&"true"===t.QueryParams.sharesheetEnabled){var e=!1,i="LightIcons";if(void 0===this.options.appApi.displayApi||void 0===this.options.appApi.displayApi.options.cefContextModel)return;this.options.appApi.displayApi.options.cefContextModel.get("browserCEFManager").invoke("getThemeData").done(_.bind(function(t){t.hasOwnProperty("iconSet")&&(i=t.iconSet),t.hasOwnProperty("isHighContrast")&&(e=t.isHighContrast),"LightIcons"===i&&e===!1?($("#unified-share-container").attr("style","background-color: #ffffff !important"),$("#us-popup-send-mail-get-sign-container").attr("style","background-color: #ffffff !important")):($("#unified-share-container").removeAttr("style"),$("#us-popup-send-mail-get-sign-container").removeAttr("style"))},this))}},_updateToggleTheme:function(){if(t.QueryParams){if(this.$usToggleView=void 0,"createLink"===t.QueryParams.launchApp)this.$usToggleView=this.$("#create-link-toggle");else if("shareButton"===t.QueryParams.launchApp)this.$usToggleView=this.$("#invite-people-toggle");else{if("attachToEmail"!==t.QueryParams.launchApp)return;this.$usToggleView=this.$("#send-by-email-toggle")}var e=!1,i="LightIcons";if(void 0===this.options.appApi.displayApi||void 0===this.options.appApi.displayApi.options.cefContextModel)return;this.options.appApi.displayApi.options.cefContextModel.get("browserCEFManager").invoke("getThemeData").done(_.bind(function(s){s.hasOwnProperty("iconSet")&&(i=s.iconSet),s.hasOwnProperty("isHighContrast")&&(e=s.isHighContrast),"LightIcons"!==i||e?"DarkIcons"!==i||e||(t.QueryParams.theme="DarkTheme",this.$usToggleView.removeClass("lightTheme"),this.$usToggleView.addClass("darkTheme")):(t.QueryParams.theme="LightTheme",this.$usToggleView.removeClass("darkTheme"),this.$usToggleView.addClass("lightTheme"))},this))}},initPlugin:function(){return $.Deferred().resolve().promise()},selectPlugin:function(){this._initPlugin(),this.options.appApi.sessionApi.isSignedInReader()&&(this.isInitial=!0);var e=$.Deferred();return this._paramBasedInitPlugin().done(_.bind(function(){this.options.appApi.sessionApi.isSignedInReader()&&(this.isInitial=!0);var i=this.options;i.showUrlPath&&i.appApi.routerApi.navigate(i.urlPathPrefix+t.PLUGIN_ID),_.defer(function(){t.selectorUiModel&&-1===t.selectorUiModel.get("selected_selector_id")&&t.selectorUiModel.set("selected_selector_id",0)}),this.options.appApi.displayApi.applyUIThemeStyles(this.$el).then(_.bind(function(){this.render(),this.options.appApi.displayApi.showSpinner(!1)},this)),e.resolve()},this)),e.promise()},deselectPlugin:function(){},releasePlugin:function(){e.PluginContentView.prototype.releasePlugin.call(this),t.selectorUiModel.set("selected_selector_id",-1)},getSiteCatalystName:function(){return"UnifiedShare"},_initWrappers:function(){this.$usContainer=this.$("#unified-share-container"),this.$usRhpView=this.$("#unified-share-rhp-view"),this.$usModalView=this.$("#unified-share-modal-view"),this.$usPopupView=this.$("#unified-share-popup-view")},_addAppApiCallbacks:function(){this.options.appApi.sessionApi.addSignedInChangeCallback(this._onSignedInChange)},_onSignedInChange:function(i,s){s?this.isInitial?(this.isInitial=!1,this._logCohorts()):(this.options.readRegistry=!1,e.Util.isReader()&&(t.subscriptionFetchTriggered=!0),t.opFactory.create("DesktopGettingSubscriptionLevels",this.options).run().always(_.bind(function(){this.render(),this._logCohorts(),e.Util.isReader()&&(t.subscriptionFetched=!0,void 0!=t.FetchDesktopSubscriptionsPromise&&t.FetchDesktopSubscriptionsPromise.resolve())},this))):(this.options.readRegistry=!1,this.isInitial=!1,this.options.limitsModel.resetValues(),this.options.sendFilesUiModel.set({limits_model:this.options.limitsModel}),this.options.sendFilesUiModel.resetTodefaults(),this.options.autoCCollection.reset(),e.Util.isReader()&&(t.subscriptionFetched=!1,t.subscriptionFetchTriggered=!1))},_logCohorts:function(){var e,i,t,s=this.options;e="ts-direct-to-workflow-view",i=s.appApi.usersMeApi.getUserCohorts(),i[e]&&(t=i[e],this.options.appApi.siteCatalystApi.logScEvent([o.TOOLS,this.options.sendFilesUiModel.get("ShareVariant"),e,t]))},_initPlugin:function(){var i,s,o=this.options;t.FetchDesktopSubscriptionsPromise=void 0,e.Util.isReader()&&(t.subscriptionFetched=!1,t.subscriptionFetchTriggered=!1),e.Util.isCEF()?(this._addAppApiCallbacks(),this.options.appApi.sessionApi.isSignedInReader()&&(this.isInitial=!0),e.Util.isReader()?s=n.READER_GO_URL:e.Util.isAcrobat()&&(s=n.ACROBAT_GO_URL)):(s="https://www.acrobat.com/adobesend/en/pricing.html?promoid=KQMMS",i=this.options.appApi.baseFilesUrisApi.getSendApiUri(),i=tsUtils.extractRootUrl(i),o.rootUrl=i,o.limitsModel.set({rootUrl:o.rootUrl})),o.limitsModel=new t.LimitsModel({can_send_to_individuals:!1,can_send_av:!1,can_custom_brand:!1,av_mimetypes:["application/mxf","application/ogg","application/vnd.rn-realmedia"],av_extensions:["aac","aic","aif","aiff","asf","asx","au","avi","avs","dif","divx","dv","flv","f4v","lsf","lsx","mkv","m3u","m4a","m4p","m4v","mov","movie","mp2","mp3","mp4","mpe","mpeg","mpg","mpga","mxu","ogg","qt","ra","ram","rm","snd","vob","wav","wma","wmv"],max_files:50,max_recipients:250,max_subject_length:1e3,max_message_length:1e3,upgrade_url:s},{rootUrl:o.rootUrl,usersMeApi:this.options.appApi.usersMeApi});var a=!0;this._uiModel=new t.SendFilesUiModel({limits_model:o.limitsModel,connectors_api:this.options.appApi.connectorsApi,allow_comments_enabled:a}),o.sendFilesUiModel=this._uiModel,this._canSignUiModel=new t.CanSignUiModel({sendFilesUiModel:o.sendFilesUiModel}),o.canSignUiModel=this._canSignUiModel,e.Util.isCEF()&&o.sendFilesUiModel.set({view_mode:"cef"}),o.recentFolderModel=e.modelFactory.create("FolderModel")},_paramBasedInitPlugin:function(){var e=$.Deferred();return this.options.appApi.rnaApi.done(_.bind(function(i){if(t.QueryParams=this.options.appApi.routerApi.parseQueryParams(window.location.href.slice(window.location.href.indexOf("?"))),t.QueryParams){if((void 0===t.QueryParams.mode||""===t.QueryParams.mode)&&(t.QueryParams.mode="#send-mode"),this.options.sendFilesUiModel.setUSMode(t.QueryParams.mode),"#sign-mode"!==t.QueryParams.mode&&this.options.sendFilesUiModel.setCLMode(t.QueryParams.mode),"true"===t.QueryParams.isOriginalShareEnabled?this.options.sendFilesUiModel.set("isOriginalShareEnabled",!0):this.options.sendFilesUiModel.set("isOriginalShareEnabled",!1),"true"===t.QueryParams.isShareViewSyncEnabled?this.options.sendFilesUiModel.set("isShareViewSyncEnabled",!0):this.options.sendFilesUiModel.set("isShareViewSyncEnabled",!1),this.options.sendFilesUiModel.setLaunchpad(t.QueryParams.launchApp),this.options.sendFilesUiModel.set("layout",t.QueryParams.layout),this.options.sendFilesUiModel.set("isModalView",t.QueryParams.isModalView),this.options.sendFilesUiModel.set("isPopupView",t.QueryParams.isPopupView),this.options.sendFilesUiModel.set("isSnTenabled",i.stApi.isSendTrackAvailable()),this.options.sendFilesUiModel.set("isReviewVisible",i.stApi.isAdobeReviewAvailable()),this.options.sendFilesUiModel.set("isAdobeSignVisible",i.stApi.isAdobeSignVisible()&&"onlyRHP"===this.options.sendFilesUiModel.get("layout")),"true"===t.QueryParams.isModalView){var s=t.QueryParams.shareVariant,n=t.QueryParams.SingleFileSize;s&&"string"==typeof s&&s.startsWith("ShareModal")?this.options.sendFilesUiModel.set("ShareVariant",s):this.options.sendFilesUiModel.set("ShareVariant",o.SHARE_MODAL),n&&this.options.sendFilesUiModel.set("SingleFileSize",n)}else if("true"===t.QueryParams.isPopupView){var s=t.QueryParams.shareVariant;s&&"string"==typeof s?this.options.sendFilesUiModel.set("ShareVariant",s):this.options.sendFilesUiModel.set("ShareVariant",o.SHARE_POPUP),"attachToEmail"===t.QueryParams.launchApp&&"true"===t.QueryParams.promoteSign&&this.options.sendFilesUiModel.set("promoteSign",!0)}else this.options.sendFilesUiModel.set("ShareVariant",o.SHARE);this.options.sendFilesUiModel.set("checkForSave","true"===t.QueryParams.checkForSave),this.options.sendFilesUiModel.set("LoadShareModalContentsInRHP","true"===t.QueryParams.LoadShareModalContentsInRHP),this.options.sendFilesUiModel.set("workflowFile","true"===t.QueryParams.workflowFile)}else this.options.sendFilesUiModel.setUSMode("#send-mode"),this.options.sendFilesUiModel.setCLMode("#send-mode"),this.options.sendFilesUiModel.setLaunchpad("shareButton"),this.options.sendFilesUiModel.set("layout","onlyRHP"),this.options.sendFilesUiModel.set("isSnTenabled",i.stApi.isSendTrackAvailable()),this.options.sendFilesUiModel.set("isReviewVisible",i.stApi.isAdobeReviewAvailable()),this.options.sendFilesUiModel.set("isAdobeSignVisible",i.stApi.isAdobeSignVisible()&&"onlyRHP"===this.options.sendFilesUiModel.get("layout")),this.options.sendFilesUiModel.set("checkForSave",!0),this.options.sendFilesUiModel.set("LoadShareModalContentsInRHP",!1);"true"===t.QueryParams.isModalView&&(this.options.sendFilesUiModel.set("US_tab_open","share"),this.options.sendFilesUiModel.set("default_modal_view_tab","share")),this.options.sendFilesUiModel.get("isReviewVisible")&&"onlyRHP"===this.options.sendFilesUiModel.get("layout")||"#sign-mode"!==this.options.sendFilesUiModel.get("us_mode")&&(this.options.sendFilesUiModel.setUSMode("#send-mode"),this.options.sendFilesUiModel.setCLMode("#send-mode")),this.options.sendFilesUiModel.set("multipleFilesSupported",i.stApi.isMultiFileParcelSupported()),e.resolve()},this)),e.promise()},_renderChildViews:function(){var e=!1,i=this.options.appApi.rnaApi;"true"!==t.QueryParams.isModalView&&this._changeUSModeBasedOnVisibility(),i.done(_.bind(function(i){i.isFeatRunning()&&this.options.sendFilesUiModel.get("LoadShareModalContentsInRHP")&&(e=!0)},this)),"true"==this.options.sendFilesUiModel.get("isPopupView")?(this._renderChildView("_unisharepopupcontentview",t.USPopupContentView,this.$usPopupView),this.$usRhpView.hide(),this.$usModalView.hide()):"true"===this.options.sendFilesUiModel.get("isModalView")||e?(this._renderChildView("_unisharemodalcontentview",t.ModalContentView,this.$usModalView),this.$usRhpView.hide()):(this._renderChildView("_unisharerhpcontentview",t.RhpContentView,this.$usRhpView),this.$usModalView.hide())},_changeUSModeBasedOnVisibility:function(){var e=this.options.sendFilesUiModel.get("us_mode"),i=e;this.options.sendFilesUiModel.get("isSnTenabled")||"#send-mode"!==e&&"#review-mode"!==e||(i="#sign-mode"),this.options.sendFilesUiModel.get("isAdobeSignVisible")||"#sign-mode"!==e&&"#sign-mode"!==i||(i="#send-mode"),this.options.sendFilesUiModel.setUSMode(i)}}),t.PluginView}),define("pdmplugins/unified-share/js/models/users-me-branding-model",["core/ac-core","pdmplugins/unified-share/js/ac-unified-share","core/utils/http-util","core/models/model"],function(e,i,t){return i.UsersMeBrandingModel=e.Model.extend({initialize:function(i,t){e.Model.prototype.initialize.call(this,i,t),this.rootUrl=t.rootUrl},url:function(){return this.rootUrl+"/a/api/users/me/branding"},setRUrl:function(e){this.rootUrl=e},toJSON:function(){return{enabled:this.get("enabled"),logo:this.get("logo"),color:this.get("color")}},customizeOptions:function(e,i){var s=t.customizeOptions(e,i);return s.headers.Accept="application/json",s.headers["Content-Type"]="application/json",s}}),i.UsersMeBrandingModel}),define("pdmplugins/unified-share/js/models/ui/ui-model-factory",["core/ac-core","pdmplugins/unified-share/js/ac-unified-share","core/models/ui/ui-model","pdmplugins/unified-share/js/models/ui/selector-ui-model","pdmplugins/unified-share/js/models/ui/notification-ui-model","pdmplugins/unified-share/js/models/users-me-branding-model"],function(e,i){i.UiModelFactory=e.UiModel.extend({create:function(e,t,s){var n=i[e];return n?new n(t,s):void LOG(0,"AcUnifiedShare.UiModelFactory.create: Unrecognized class: "+e)}})}),define("pdmplugins/unified-share/js/unified-share",["pdmplugins/unified-share/js/ac-unified-share","pdmplugins/unified-share/js/ops/op-factory","pdmplugins/unified-share/js/views/us-content-view","pdmplugins/unified-share/js/models/ui/ui-model-factory"],function(e){_.extend(e,{init:function(){e.opFactory=new e.OpFactory,e.uiModelFactory=new e.UiModelFactory}})}),define("pdmplugins/unified-share/js/plugin",["pdmplugins/unified-share/js/ac-unified-share","pdmplugins/unified-share/js/unified-share"],function(e){e.init()});