UNPKG

@microsoft/office-js

Version:
17 lines (15 loc) • 144 kB
/* Outlook specific API library */ /* Version: 15.0.4812.3000 */ /* Copyright (c) Microsoft Corporation. All rights reserved. */ /* Your use of this file is governed by the Microsoft Services Agreement http://go.microsoft.com/fwlink/?LinkId=266419. */ /*! Copyright (c) Microsoft Corporation. All rights reserved. */ /*! Your use of this file is governed by the Microsoft Services Agreement http://go.microsoft.com/fwlink/?LinkId=266419. */ Type.registerNamespace("Microsoft.Office.WebExtension.MailboxEnums");Microsoft.Office.WebExtension.MailboxEnums.EntityType={MeetingSuggestion:"meetingSuggestion",TaskSuggestion:"taskSuggestion",Address:"address",EmailAddress:"emailAddress",Url:"url",PhoneNumber:"phoneNumber",Contact:"contact",FlightReservations:"flightReservations",ParcelDeliveries:"parcelDeliveries"};Microsoft.Office.WebExtension.MailboxEnums.ItemType={Message:"message",Appointment:"appointment"};Microsoft.Office.WebExtension.MailboxEnums.ResponseType={None:"none",Organizer:"organizer",Tentative:"tentative",Accepted:"accepted",Declined:"declined"};Microsoft.Office.WebExtension.MailboxEnums.RecipientType={Other:"other",DistributionList:"distributionList",User:"user",ExternalUser:"externalUser"};Microsoft.Office.WebExtension.MailboxEnums.AttachmentType={File:"file",Item:"item",Cloud:"cloud"};Microsoft.Office.WebExtension.MailboxEnums.BodyType={Text:"text",Html:"html"};Microsoft.Office.WebExtension.MailboxEnums.ItemNotificationMessageType={ProgressIndicator:"progressIndicator",InformationalMessage:"informationalMessage",ErrorMessage:"errorMessage"};Microsoft.Office.WebExtension.CoercionType={Text:"text",Html:"html"};Microsoft.Office.WebExtension.MailboxEnums.UserProfileType={Office365:"office365",OutlookCom:"outlookCom",Enterprise:"enterprise"};Microsoft.Office.WebExtension.MailboxEnums.RestVersion={v1_0:"v1.0",v2_0:"v2.0",Beta:"beta"};Type.registerNamespace("OSF.DDA");var OSF=window.OSF||{};OSF.DDA=OSF.DDA||{};window.OSF.DDA.OutlookAppOm=OSF.DDA.OutlookAppOm=function(n,t,i){this.$$d__callAppReadyCallback$p$0=Function.createDelegate(this,this._callAppReadyCallback$p$0);this.$$d_displayContactCardAsync=Function.createDelegate(this,this.displayContactCardAsync);this.$$d_displayNewMessageFormApi=Function.createDelegate(this,this.displayNewMessageFormApi);this.$$d__displayNewAppointmentFormApi$p$0=Function.createDelegate(this,this._displayNewAppointmentFormApi$p$0);this.$$d_windowOpenOverrideHandler=Function.createDelegate(this,this.windowOpenOverrideHandler);this.$$d__getEwsUrl$p$0=Function.createDelegate(this,this._getEwsUrl$p$0);this.$$d__getDiagnostics$p$0=Function.createDelegate(this,this._getDiagnostics$p$0);this.$$d__getUserProfile$p$0=Function.createDelegate(this,this._getUserProfile$p$0);this.$$d__getItem$p$0=Function.createDelegate(this,this._getItem$p$0);this.$$d__getInitialDataResponseHandler$p$0=Function.createDelegate(this,this._getInitialDataResponseHandler$p$0);window.OSF.DDA.OutlookAppOm._instance$p=this;this._officeAppContext$p$0=n;this._appReadyCallback$p$0=i;var u=this;var r=function(){i&&u.invokeHostMethod(1,null,u.$$d__getInitialDataResponseHandler$p$0)};this._areStringsLoaded$p$0()?r():this._loadLocalizedScript$p$0(r)};window.OSF.DDA.OutlookAppOm._throwOnPropertyAccessForRestrictedPermission$i=function(n){if(!n)throw Error.create(window._u.ExtensibilityStrings.l_ElevatedPermissionNeeded_Text);};window.OSF.DDA.OutlookAppOm._throwOnOutOfRange$i=function(n,t,i,r){if(n<t||n>i)throw Error.argumentOutOfRange(r);};window.OSF.DDA.OutlookAppOm._getHtmlBody$p=function(n){var t="";if("htmlBody"in n){window.OSF.DDA.OutlookAppOm._throwOnInvalidHtmlBody$p(n.htmlBody);t=n.htmlBody}return t};window.OSF.DDA.OutlookAppOm._getAttachments$p=function(n){var t=[];if("attachments"in n){t=n.attachments;window.OSF.DDA.OutlookAppOm._throwOnInvalidAttachmentsArray$p(t)}return t};window.OSF.DDA.OutlookAppOm._getOptionsAndCallback$p=function(n){var t=[];"options"in n&&(t[0]=n.options);"callback"in n&&(t[t.length]=n.callback);return t};window.OSF.DDA.OutlookAppOm._createAttachmentsDataForHost$p=function(n){var r=new Array(0);if(Array.isInstanceOfType(n))for(var t=0;t<n.length;t++)if(Object.isInstanceOfType(n[t])){var i=n[t];window.OSF.DDA.OutlookAppOm._throwOnInvalidAttachment$p(i);r[t]=window.OSF.DDA.OutlookAppOm._createAttachmentData$p(i)}else throw Error.argument("attachments");return r};window.OSF.DDA.OutlookAppOm._throwOnInvalidHtmlBody$p=function(n){if(!String.isInstanceOfType(n))throw Error.argument("htmlBody");if($h.ScriptHelpers.isNullOrUndefined(n))throw Error.argument("htmlBody");window.OSF.DDA.OutlookAppOm._throwOnOutOfRange$i(n.length,0,window.OSF.DDA.OutlookAppOm.maxBodyLength,"htmlBody")};window.OSF.DDA.OutlookAppOm._throwOnInvalidAttachmentsArray$p=function(n){if(!Array.isInstanceOfType(n))throw Error.argument("attachments");};window.OSF.DDA.OutlookAppOm._throwOnInvalidAttachment$p=function(n){if(!Object.isInstanceOfType(n))throw Error.argument("attachments");if(!("type"in n)||!("name"in n))throw Error.argument("attachments");if(!("url"in n||"itemId"in n))throw Error.argument("attachments");};window.OSF.DDA.OutlookAppOm._createAttachmentData$p=function(n){var i=null;if(n.type==="file"){var u=n.url;var t=n.name;window.OSF.DDA.OutlookAppOm._throwOnInvalidAttachmentUrlOrName$p(u,t);i=window.OSF.DDA.OutlookAppOm._createFileAttachmentData$p(u,t)}else if(n.type==="item"){var r=window.OSF.DDA.OutlookAppOm.getItemIdBasedOnHost(n.itemId);var t=n.name;window.OSF.DDA.OutlookAppOm._throwOnInvalidAttachmentItemIdOrName$p(r,t);i=window.OSF.DDA.OutlookAppOm._createItemAttachmentData$p(r,t)}else throw Error.argument("attachments");return i};window.OSF.DDA.OutlookAppOm._createFileAttachmentData$p=function(n,t){return["file",t,n]};window.OSF.DDA.OutlookAppOm._createItemAttachmentData$p=function(n,t){return["item",t,n]};window.OSF.DDA.OutlookAppOm._throwOnInvalidAttachmentUrlOrName$p=function(n,t){if(!String.isInstanceOfType(n)||!String.isInstanceOfType(t))throw Error.argument("attachments");if(n.length>2048)throw Error.argumentOutOfRange("attachments",n.length,window._u.ExtensibilityStrings.l_AttachmentUrlTooLong_Text);window.OSF.DDA.OutlookAppOm._throwOnInvalidAttachmentName$p(t)};window.OSF.DDA.OutlookAppOm._throwOnInvalidAttachmentItemIdOrName$p=function(n,t){if(!String.isInstanceOfType(n)||!String.isInstanceOfType(t))throw Error.argument("attachments");if(n.length>200)throw Error.argumentOutOfRange("attachments",n.length,window._u.ExtensibilityStrings.l_AttachmentItemIdTooLong_Text);window.OSF.DDA.OutlookAppOm._throwOnInvalidAttachmentName$p(t)};window.OSF.DDA.OutlookAppOm._throwOnInvalidAttachmentName$p=function(n){if(n.length>255)throw Error.argumentOutOfRange("attachments",n.length,window._u.ExtensibilityStrings.l_AttachmentNameTooLong_Text);};window.OSF.DDA.OutlookAppOm._throwOnInvalidRestVersion$p=function(n){if(!n)throw Error.argumentNull("restVersion");if(n!==window.Microsoft.Office.WebExtension.MailboxEnums.RestVersion.v1_0&&n!==window.Microsoft.Office.WebExtension.MailboxEnums.RestVersion.v2_0&&n!==window.Microsoft.Office.WebExtension.MailboxEnums.RestVersion.Beta)throw Error.argument("restVersion");};window.OSF.DDA.OutlookAppOm.getItemIdBasedOnHost=function(n){return window.OSF.DDA.OutlookAppOm._instance$p._initialData$p$0&&window.OSF.DDA.OutlookAppOm._instance$p._initialData$p$0.get__isRestIdSupported$i$0()?window.OSF.DDA.OutlookAppOm._instance$p.convertToRestId(n,window.Microsoft.Office.WebExtension.MailboxEnums.RestVersion.v1_0):window.OSF.DDA.OutlookAppOm._instance$p.convertToEwsId(n,window.Microsoft.Office.WebExtension.MailboxEnums.RestVersion.v1_0)};window.OSF.DDA.OutlookAppOm._throwOnArgumentType$p=function(n,t,i){if(Object.getType(n)!==t)throw Error.argumentType(i);};window.OSF.DDA.OutlookAppOm._validateOptionalStringParameter$p=function(n,t,i,r){if(!$h.ScriptHelpers.isNullOrUndefined(n)){window.OSF.DDA.OutlookAppOm._throwOnArgumentType$p(n,String,r);var u=n;window.OSF.DDA.OutlookAppOm._throwOnOutOfRange$i(u.length,t,i,r)}};window.OSF.DDA.OutlookAppOm._convertToOutlookParameters$p=function(n,t){var i=null;switch(n){case 1:case 2:case 12:case 3:case 14:case 18:case 26:case 32:case 41:case 34:break;case 4:var r=window.JSON.stringify(t.customProperties);i=[r];break;case 5:i=[t.body];break;case 8:case 9:i=[t.itemId];break;case 7:i=[window.OSF.DDA.OutlookAppOm._convertRecipientArrayParameterForOutlookForDisplayApi$p(t.requiredAttendees),window.OSF.DDA.OutlookAppOm._convertRecipientArrayParameterForOutlookForDisplayApi$p(t.optionalAttendees),t.start,t.end,t.location,window.OSF.DDA.OutlookAppOm._convertRecipientArrayParameterForOutlookForDisplayApi$p(t.resources),t.subject,t.body];break;case 44:i=[window.OSF.DDA.OutlookAppOm._convertRecipientArrayParameterForOutlookForDisplayApi$p(t.toRecipients),window.OSF.DDA.OutlookAppOm._convertRecipientArrayParameterForOutlookForDisplayApi$p(t.ccRecipients),window.OSF.DDA.OutlookAppOm._convertRecipientArrayParameterForOutlookForDisplayApi$p(t.bccRecipients),t.subject,t.htmlBody,t.attachments];break;case 43:i=[t.ewsIdOrEmail];break;case 40:i=[t.extensionId,t.consentState];break;case 11:case 10:i=[t.htmlBody];break;case 31:case 30:i=[t.htmlBody,t.attachments];break;case 23:case 13:case 38:case 29:i=[t.data,t.coercionType];break;case 37:case 28:i=[t.coercionType];break;case 17:i=[t.subject];break;case 15:i=[t.recipientField];break;case 22:case 21:i=[t.recipientField,window.OSF.DDA.OutlookAppOm._convertComposeEmailDictionaryParameterForSetApi$p(t.recipientArray)];break;case 19:i=[t.itemId,t.name];break;case 16:i=[t.uri,t.name];break;case 20:i=[t.attachmentIndex];break;case 25:i=[t.TimeProperty,t.time];break;case 24:i=[t.TimeProperty];break;case 27:i=[t.location];break;case 33:case 35:i=[t.key,t.type,t.persistent,t.message,t.icon];break;case 36:i=[t.key];break;default:break}return i};window.OSF.DDA.OutlookAppOm._convertRecipientArrayParameterForOutlookForDisplayApi$p=function(n){return n?n.join(";"):null};window.OSF.DDA.OutlookAppOm._convertComposeEmailDictionaryParameterForSetApi$p=function(n){if(!n)return null;for(var i=new Array(n.length),t=0;t<n.length;t++)i[t]=[n[t].address,n[t].name];return i};window.OSF.DDA.OutlookAppOm._validateAndNormalizeRecipientEmails$p=function(n,t){if($h.ScriptHelpers.isNullOrUndefined(n))return null;window.OSF.DDA.OutlookAppOm._throwOnArgumentType$p(n,Array,t);var r=n;var u=null;var f=!1;window.OSF.DDA.OutlookAppOm._throwOnOutOfRange$i(r.length,0,window.OSF.DDA.OutlookAppOm._maxRecipients$p,String.format("{0}.length",t));for(var i=0;i<r.length;i++)if($h.EmailAddressDetails.isInstanceOfType(r[i])){f=!0;break}f&&(u=[]);for(var i=0;i<r.length;i++)if(f){u[i]=$h.EmailAddressDetails.isInstanceOfType(r[i])?r[i].emailAddress:r[i];window.OSF.DDA.OutlookAppOm._throwOnArgumentType$p(u[i],String,String.format("{0}[{1}]",t,i))}else window.OSF.DDA.OutlookAppOm._throwOnArgumentType$p(r[i],String,String.format("{0}[{1}]",t,i));return u};OSF.DDA.OutlookAppOm.prototype={_initialData$p$0:null,_item$p$0:null,_userProfile$p$0:null,_diagnostics$p$0:null,_officeAppContext$p$0:null,_appReadyCallback$p$0:null,_clientEndPoint$p$0:null,get_clientEndPoint:function(){this._clientEndPoint$p$0||(this._clientEndPoint$p$0=window.OSF._OfficeAppFactory.getClientEndPoint());return this._clientEndPoint$p$0},set_clientEndPoint:function(n){this._clientEndPoint$p$0=n;return n},get_initialData:function(){return this._initialData$p$0},get__appName$i$0:function(){return this._officeAppContext$p$0.get_appName()},initialize:function(n){var t="itemType";this._initialData$p$0=new $h.InitialData(n);1===n[t]?this._item$p$0=new $h.Message(this._initialData$p$0):3===n[t]?this._item$p$0=new $h.MeetingRequest(this._initialData$p$0):2===n[t]?this._item$p$0=new $h.Appointment(this._initialData$p$0):4===n[t]?this._item$p$0=new $h.MessageCompose(this._initialData$p$0):5===n[t]&&(this._item$p$0=new $h.AppointmentCompose(this._initialData$p$0));this._userProfile$p$0=new $h.UserProfile(this._initialData$p$0);this._diagnostics$p$0=new $h.Diagnostics(this._initialData$p$0,this._officeAppContext$p$0.get_appName());this._initializeMethods$p$0();$h.InitialData._defineReadOnlyProperty$i(this,"item",this.$$d__getItem$p$0);$h.InitialData._defineReadOnlyProperty$i(this,"userProfile",this.$$d__getUserProfile$p$0);$h.InitialData._defineReadOnlyProperty$i(this,"diagnostics",this.$$d__getDiagnostics$p$0);$h.InitialData._defineReadOnlyProperty$i(this,"ewsUrl",this.$$d__getEwsUrl$p$0);window.OSF.DDA.OutlookAppOm._instance$p.get__appName$i$0()===64&&this._initialData$p$0.get__overrideWindowOpen$i$0()&&(window.open=this.$$d_windowOpenOverrideHandler)},windowOpenOverrideHandler:function(n,t,i,r){this.invokeHostMethod(403,{launchUrl:n},null)},makeEwsRequestAsync:function(n){for(var r=[],i=1;i<arguments.length;++i)r[i-1]=arguments[i];if($h.ScriptHelpers.isNullOrUndefined(n))throw Error.argumentNull("data");if(n.length>window.OSF.DDA.OutlookAppOm._maxEwsRequestSize$p)throw Error.argument("data",window._u.ExtensibilityStrings.l_EwsRequestOversized_Text);this._throwOnMethodCallForInsufficientPermission$i$0(3,"makeEwsRequestAsync");var u=$h.CommonParameters.parse(r,!0,!0);var t=new $h.EwsRequest(u._asyncContext$p$0);var f=this;t.onreadystatechange=function(){4===t.get__requestState$i$1()&&u._callback$p$0(t._asyncResult$p$0)};t.send(n)},recordDataPoint:function(n){if($h.ScriptHelpers.isNullOrUndefined(n))throw Error.argumentNull("data");this.invokeHostMethod(402,n,null)},recordTrace:function(n){if($h.ScriptHelpers.isNullOrUndefined(n))throw Error.argumentNull("data");this.invokeHostMethod(401,n,null)},trackCtq:function(n){if($h.ScriptHelpers.isNullOrUndefined(n))throw Error.argumentNull("data");this.invokeHostMethod(400,n,null)},convertToLocalClientTime:function(n){var t=new Date(n.getTime());var i=t.getTimezoneOffset()*-1;if(this._initialData$p$0&&this._initialData$p$0.get__timeZoneOffsets$i$0()){t.setUTCMinutes(t.getUTCMinutes()-i);i=this._findOffset$p$0(t);t.setUTCMinutes(t.getUTCMinutes()+i)}var r=this._dateToDictionary$i$0(t);r.timezoneOffset=i;return r},convertToUtcClientTime:function(n){var t=this._dictionaryToDate$i$0(n);if(this._initialData$p$0&&this._initialData$p$0.get__timeZoneOffsets$i$0()){var i=this._findOffset$p$0(t);t.setUTCMinutes(t.getUTCMinutes()-i);i=n.timezoneOffset?n.timezoneOffset:t.getTimezoneOffset()*-1;t.setUTCMinutes(t.getUTCMinutes()+i)}return t},convertToRestId:function(n,t){if(!n)throw Error.argumentNull("itemId");window.OSF.DDA.OutlookAppOm._throwOnInvalidRestVersion$p(t);return n.replace(new RegExp("[/]","g"),"-").replace(new RegExp("[+]","g"),"_")},convertToEwsId:function(n,t){if(!n)throw Error.argumentNull("itemId");window.OSF.DDA.OutlookAppOm._throwOnInvalidRestVersion$p(t);return n.replace(new RegExp("[-]","g"),"/").replace(new RegExp("[_]","g"),"+")},getUserIdentityTokenAsync:function(){for(var i=[],n=0;n<arguments.length;++n)i[n]=arguments[n];this._throwOnMethodCallForInsufficientPermission$i$0(1,"getUserIdentityTokenAsync");var t=$h.CommonParameters.parse(i,!0,!0);this._invokeGetTokenMethodAsync$p$0(2,"GetUserIdentityToken",t._callback$p$0,t._asyncContext$p$0)},getCallbackTokenAsync:function(){for(var i=[],n=0;n<arguments.length;++n)i[n]=arguments[n];this._throwOnMethodCallForInsufficientPermission$i$0(1,"getCallbackTokenAsync");var t=$h.CommonParameters.parse(i,!0,!0);this._invokeGetTokenMethodAsync$p$0(12,"GetCallbackToken",t._callback$p$0,t._asyncContext$p$0)},displayMessageForm:function(n){if($h.ScriptHelpers.isNullOrUndefined(n))throw Error.argumentNull("itemId");this.invokeHostMethod(8,{itemId:window.OSF.DDA.OutlookAppOm.getItemIdBasedOnHost(n)},null)},displayAppointmentForm:function(n){if($h.ScriptHelpers.isNullOrUndefined(n))throw Error.argumentNull("itemId");this.invokeHostMethod(9,{itemId:window.OSF.DDA.OutlookAppOm.getItemIdBasedOnHost(n)},null)},RegisterConsentAsync:function(n){if(n!==2&&n!==1&&n)throw Error.argumentOutOfRange("consentState");var t={};t.consentState=n.toString();t.extensionId=this.GetExtensionId();this.invokeHostMethod(40,t,null)},CloseApp:function(){this.invokeHostMethod(42,null,null)},GetIsRead:function(){return this._initialData$p$0.get__isRead$i$0()},GetEndNodeUrl:function(){return this._initialData$p$0.get__endNodeUrl$i$0()},GetConsentMetadata:function(){return this._initialData$p$0.get__consentMetadata$i$0()},GetEntryPointUrl:function(){return this._initialData$p$0.get__entryPointUrl$i$0()},GetMarketplaceContentMarket:function(){return this._initialData$p$0.get__marketplaceContentMarket$i$0()},GetMarketplaceAssetId:function(){return this._initialData$p$0.get__marketplaceAssetId$i$0()},GetExtensionId:function(){return this._initialData$p$0.get__extensionId$i$0()},createAsyncResult:function(n,t,i,r,u){var e={};var f=null;e[window.OSF.DDA.AsyncResultEnum.Properties.Value]=n;e[window.OSF.DDA.AsyncResultEnum.Properties.Context]=r;if(0!==t){f={};var o=$h.OutlookErrorManager.getErrorArgs(i);f[window.OSF.DDA.AsyncResultEnum.ErrorProperties.Name]=o.name;f[window.OSF.DDA.AsyncResultEnum.ErrorProperties.Message]=u?u:o.message;f[window.OSF.DDA.AsyncResultEnum.ErrorProperties.Code]=i}return new window.OSF.DDA.AsyncResult(e,f)},_throwOnMethodCallForInsufficientPermission$i$0:function(n,t){if(this._initialData$p$0._permissionLevel$p$0<n)throw Error.create(String.format(window._u.ExtensibilityStrings.l_ElevatedPermissionNeededForMethod_Text,t));},_displayReplyForm$i$0:function(n){this._displayReplyFormHelper$p$0(n,!1)},_displayReplyAllForm$i$0:function(n){this._displayReplyFormHelper$p$0(n,!0)},_displayReplyFormHelper$p$0:function(n,t){if(String.isInstanceOfType(n))this._doDisplayReplyForm$p$0(n,t);else if(Object.isInstanceOfType(n)&&Object.getTypeName(n)==="Object")this._doDisplayReplyFormWithAttachments$p$0(n,t);else throw Error.argumentType();},_doDisplayReplyForm$p$0:function(n,t){$h.ScriptHelpers.isNullOrUndefined(n)||window.OSF.DDA.OutlookAppOm._throwOnOutOfRange$i(n.length,0,window.OSF.DDA.OutlookAppOm.maxBodyLength,"htmlBody");this.invokeHostMethod(t?11:10,{htmlBody:n},null)},_doDisplayReplyFormWithAttachments$p$0:function(n,t){var u=window.OSF.DDA.OutlookAppOm._getHtmlBody$p(n);var r=window.OSF.DDA.OutlookAppOm._getAttachments$p(n);var i=$h.CommonParameters.parse(window.OSF.DDA.OutlookAppOm._getOptionsAndCallback$p(n),!1);var f=this;this._standardInvokeHostMethod$i$0(t?31:30,{htmlBody:u,attachments:window.OSF.DDA.OutlookAppOm._createAttachmentsDataForHost$p(r)},function(n){return n},i._asyncContext$p$0,i._callback$p$0)},_standardInvokeHostMethod$i$0:function(n,t,i,r,u){var f=this;this.invokeHostMethod(n,t,function(n,t){if(u){var o=null;if(Object.isInstanceOfType(t)){var e=t;if("error"in e||"data"in e||"errorCode"in e)if(e.error){var s=e.errorCode;o=f.createAsyncResult(null,1,s,r,null)}else{var h=i?i(e.data):e.data;o=f.createAsyncResult(h,0,0,r,null)}}!o&&n&&(o=f.createAsyncResult(null,1,9002,r,null));u(o)}})},invokeHostMethod:function(n,t,i){if(64===this._officeAppContext$p$0.get_appName()){var r={ApiParams:t};r.MethodData={ControlId:window.OSF._OfficeAppFactory.getId(),DispatchId:n};n===1?this.get_clientEndPoint().invoke("GetInitialData",i,r):this.get_clientEndPoint().invoke("ExecuteMethod",i,r)}else if(this._isOwaOnlyMethod$p$0(n))i&&i(-2,null);else{var u=window.OSF.DDA.OutlookAppOm._convertToOutlookParameters$p(n,t);var f=this;window.OSF.ClientHostController.execute(n,u,function(n,t){if(i){var f=n.toArray();var u=window.JSON.parse(f[0]);if(Object.isInstanceOfType(u)){var r=u;if(f.length>1&&f[1]){r.error=!0;r.errorCode=f[1]}else r.error=!1;i(t,r)}else if(Number.isInstanceOfType(u)){var e={};e.error=!0;e.errorCode=u;i(t,e)}else throw Error.notImplemented("Return data type from host must be Dictionary or int");}})}},_dictionaryToDate$i$0:function(n){var t=new Date(n.year,n.month,n.date,n.hours,n.minutes,n.seconds,n.milliseconds?n.milliseconds:0);if(window.isNaN(t.getTime()))throw Error.format(window._u.ExtensibilityStrings.l_InvalidDate_Text);return t},_dateToDictionary$i$0:function(n){var t={};t.month=n.getMonth();t.date=n.getDate();t.year=n.getFullYear();t.hours=n.getHours();t.minutes=n.getMinutes();t.seconds=n.getSeconds();t.milliseconds=n.getMilliseconds();return t},_isOwaOnlyMethod$p$0:function(n){switch(n){case 402:case 401:case 400:case 403:return!0;default:return!1}},_displayNewAppointmentFormApi$p$0:function(n){var u=window.OSF.DDA.OutlookAppOm._validateAndNormalizeRecipientEmails$p(n.requiredAttendees,"requiredAttendees");var r=window.OSF.DDA.OutlookAppOm._validateAndNormalizeRecipientEmails$p(n.optionalAttendees,"optionalAttendees");window.OSF.DDA.OutlookAppOm._validateOptionalStringParameter$p(n.location,0,window.OSF.DDA.OutlookAppOm._maxLocationLength$p,"location");window.OSF.DDA.OutlookAppOm._validateOptionalStringParameter$p(n.body,0,window.OSF.DDA.OutlookAppOm.maxBodyLength,"body");window.OSF.DDA.OutlookAppOm._validateOptionalStringParameter$p(n.subject,0,window.OSF.DDA.OutlookAppOm._maxSubjectLength$p,"subject");if(!$h.ScriptHelpers.isNullOrUndefined(n.start)){window.OSF.DDA.OutlookAppOm._throwOnArgumentType$p(n.start,Date,"start");var o=n.start;n.start=o.getTime();if(!$h.ScriptHelpers.isNullOrUndefined(n.end)){window.OSF.DDA.OutlookAppOm._throwOnArgumentType$p(n.end,Date,"end");var i=n.end;if(i<o)throw Error.argumentOutOfRange("end",i,window._u.ExtensibilityStrings.l_InvalidEventDates_Text);n.end=i.getTime()}}var t=null;if(u||r){t={};var s=n;for(var f in s){var e={key:f,value:s[f]};t[e.key]=e.value}u&&(t.requiredAttendees=u);r&&(t.optionalAttendees=r)}this.invokeHostMethod(7,t||n,null)},displayNewMessageFormApi:function(n){var t={};if(n){var e=window.OSF.DDA.OutlookAppOm._validateAndNormalizeRecipientEmails$p(n.toRecipients,"toRecipients");var o=window.OSF.DDA.OutlookAppOm._validateAndNormalizeRecipientEmails$p(n.ccRecipients,"ccRecipients");var s=window.OSF.DDA.OutlookAppOm._validateAndNormalizeRecipientEmails$p(n.bccRecipients,"bccRecipients");window.OSF.DDA.OutlookAppOm._validateOptionalStringParameter$p(n.htmlBody,0,window.OSF.DDA.OutlookAppOm.maxBodyLength,"htmlBody");window.OSF.DDA.OutlookAppOm._validateOptionalStringParameter$p(n.subject,0,window.OSF.DDA.OutlookAppOm._maxSubjectLength$p,"subject");var f=window.OSF.DDA.OutlookAppOm._getAttachments$p(n);var i=n;for(var r in i){var u={key:r,value:i[r]};t[u.key]=u.value}e&&(t.toRecipients=e);o&&(t.ccRecipients=o);s&&(t.bccRecipients=s);f&&(t.attachments=window.OSF.DDA.OutlookAppOm._createAttachmentsDataForHost$p(f))}this.invokeHostMethod(44,t||n,null)},displayContactCardAsync:function(n,t){if($h.ScriptHelpers.isNullOrUndefined(n))throw Error.argumentNull("ewsIdOrEmail");var u=null;var r=null;if(t){var i=$h.CommonParameters.parse([t],!1);u=i._asyncContext$p$0;r=i._callback$p$0}this._standardInvokeHostMethod$i$0(43,{ewsIdOrEmail:n.trim()},null,u,r)},_initializeMethods$p$0:function(){var n=this;if($h.Item.isInstanceOfType(this._item$p$0)){n.displayNewAppointmentForm=this.$$d__displayNewAppointmentFormApi$p$0;n.displayNewMessageForm=this.$$d_displayNewMessageFormApi;n.displayContactCardAsync=this.$$d_displayContactCardAsync}},_getInitialDataResponseHandler$p$0:function(n,t){if(!n){this.initialize(t);this.displayName="mailbox";window.setTimeout(this.$$d__callAppReadyCallback$p$0,0)}},_callAppReadyCallback$p$0:function(){this._appReadyCallback$p$0()},_invokeGetTokenMethodAsync$p$0:function(n,t,i,r){if($h.ScriptHelpers.isNullOrUndefined(i))throw Error.argumentNull("callback");var u=this;this.invokeHostMethod(n,null,function(n,t){var e;if(n)e=u.createAsyncResult(null,1,9017,r,String.format(window._u.ExtensibilityStrings.l_InternalProtocolError_Text,n));else{var f=t;e=f.wasSuccessful?u.createAsyncResult(f.token,0,0,r,null):u.createAsyncResult(null,1,f.errorCode,r,f.errorMessage)}i(e)})},_getItem$p$0:function(){return this._item$p$0},_getUserProfile$p$0:function(){window.OSF.DDA.OutlookAppOm._throwOnPropertyAccessForRestrictedPermission$i(this._initialData$p$0._permissionLevel$p$0);return this._userProfile$p$0},_getDiagnostics$p$0:function(){return this._diagnostics$p$0},_getEwsUrl$p$0:function(){window.OSF.DDA.OutlookAppOm._throwOnPropertyAccessForRestrictedPermission$i(this._initialData$p$0._permissionLevel$p$0);return this._initialData$p$0.get__ewsUrl$i$0()},_findOffset$p$0:function(n){for(var r=this._initialData$p$0.get__timeZoneOffsets$i$0(),i=0;i<r.length;i++){var t=r[i];var f=window.parseInt(t.start);var u=window.parseInt(t.end);if(n.getTime()-f>=0&&n.getTime()-u<0)return window.parseInt(t.offset)}throw Error.format(window._u.ExtensibilityStrings.l_InvalidDate_Text);},_areStringsLoaded$p$0:function(){var n=!1;try{n=!$h.ScriptHelpers.isNullOrUndefined(window._u.ExtensibilityStrings.l_EwsRequestOversized_Text)}catch(t){}return n},_loadLocalizedScript$p$0:function(n){for(var s=null,l="",a=document.getElementsByTagName("script"),o=a.length-1;o>=0;o--){var i=null;var v=a[o].attributes;if(v){var p=v.getNamedItem("src");p&&(i=p.value);if(i){var y=!1;i=i.toLowerCase();var f=i.indexOf("office_strings.js");if(f<0){f=i.indexOf("office_strings.debug.js");y=!0}if(f>0&&f<i.length){s=i.replace(y?"office_strings.debug.js":"office_strings.js","outlook_strings.js");var r=i.substring(0,f);var u=r.lastIndexOf("/",r.length-2);u===-1&&(u=r.lastIndexOf("\\",r.length-2));u!==-1&&r.length>u+1&&(l=r.substring(0,u+1));break}}}}if(s){var h=document.getElementsByTagName("head")[0];var t=null;var b=this;var e=function(){if(n&&(!t.readyState||t.readyState&&(t.readyState==="loaded"||t.readyState==="complete"))){t.onload=null;t.onreadystatechange=null;n()}};var c=this;var w=function(){if(!c._areStringsLoaded$p$0()){var n=l+"en-us/"+"outlook_strings.js";t.onload=null;t.onreadystatechange=null;t=c._createScriptElement$p$0(n);t.onload=e;t.onreadystatechange=e;h.appendChild(t)}};t=this._createScriptElement$p$0(s);t.onload=e;t.onreadystatechange=e;window.setTimeout(w,2e3);h.appendChild(t)}},_createScriptElement$p$0:function(n){var t=document.createElement("script");t.type="text/javascript";t.src=n;return t}};window.OSF.DDA.Settings=OSF.DDA.Settings=function(n){this._rawData$p$0=n};window.OSF.DDA.Settings._convertFromRawSettings$p=function(n){if(!n)return{};if(window.OSF.DDA.OutlookAppOm._instance$p.get__appName$i$0()===8){var t=n.SettingsKey;if(t)return window.OSF.DDA.SettingsManager.deserializeSettings(t)}return n};OSF.DDA.Settings.prototype={_rawData$p$0:null,_settingsData$p$0:null,get__data$p$0:function(){if(!this._settingsData$p$0){this._settingsData$p$0=window.OSF.DDA.Settings._convertFromRawSettings$p(this._rawData$p$0);this._rawData$p$0=null}return this._settingsData$p$0},get:function(n){return this.get__data$p$0()[n]},set:function(n,t){this.get__data$p$0()[n]=t},remove:function(n){delete this.get__data$p$0()[n]},saveAsync:function(){for(var i=[],t=0;t<arguments.length;++t)i[t]=arguments[t];var n=$h.CommonParameters.parse(i,!1);if(window.JSON.stringify(window.OSF.DDA.SettingsManager.serializeSettings(this.get__data$p$0())).length>32768){var r=window.OSF.DDA.OutlookAppOm._instance$p.createAsyncResult(null,1,9019,n._asyncContext$p$0,"");var u=this;window.setTimeout(function(){n._callback$p$0(r)},0);return}window.OSF.DDA.OutlookAppOm._instance$p.get__appName$i$0()===64?this._saveSettingsForOwa$p$0(n._callback$p$0,n._asyncContext$p$0):this._saveSettingsForOutlook$p$0(n._callback$p$0,n._asyncContext$p$0)},_saveSettingsForOutlook$p$0:function(n,t){var r=null;try{var f=window.OSF.DDA.SettingsManager.serializeSettings(this.get__data$p$0());var e=window.JSON.stringify(f);var u={SettingsKey:e};window.OSF.DDA.RichClientSettingsManager.write(u)}catch(o){r=o}if(n){var i;i=r?window.OSF.DDA.OutlookAppOm._instance$p.createAsyncResult(null,1,9019,t,r.message):window.OSF.DDA.OutlookAppOm._instance$p.createAsyncResult(null,0,0,t,null);n(i)}},_saveSettingsForOwa$p$0:function(n,t){var i=window.OSF.DDA.SettingsManager.serializeSettings(this.get__data$p$0());var r=this;window.OSF.DDA.OutlookAppOm._instance$p.invokeHostMethod(404,[i],function(i,r){if(n){var u;if(i)u=window.OSF.DDA.OutlookAppOm._instance$p.createAsyncResult(null,1,9017,t,String.format(window._u.ExtensibilityStrings.l_InternalProtocolError_Text,i));else{var f=r;u=f.error?window.OSF.DDA.OutlookAppOm._instance$p.createAsyncResult(null,1,9019,t,f.errorMessage):window.OSF.DDA.OutlookAppOm._instance$p.createAsyncResult(null,0,0,t,null)}n(u)}})}};Type.registerNamespace("$h");var $h=window.$h||{};Type.registerNamespace("Office.cast");var Office=window.Office||{};Office.cast=Office.cast||{};$h.Appointment=function(n){this.$$d__getOrganizer$p$2=Function.createDelegate(this,this._getOrganizer$p$2);this.$$d__getNormalizedSubject$p$2=Function.createDelegate(this,this._getNormalizedSubject$p$2);this.$$d__getSubject$p$2=Function.createDelegate(this,this._getSubject$p$2);this.$$d__getResources$p$2=Function.createDelegate(this,this._getResources$p$2);this.$$d__getRequiredAttendees$p$2=Function.createDelegate(this,this._getRequiredAttendees$p$2);this.$$d__getOptionalAttendees$p$2=Function.createDelegate(this,this._getOptionalAttendees$p$2);this.$$d__getLocation$p$2=Function.createDelegate(this,this._getLocation$p$2);this.$$d__getEnd$p$2=Function.createDelegate(this,this._getEnd$p$2);this.$$d__getStart$p$2=Function.createDelegate(this,this._getStart$p$2);$h.Appointment.initializeBase(this,[n]);$h.InitialData._defineReadOnlyProperty$i(this,"start",this.$$d__getStart$p$2);$h.InitialData._defineReadOnlyProperty$i(this,"end",this.$$d__getEnd$p$2);$h.InitialData._defineReadOnlyProperty$i(this,"location",this.$$d__getLocation$p$2);$h.InitialData._defineReadOnlyProperty$i(this,"optionalAttendees",this.$$d__getOptionalAttendees$p$2);$h.InitialData._defineReadOnlyProperty$i(this,"requiredAttendees",this.$$d__getRequiredAttendees$p$2);$h.InitialData._defineReadOnlyProperty$i(this,"resources",this.$$d__getResources$p$2);$h.InitialData._defineReadOnlyProperty$i(this,"subject",this.$$d__getSubject$p$2);$h.InitialData._defineReadOnlyProperty$i(this,"normalizedSubject",this.$$d__getNormalizedSubject$p$2);$h.InitialData._defineReadOnlyProperty$i(this,"organizer",this.$$d__getOrganizer$p$2)};$h.Appointment.prototype={getEntities:function(){return this._data$p$0._getEntities$i$0()},getEntitiesByType:function(n){return this._data$p$0._getEntitiesByType$i$0(n)},getRegExMatches:function(){window.OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(1,"getRegExMatches");return this._data$p$0._getRegExMatches$i$0()},getFilteredEntitiesByName:function(n){return this._data$p$0._getFilteredEntitiesByName$i$0(n)},getRegExMatchesByName:function(n){window.OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(1,"getRegExMatchesByName");return this._data$p$0._getRegExMatchesByName$i$0(n)},displayReplyForm:function(n){window.OSF.DDA.OutlookAppOm._instance$p._displayReplyForm$i$0(n)},displayReplyAllForm:function(n){window.OSF.DDA.OutlookAppOm._instance$p._displayReplyAllForm$i$0(n)},getItemType:function(){return window.Microsoft.Office.WebExtension.MailboxEnums.ItemType.Appointment},_getStart$p$2:function(){return this._data$p$0.get__start$i$0()},_getEnd$p$2:function(){return this._data$p$0.get__end$i$0()},_getLocation$p$2:function(){return this._data$p$0.get__location$i$0()},_getOptionalAttendees$p$2:function(){return this._data$p$0.get__cc$i$0()},_getRequiredAttendees$p$2:function(){return this._data$p$0.get__to$i$0()},_getResources$p$2:function(){return this._data$p$0.get__resources$i$0()},_getSubject$p$2:function(){return this._data$p$0.get__subject$i$0()},_getNormalizedSubject$p$2:function(){return this._data$p$0.get__normalizedSubject$i$0()},_getOrganizer$p$2:function(){return this._data$p$0.get__organizer$i$0()}};$h.AppointmentCompose=function(n){this.$$d__getLocation$p$2=Function.createDelegate(this,this._getLocation$p$2);this.$$d__getEnd$p$2=Function.createDelegate(this,this._getEnd$p$2);this.$$d__getStart$p$2=Function.createDelegate(this,this._getStart$p$2);this.$$d__getOptionalAttendees$p$2=Function.createDelegate(this,this._getOptionalAttendees$p$2);this.$$d__getRequiredAttendees$p$2=Function.createDelegate(this,this._getRequiredAttendees$p$2);$h.AppointmentCompose.initializeBase(this,[n]);$h.InitialData._defineReadOnlyProperty$i(this,"requiredAttendees",this.$$d__getRequiredAttendees$p$2);$h.InitialData._defineReadOnlyProperty$i(this,"optionalAttendees",this.$$d__getOptionalAttendees$p$2);$h.InitialData._defineReadOnlyProperty$i(this,"start",this.$$d__getStart$p$2);$h.InitialData._defineReadOnlyProperty$i(this,"end",this.$$d__getEnd$p$2);$h.InitialData._defineReadOnlyProperty$i(this,"location",this.$$d__getLocation$p$2)};$h.AppointmentCompose.prototype={_requiredAttendees$p$2:null,_optionalAttendees$p$2:null,_start$p$2:null,_end$p$2:null,_location$p$2:null,getItemType:function(){return window.Microsoft.Office.WebExtension.MailboxEnums.ItemType.Appointment},_getRequiredAttendees$p$2:function(){this._data$p$0._throwOnRestrictedPermissionLevel$i$0();this._requiredAttendees$p$2||(this._requiredAttendees$p$2=new $h.ComposeRecipient(0,"requiredAttendees"));return this._requiredAttendees$p$2},_getOptionalAttendees$p$2:function(){this._data$p$0._throwOnRestrictedPermissionLevel$i$0();this._optionalAttendees$p$2||(this._optionalAttendees$p$2=new $h.ComposeRecipient(1,"optionalAttendees"));return this._optionalAttendees$p$2},_getStart$p$2:function(){this._data$p$0._throwOnRestrictedPermissionLevel$i$0();this._start$p$2||(this._start$p$2=new $h.ComposeTime(1));return this._start$p$2},_getEnd$p$2:function(){this._data$p$0._throwOnRestrictedPermissionLevel$i$0();this._end$p$2||(this._end$p$2=new $h.ComposeTime(2));return this._end$p$2},_getLocation$p$2:function(){this._data$p$0._throwOnRestrictedPermissionLevel$i$0();this._location$p$2||(this._location$p$2=new $h.ComposeLocation);return this._location$p$2}};$h.AttachmentConstants=function(){};$h.AttachmentDetails=function(n){this.$$d__getIsInline$p$0=Function.createDelegate(this,this._getIsInline$p$0);this.$$d__getAttachmentType$p$0=Function.createDelegate(this,this._getAttachmentType$p$0);this.$$d__getSize$p$0=Function.createDelegate(this,this._getSize$p$0);this.$$d__getContentType$p$0=Function.createDelegate(this,this._getContentType$p$0);this.$$d__getName$p$0=Function.createDelegate(this,this._getName$p$0);this.$$d__getId$p$0=Function.createDelegate(this,this._getId$p$0);this._data$p$0=n;$h.InitialData._defineReadOnlyProperty$i(this,"id",this.$$d__getId$p$0);$h.InitialData._defineReadOnlyProperty$i(this,"name",this.$$d__getName$p$0);$h.InitialData._defineReadOnlyProperty$i(this,"contentType",this.$$d__getContentType$p$0);$h.InitialData._defineReadOnlyProperty$i(this,"size",this.$$d__getSize$p$0);$h.InitialData._defineReadOnlyProperty$i(this,"attachmentType",this.$$d__getAttachmentType$p$0);$h.InitialData._defineReadOnlyProperty$i(this,"isInline",this.$$d__getIsInline$p$0)};$h.AttachmentDetails.prototype={_data$p$0:null,_getId$p$0:function(){return this._data$p$0.id},_getName$p$0:function(){return this._data$p$0.name},_getContentType$p$0:function(){return this._data$p$0.contentType},_getSize$p$0:function(){return this._data$p$0.size},_getAttachmentType$p$0:function(){var n=this._data$p$0.attachmentType;return n<$h.AttachmentDetails._attachmentTypeMap$p.length?$h.AttachmentDetails._attachmentTypeMap$p[n]:window.Microsoft.Office.WebExtension.MailboxEnums.AttachmentType.File},_getIsInline$p$0:function(){return this._data$p$0.isInline}};$h.Body=function(){};$h.Body._tryMapToHostCoercionType$i=function(n,t){t.val=undefined;if(n===window.Microsoft.Office.WebExtension.CoercionType.Html)t.val=3;else if(n===window.Microsoft.Office.WebExtension.CoercionType.Text)t.val=0;else return!1;return!0};$h.Body.prototype={getAsync:function(n){for(var f=[],t=1;t<arguments.length;++t)f[t-1]=arguments[t];window.OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(1,"body.getAsync");var e=$h.CommonParameters.parse(f,!0);var i;var u,r;if(!(r=$h.Body._tryMapToHostCoercionType$i(n,u={val:i}),i=u.val,r))throw Error.argument("coercionType");var o={coercionType:i};window.OSF.DDA.OutlookAppOm._instance$p._standardInvokeHostMethod$i$0(37,o,null,e._asyncContext$p$0,e._callback$p$0)}};$h.ComposeBody=function(){$h.ComposeBody.initializeBase(this)};$h.ComposeBody._createParameterDictionaryToHost$i=function(n,t){var r={data:n};if(t._options$p$0&&!$h.ScriptHelpers.isNull(t._options$p$0.coercionType)){var i;var f,u;if(!(u=$h.Body._tryMapToHostCoercionType$i(t._options$p$0.coercionType,f={val:i}),i=f.val,u)){t._callback$p$0&&t._callback$p$0(window.OSF.DDA.OutlookAppOm._instance$p.createAsyncResult(null,1,1e3,t._asyncContext$p$0,null));return null}r.coercionType=i}else r.coercionType=0;return r};$h.ComposeBody.prototype={getTypeAsync:function(){for(var i=[],n=0;n<arguments.length;++n)i[n]=arguments[n];window.OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(1,"body.getTypeAsync");var t=$h.CommonParameters.parse(i,!0);window.OSF.DDA.OutlookAppOm._instance$p._standardInvokeHostMethod$i$0(14,null,null,t._asyncContext$p$0,t._callback$p$0)},setSelectedDataAsync:function(n){for(var u=[],t=1;t<arguments.length;++t)u[t-1]=arguments[t];window.OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(2,"body.setSelectedDataAsync");var i=$h.CommonParameters.parse(u,!1);if(!String.isInstanceOfType(n))throw Error.argumentType("data",Object.getType(n),String);window.OSF.DDA.OutlookAppOm._throwOnOutOfRange$i(n.length,0,1e6,"data");var r=$h.ComposeBody._createParameterDictionaryToHost$i(n,i);r&&window.OSF.DDA.OutlookAppOm._instance$p._standardInvokeHostMethod$i$0(13,r,null,i._asyncContext$p$0,i._callback$p$0)},prependAsync:function(n){for(var u=[],t=1;t<arguments.length;++t)u[t-1]=arguments[t];window.OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(2,"body.prependAsync");var i=$h.CommonParameters.parse(u,!1);if(!String.isInstanceOfType(n))throw Error.argumentType("data",Object.getType(n),String);window.OSF.DDA.OutlookAppOm._throwOnOutOfRange$i(n.length,0,1e6,"data");var r=$h.ComposeBody._createParameterDictionaryToHost$i(n,i);r&&window.OSF.DDA.OutlookAppOm._instance$p._standardInvokeHostMethod$i$0(23,r,null,i._asyncContext$p$0,i._callback$p$0)},setAsync:function(n){for(var u=[],t=1;t<arguments.length;++t)u[t-1]=arguments[t];window.OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(2,"body.setAsync");var i=$h.CommonParameters.parse(u,!1);if(!String.isInstanceOfType(n))throw Error.argumentType("data",Object.getType(n),String);window.OSF.DDA.OutlookAppOm._throwOnOutOfRange$i(n.length,0,1e6,"data");var r=$h.ComposeBody._createParameterDictionaryToHost$i(n,i);r&&window.OSF.DDA.OutlookAppOm._instance$p._standardInvokeHostMethod$i$0(38,r,null,i._asyncContext$p$0,i._callback$p$0)}};$h.ComposeItem=function(n){this.$$d__getBody$p$1=Function.createDelegate(this,this._getBody$p$1);this.$$d__getSubject$p$1=Function.createDelegate(this,this._getSubject$p$1);$h.ComposeItem.initializeBase(this,[n]);$h.InitialData._defineReadOnlyProperty$i(this,"subject",this.$$d__getSubject$p$1);$h.InitialData._defineReadOnlyProperty$i(this,"body",this.$$d__getBody$p$1)};$h.ComposeItem.prototype={_subject$p$1:null,_body$p$1:null,addFileAttachmentAsync:function(n,t){for(var u=[],i=2;i<arguments.length;++i)u[i-2]=arguments[i];window.OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(2,"addFileAttachmentAsync");if(!$h.ScriptHelpers.isNonEmptyString(n))throw Error.argument("uri");if(!$h.ScriptHelpers.isNonEmptyString(t))throw Error.argument("attachmentName");window.OSF.DDA.OutlookAppOm._throwOnOutOfRange$i(n.length,0,2048,"uri");window.OSF.DDA.OutlookAppOm._throwOnOutOfRange$i(t.length,0,255,"attachmentName");var r=$h.CommonParameters.parse(u,!1);var f={uri:n,name:t,__timeout__:6e5};window.OSF.DDA.OutlookAppOm._instance$p._standardInvokeHostMethod$i$0(16,f,null,r._asyncContext$p$0,r._callback$p$0)},addItemAttachmentAsync:function(n,t){for(var u=[],i=2;i<arguments.length;++i)u[i-2]=arguments[i];window.OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(2,"addItemAttachmentAsync");if(!$h.ScriptHelpers.isNonEmptyString(n))throw Error.argument("itemId");if(!$h.ScriptHelpers.isNonEmptyString(t))throw Error.argument("attachmentName");window.OSF.DDA.OutlookAppOm._throwOnOutOfRange$i(n.length,0,200,"itemId");window.OSF.DDA.OutlookAppOm._throwOnOutOfRange$i(t.length,0,255,"attachmentName");var r=$h.CommonParameters.parse(u,!1);var f={itemId:window.OSF.DDA.OutlookAppOm.getItemIdBasedOnHost(n),name:t,__timeout__:6e5};window.OSF.DDA.OutlookAppOm._instance$p._standardInvokeHostMethod$i$0(19,f,null,r._asyncContext$p$0,r._callback$p$0)},removeAttachmentAsync:function(n){for(var r=[],t=1;t<arguments.length;++t)r[t-1]=arguments[t];window.OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(2,"removeAttachmentAsync");if(!$h.ScriptHelpers.isNonEmptyString(n))throw Error.argument("attachmentId");window.OSF.DDA.OutlookAppOm._throwOnOutOfRange$i(n.length,0,200,"attachmentId");var i=$h.CommonParameters.parse(r,!1);window.OSF.DDA.OutlookAppOm._instance$p._standardInvokeHostMethod$i$0(20,{attachmentIndex:n},null,i._asyncContext$p$0,i._callback$p$0)},getSelectedDataAsync:function(n){for(var f=[],t=1;t<arguments.length;++t)f[t-1]=arguments[t];window.OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(1,"getSelectedDataAsync");var e=$h.CommonParameters.parse(f,!0);var i;var u,r;if(n!==window.Microsoft.Office.WebExtension.CoercionType.Html&&n!==window.Microsoft.Office.WebExtension.CoercionType.Text||!(r=$h.Body._tryMapToHostCoercionType$i(n,u={val:i}),i=u.val,r))throw Error.argument("coercionType");var o={coercionType:i};window.OSF.DDA.OutlookAppOm._instance$p._standardInvokeHostMethod$i$0(28,o,null,e._asyncContext$p$0,e._callback$p$0)},setSelectedDataAsync:function(n){for(var u=[],t=1;t<arguments.length;++t)u[t-1]=arguments[t];window.OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(2,"setSelectedDataAsync");var i=$h.CommonParameters.parse(u,!1);if(!String.isInstanceOfType(n))throw Error.argumentType("data",Object.getType(n),String);window.OSF.DDA.OutlookAppOm._throwOnOutOfRange$i(n.length,0,1e6,"data");var r=$h.ComposeBody._createParameterDictionaryToHost$i(n,i);r&&window.OSF.DDA.OutlookAppOm._instance$p._standardInvokeHostMethod$i$0(29,r,null,i._asyncContext$p$0,i._callback$p$0)},close:function(){window.OSF.DDA.OutlookAppOm._instance$p._standardInvokeHostMethod$i$0(41,null,null,null,null)},_getBody$p$1:function(){this._data$p$0._throwOnRestrictedPermissionLevel$i$0();this._body$p$1||(this._body$p$1=new $h.ComposeBody);return this._body$p$1},_getSubject$p$1:function(){this._data$p$0._throwOnRestrictedPermissionLevel$i$0();this._subject$p$1||(this._subject$p$1=new $h.ComposeSubject);return this._subject$p$1},saveAsync:function(){for(var i=[],n=0;n<arguments.length;++n)i[n]=arguments[n];window.OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(2,"saveAsync");var t=$h.CommonParameters.parse(i,!1);window.OSF.DDA.OutlookAppOm._instance$p._standardInvokeHostMethod$i$0(32,null,null,t._asyncContext$p$0,t._callback$p$0)}};$h.ComposeRecipient=function(n,t){this._type$p$0=n;this._propertyName$p$0=t};$h.ComposeRecipient._throwOnInvalidDisplayNameOrEmail$p=function(n,t){if(!n&&!t)throw Error.argument("recipients");if(n&&n.length>255)throw Error.argumentOutOfRange("recipients",n.length,window._u.ExtensibilityStrings.l_DisplayNameTooLong_Text);if(t&&t.length>571)throw Error.argumentOutOfRange("recipients",t.length,window._u.ExtensibilityStrings.l_EmailAddressTooLong_Text);};$h.ComposeRecipient._getAsyncFormatter$p=function(n){for(var r=n,i=[],t=0;t<r.length;t++){var u=new $h.EmailAddressDetails(r[t]);i[t]=u}return i};$h.ComposeRecipient._createEmailDictionaryForHost$p=function(n,t){return{address:n,name:t}};$h.ComposeRecipient.prototype={_propertyName$p$0:null,_type$p$0:0,getAsync:function(){for(var i=[],n=0;n<arguments.length;++n)i[n]=arguments[n];var t=$h.CommonParameters.parse(i,!0);window.OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(1,this._propertyName$p$0+".getAsync");window.OSF.DDA.OutlookAppOm._instance$p._standardInvokeHostMethod$i$0(15,{recipientField:this._type$p$0},$h.ComposeRecipient._getAsyncFormatter$p,t._asyncContext$p$0,t._callback$p$0)},setAsync:function(n){for(var i=[],t=1;t<arguments.length;++t)i[t-1]=arguments[t];window.OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(2,this._propertyName$p$0+".setAsync");this.setAddHelper(n,i,!0)},addAsync:function(n){for(var i=[],t=1;t<arguments.length;++t)i[t-1]=arguments[t];window.OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(2,this._propertyName$p$0+".addAsync");this.setAddHelper(n,i,!1)},setAddHelper:function(n,t,i){window.OSF.DDA.OutlookAppOm._throwOnOutOfRange$i(n.length,0,100,"recipients");var s=$h.CommonParameters.parse(t,!1);var f=[];if(Array.isInstanceOfType(n))for(var r=0;r<n.length;r++)if(String.isInstanceOfType(n[r])){$h.ComposeRecipient._throwOnInvalidDisplayNameOrEmail$p(n[r],n[r]);f[r]=$h.ComposeRecipient._createEmailDictionaryForHost$p(n[r],n[r])}else if($h.EmailAddressDetails.isInstanceOfType(n[r])){var u=n[r];$h.ComposeRecipient._throwOnInvalidDisplayNameOrEmail$p(u.displayName,u.emailAddress);f[r]=$h.ComposeRecipient._createEmailDictionaryForHost$p(u.emailAddress,u.displayName)}else if(Object.isInstanceOfType(n[r])){var h=n[r];var e=h.emailAddress;var o=h.displayName;$h.ComposeRecipient._throwOnInvalidDisplayNameOrEmail$p(o,e);f[r]=$h.ComposeRecipient._createEmailDictionaryForHost$p(e,o)}else throw Error.argument("recipients");else throw Error.argument("recipients");var c=this;window.OSF.DDA.OutlookAppOm._instance$p._standardInvokeHostMethod$i$0(i?21:22,{recipientField:this._type$p$0,recipientArray:f},function(n){return n},s._asyncContext$p$0,s._callback$p$0)}};$h.ComposeRecipient.RecipientField=function(){};$h.ComposeRecipient.RecipientField.prototype={to:0,cc:1,bcc:2,requiredAttendees:0,optionalAttendees:1};$h.ComposeRecipient.RecipientField.registerEnum("$h.ComposeRecipient.RecipientField",!1);$h.ComposeLocation=function(){};$h.ComposeLocation.prototype={getAsync:function(){for(var i=[],n=0;n<arguments.length;++n)i[n]=arguments[n];window.OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(1,"location.getAsync");var t=$h.CommonParameters.parse(i,!0);window.OSF.DDA.OutlookAppOm._instance$p._standardInvokeHostMethod$i$0(26,null,null,t._asyncContext$p$0,t._callback$p$0)},setAsync:function(n){for(var r=[],t=1;t<arguments.length;++t)r[t-1]=arguments[t];window.OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(2,"location.setAsync");var i=$h.CommonParameters.parse(r,!1);window.OSF.DDA.OutlookAppOm._throwOnOutOfRange$i(n.length,0,255,"location");window.OSF.DDA.OutlookAppOm._instance$p._standardInvokeHostMethod$i$0(27,{location:n},null,i._asyncContext$p$0,i._callback$p$0)}};$h.ComposeSubject=function(){};$h.ComposeSubject.prototype={getAsync:function(){for(var i=[],n=0;n<arguments.length;++n)i[n]=arguments[n];var t=$h.CommonParameters.parse(i,!0);window.OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(1,"subject.getAsync");window.OSF.DDA.OutlookAppOm._instance$p._standardInvokeHostMethod$i$0(18,null,null,t._asyncContext$p$0,t._callback$p$0)},setAsync:function(n){for(var r=[],t=1;t<arguments.length;++t)r[t-1]=arguments[t];var i=$h.CommonParameters.parse(r,!1);window.OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(2,"subject.setAsync");if(!String.isInstanceOfType(n))throw Error.argument("data");window.OSF.DDA.OutlookAppOm._throwOnOutOfRange$i(n.length,0,255,"data");window.OSF.DDA.OutlookAppOm._instance$p._standardInvokeHostMethod$i$0(17,{subject:n},null,i._asyncContext$p$0,i._callback$p$0)}};$h.ComposeTime=function(n){this.$$d__ticksToDateFormatter$p$0=Function.createDelegate(this,this._ticksToDateFormatter$p$0);this._timeType$p$0=n};$h.ComposeTime.prototype={_timeType$p$0:0,getAsync:function(){for(var i=[],n=0;n<arguments.length;++n)i[n]=arguments[n];window.OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(1,this._getPropertyName$p$0()+".getAsync");var t=$h.CommonParameters.parse(i,!0);window.OSF.DDA.OutlookAppOm._instance$p._standardInvokeHostMethod$i$0(24,{TimeProperty:this._timeType$p$0},this.$$d__ticksToDateFormatter$p$0,t._asyncContext$p$0,t._callback$p$0)},setAsync:function(n){for(var r=[],t=1;t<arguments.length;++t)r[t-1]=arguments[t];window.OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(2,this._getPropertyName$p$0()+".setAsync");if(!Date.isInstanceOfType(n))throw Error.argumentType("dateTime",Object.getType(n),Date);if(window.isNaN(n.getTime()))throw Error.argument("dateTime");if(n.getTime()<-864e13||n.getTime()>864e13)throw Error.argumentOutOfRange("dateTime");var i=$h.CommonParameters.parse(r,!1);window.OSF.DDA.OutlookAppOm._instance$p._standardInvokeHostMethod$i$0(25,{TimeProperty:this._timeType$p$0,time:n.getTime()},null,i._asyncContext$p$0,i._callback$p$0)},_ticksToDateFormatter$p$0:function(n){var t=n;return new Date(t)},_getPropertyName$p$0:function(){return this._timeType$p$0===1?"start":"end"}};$h.ComposeTime.TimeType=function(){};$h.ComposeTime.TimeType.prototype={start:1,end:2};$h.ComposeTime.TimeType.registerEnum("$h.ComposeTime.TimeType",!1);$h.Contact=function(n){this.$$d__getContactString$p$0=Function.createDelegate(this,this._getContactString$p$0);this.$$d__getAddresses$p$0=Function.createDelegate(this,this._getAddresses$p$0);this.$$d__getUrls$p$0=Function.createDelegate(this,this._getUrls$p$0);this.$$d__getEmailAddresses$p$0=Function.createDelegate(this,this._getEmailAddresses$p$0);this.$$d__getPhoneNumbers$p$0=Function.createDelegate(this,this._getPhoneNumbers$p$0);this.$$d__getBusinessName$p$0=Function.createDelegate(this,this._getBusinessName$p$0);this.$$d__getPersonName$p$0