@microsoft/office-js
Version:
Office JavaScript APIs
17 lines (15 loc) • 145 kB
JavaScript
/* Outlook specific API library */
/* Version: 15.0.4927.1000 */
/*
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(d,e,c){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=d;this._appReadyCallback$p$0=c;var a=this,b=function(){if(c)if(!d.get_isDialog())a.invokeHostMethod(1,null,a.$$d__getInitialDataResponseHandler$p$0);else window.setTimeout(a.$$d__callAppReadyCallback$p$0,0)};if(this._areStringsLoaded$p$0())b();else this._loadLocalizedScript$p$0(b)};window.OSF.DDA.OutlookAppOm._throwOnPropertyAccessForRestrictedPermission$i=function(a){if(!a)throw Error.create(window._u.ExtensibilityStrings.l_ElevatedPermissionNeeded_Text);};window.OSF.DDA.OutlookAppOm._throwOnOutOfRange$i=function(a,d,c,b){if(a<d||a>c)throw Error.argumentOutOfRange(b);};window.OSF.DDA.OutlookAppOm._getHtmlBody$p=function(a){var b="";if("htmlBody"in a){window.OSF.DDA.OutlookAppOm._throwOnInvalidHtmlBody$p(a.htmlBody);b=a.htmlBody}return b};window.OSF.DDA.OutlookAppOm._getAttachments$p=function(b){var a=[];if("attachments"in b){a=b.attachments;window.OSF.DDA.OutlookAppOm._throwOnInvalidAttachmentsArray$p(a)}return a};window.OSF.DDA.OutlookAppOm._getOptionsAndCallback$p=function(b){var a=[];if("options"in b)a[0]=b.options;if("callback"in b)a[a.length]=b.callback;return a};window.OSF.DDA.OutlookAppOm._createAttachmentsDataForHost$p=function(b){var c=new Array(0);if(Array.isInstanceOfType(b))for(var a=0;a<b.length;a++)if(Object.isInstanceOfType(b[a])){var d=b[a];window.OSF.DDA.OutlookAppOm._throwOnInvalidAttachment$p(d);c[a]=window.OSF.DDA.OutlookAppOm._createAttachmentData$p(d)}else throw Error.argument("attachments");return c};window.OSF.DDA.OutlookAppOm._throwOnInvalidHtmlBody$p=function(a){if(!String.isInstanceOfType(a))throw Error.argument("htmlBody");if($h.ScriptHelpers.isNullOrUndefined(a))throw Error.argument("htmlBody");window.OSF.DDA.OutlookAppOm._throwOnOutOfRange$i(a.length,0,window.OSF.DDA.OutlookAppOm.maxBodyLength,"htmlBody")};window.OSF.DDA.OutlookAppOm._throwOnInvalidAttachmentsArray$p=function(a){if(!Array.isInstanceOfType(a))throw Error.argument("attachments");};window.OSF.DDA.OutlookAppOm._throwOnInvalidAttachment$p=function(a){if(!Object.isInstanceOfType(a))throw Error.argument("attachments");if(!("type"in a)||!("name"in a))throw Error.argument("attachments");if(!("url"in a||"itemId"in a))throw Error.argument("attachments");};window.OSF.DDA.OutlookAppOm._createAttachmentData$p=function(a){var c=null;if(a.type==="file"){var e=a.url,b=a.name;window.OSF.DDA.OutlookAppOm._throwOnInvalidAttachmentUrlOrName$p(e,b);c=window.OSF.DDA.OutlookAppOm._createFileAttachmentData$p(e,b)}else if(a.type==="item"){var d=window.OSF.DDA.OutlookAppOm.getItemIdBasedOnHost(a.itemId),b=a.name;window.OSF.DDA.OutlookAppOm._throwOnInvalidAttachmentItemIdOrName$p(d,b);c=window.OSF.DDA.OutlookAppOm._createItemAttachmentData$p(d,b)}else throw Error.argument("attachments");return c};window.OSF.DDA.OutlookAppOm._createFileAttachmentData$p=function(b,a){return["file",a,b]};window.OSF.DDA.OutlookAppOm._createItemAttachmentData$p=function(a,b){return["item",b,a]};window.OSF.DDA.OutlookAppOm._throwOnInvalidAttachmentUrlOrName$p=function(a,b){if(!String.isInstanceOfType(a)||!String.isInstanceOfType(b))throw Error.argument("attachments");if(a.length>2048)throw Error.argumentOutOfRange("attachments",a.length,window._u.ExtensibilityStrings.l_AttachmentUrlTooLong_Text);window.OSF.DDA.OutlookAppOm._throwOnInvalidAttachmentName$p(b)};window.OSF.DDA.OutlookAppOm._throwOnInvalidAttachmentItemIdOrName$p=function(a,b){if(!String.isInstanceOfType(a)||!String.isInstanceOfType(b))throw Error.argument("attachments");if(a.length>200)throw Error.argumentOutOfRange("attachments",a.length,window._u.ExtensibilityStrings.l_AttachmentItemIdTooLong_Text);window.OSF.DDA.OutlookAppOm._throwOnInvalidAttachmentName$p(b)};window.OSF.DDA.OutlookAppOm._throwOnInvalidAttachmentName$p=function(a){if(a.length>255)throw Error.argumentOutOfRange("attachments",a.length,window._u.ExtensibilityStrings.l_AttachmentNameTooLong_Text);};window.OSF.DDA.OutlookAppOm._throwOnInvalidRestVersion$p=function(a){if(!a)throw Error.argumentNull("restVersion");if(a!==window.Microsoft.Office.WebExtension.MailboxEnums.RestVersion.v1_0&&a!==window.Microsoft.Office.WebExtension.MailboxEnums.RestVersion.v2_0&&a!==window.Microsoft.Office.WebExtension.MailboxEnums.RestVersion.Beta)throw Error.argument("restVersion");};window.OSF.DDA.OutlookAppOm.getItemIdBasedOnHost=function(a){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(a,window.Microsoft.Office.WebExtension.MailboxEnums.RestVersion.v1_0):window.OSF.DDA.OutlookAppOm._instance$p.convertToEwsId(a,window.Microsoft.Office.WebExtension.MailboxEnums.RestVersion.v1_0)};window.OSF.DDA.OutlookAppOm._throwOnArgumentType$p=function(c,b,a){if(Object.getType(c)!==b)throw Error.argumentType(a);};window.OSF.DDA.OutlookAppOm._validateOptionalStringParameter$p=function(a,e,d,b){if($h.ScriptHelpers.isNullOrUndefined(a))return;window.OSF.DDA.OutlookAppOm._throwOnArgumentType$p(a,String,b);var c=a;window.OSF.DDA.OutlookAppOm._throwOnOutOfRange$i(c.length,e,d,b)};window.OSF.DDA.OutlookAppOm._convertToOutlookParameters$p=function(d,a){var b=null;switch(d){case 1:case 2:case 12:case 3:case 14:case 18:case 26:case 32:case 41:case 34:break;case 4:var c=window.JSON.stringify(a.customProperties);b=[c];break;case 5:b=[a.body];break;case 8:case 9:b=[a.itemId];break;case 7:b=[window.OSF.DDA.OutlookAppOm._convertRecipientArrayParameterForOutlookForDisplayApi$p(a.requiredAttendees),window.OSF.DDA.OutlookAppOm._convertRecipientArrayParameterForOutlookForDisplayApi$p(a.optionalAttendees),a.start,a.end,a.location,window.OSF.DDA.OutlookAppOm._convertRecipientArrayParameterForOutlookForDisplayApi$p(a.resources),a.subject,a.body];break;case 44:b=[window.OSF.DDA.OutlookAppOm._convertRecipientArrayParameterForOutlookForDisplayApi$p(a.toRecipients),window.OSF.DDA.OutlookAppOm._convertRecipientArrayParameterForOutlookForDisplayApi$p(a.ccRecipients),window.OSF.DDA.OutlookAppOm._convertRecipientArrayParameterForOutlookForDisplayApi$p(a.bccRecipients),a.subject,a.htmlBody,a.attachments];break;case 43:b=[a.ewsIdOrEmail];break;case 40:b=[a.extensionId,a.consentState];break;case 11:case 10:b=[a.htmlBody];break;case 31:case 30:b=[a.htmlBody,a.attachments];break;case 23:case 13:case 38:case 29:b=[a.data,a.coercionType];break;case 37:case 28:b=[a.coercionType];break;case 17:b=[a.subject];break;case 15:b=[a.recipientField];break;case 22:case 21:b=[a.recipientField,window.OSF.DDA.OutlookAppOm._convertComposeEmailDictionaryParameterForSetApi$p(a.recipientArray)];break;case 19:b=[a.itemId,a.name];break;case 16:b=[a.uri,a.name];break;case 20:b=[a.attachmentIndex];break;case 25:b=[a.TimeProperty,a.time];break;case 24:b=[a.TimeProperty];break;case 27:b=[a.location];break;case 33:case 35:b=[a.key,a.type,a.persistent,a.message,a.icon];break;case 36:b=[a.key];break;default:Sys.Debug.fail("Unexpected method dispid")}return b};window.OSF.DDA.OutlookAppOm._convertRecipientArrayParameterForOutlookForDisplayApi$p=function(a){return a?a.join(";"):null};window.OSF.DDA.OutlookAppOm._convertComposeEmailDictionaryParameterForSetApi$p=function(a){if(!a)return null;for(var c=new Array(a.length),b=0;b<a.length;b++)c[b]=[a[b].address,a[b].name];return c};window.OSF.DDA.OutlookAppOm._validateAndNormalizeRecipientEmails$p=function(f,d){if($h.ScriptHelpers.isNullOrUndefined(f))return null;window.OSF.DDA.OutlookAppOm._throwOnArgumentType$p(f,Array,d);var b=f,c=null,e=false;window.OSF.DDA.OutlookAppOm._throwOnOutOfRange$i(b.length,0,window.OSF.DDA.OutlookAppOm._maxRecipients$p,String.format("{0}.length",d));for(var a=0;a<b.length;a++)if($h.EmailAddressDetails.isInstanceOfType(b[a])){e=true;break}if(e)c=[];for(var a=0;a<b.length;a++)if(e){c[a]=$h.EmailAddressDetails.isInstanceOfType(b[a])?b[a].emailAddress:b[a];window.OSF.DDA.OutlookAppOm._throwOnArgumentType$p(c[a],String,String.format("{0}[{1}]",d,a))}else window.OSF.DDA.OutlookAppOm._throwOnArgumentType$p(b[a],String,String.format("{0}[{1}]",d,a));return c};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(){if(!this._clientEndPoint$p$0)this._clientEndPoint$p$0=window.OSF._OfficeAppFactory.getClientEndPoint();return this._clientEndPoint$p$0},set_clientEndPoint:function(a){this._clientEndPoint$p$0=a;return a},get_initialData:function(){return this._initialData$p$0},get__appName$i$0:function(){return this._officeAppContext$p$0.get_appName()},initialize:function(a){var b="itemType";this._initialData$p$0=new $h.InitialData(a);if(1===a[b])this._item$p$0=new $h.Message(this._initialData$p$0);else if(3===a[b])this._item$p$0=new $h.MeetingRequest(this._initialData$p$0);else if(2===a[b])this._item$p$0=new $h.Appointment(this._initialData$p$0);else if(4===a[b])this._item$p$0=new $h.MessageCompose(this._initialData$p$0);else if(5===a[b])this._item$p$0=new $h.AppointmentCompose(this._initialData$p$0);else Sys.Debug.trace("Unexpected item type was received from the host.");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);if(window.OSF.DDA.OutlookAppOm._instance$p.get__appName$i$0()===64)if(this._initialData$p$0.get__overrideWindowOpen$i$0())window.open=this.$$d_windowOpenOverrideHandler},windowOpenOverrideHandler:function(a){this.invokeHostMethod(403,{launchUrl:a},null)},makeEwsRequestAsync:function(c){for(var e=[],b=1;b<arguments.length;++b)e[b-1]=arguments[b];if($h.ScriptHelpers.isNullOrUndefined(c))throw Error.argumentNull("data");if(c.length>window.OSF.DDA.OutlookAppOm._maxEwsRequestSize$p)throw Error.argument("data",window._u.ExtensibilityStrings.l_EwsRequestOversized_Text);this._throwOnMethodCallForInsufficientPermission$i$0(3,"makeEwsRequestAsync");var d=$h.CommonParameters.parse(e,true,true),a=new $h.EwsRequest(d._asyncContext$p$0),f=this;a.onreadystatechange=function(){4===a.get__requestState$i$1()&&d._callback$p$0(a._asyncResult$p$0)};a.send(c)},recordDataPoint:function(a){if($h.ScriptHelpers.isNullOrUndefined(a))throw Error.argumentNull("data");this.invokeHostMethod(402,a,null)},recordTrace:function(a){if($h.ScriptHelpers.isNullOrUndefined(a))throw Error.argumentNull("data");this.invokeHostMethod(401,a,null)},trackCtq:function(a){if($h.ScriptHelpers.isNullOrUndefined(a))throw Error.argumentNull("data");this.invokeHostMethod(400,a,null)},convertToLocalClientTime:function(d){var a=new Date(d.getTime()),b=a.getTimezoneOffset()*-1;if(this._initialData$p$0&&this._initialData$p$0.get__timeZoneOffsets$i$0()){a.setUTCMinutes(a.getUTCMinutes()-b);b=this._findOffset$p$0(a);a.setUTCMinutes(a.getUTCMinutes()+b)}var c=this._dateToDictionary$i$0(a);c.timezoneOffset=b;return c},convertToUtcClientTime:function(c){var a=this._dictionaryToDate$i$0(c);if(this._initialData$p$0&&this._initialData$p$0.get__timeZoneOffsets$i$0()){var b=this._findOffset$p$0(a);a.setUTCMinutes(a.getUTCMinutes()-b);b=!c.timezoneOffset?a.getTimezoneOffset()*-1:c.timezoneOffset;a.setUTCMinutes(a.getUTCMinutes()+b)}return a},convertToRestId:function(a,b){if(!a)throw Error.argumentNull("itemId");window.OSF.DDA.OutlookAppOm._throwOnInvalidRestVersion$p(b);return a.replace(new RegExp("[/]","g"),"-").replace(new RegExp("[+]","g"),"_")},convertToEwsId:function(a,b){if(!a)throw Error.argumentNull("itemId");window.OSF.DDA.OutlookAppOm._throwOnInvalidRestVersion$p(b);return a.replace(new RegExp("[-]","g"),"/").replace(new RegExp("[_]","g"),"+")},getUserIdentityTokenAsync:function(){for(var c=[],a=0;a<arguments.length;++a)c[a]=arguments[a];this._throwOnMethodCallForInsufficientPermission$i$0(1,"getUserIdentityTokenAsync");var b=$h.CommonParameters.parse(c,true,true);this._invokeGetTokenMethodAsync$p$0(2,"GetUserIdentityToken",b._callback$p$0,b._asyncContext$p$0)},getCallbackTokenAsync:function(){for(var c=[],a=0;a<arguments.length;++a)c[a]=arguments[a];this._throwOnMethodCallForInsufficientPermission$i$0(1,"getCallbackTokenAsync");var b=$h.CommonParameters.parse(c,true,true);this._invokeGetTokenMethodAsync$p$0(12,"GetCallbackToken",b._callback$p$0,b._asyncContext$p$0)},displayMessageForm:function(a){if($h.ScriptHelpers.isNullOrUndefined(a))throw Error.argumentNull("itemId");this.invokeHostMethod(8,{itemId:window.OSF.DDA.OutlookAppOm.getItemIdBasedOnHost(a)},null)},displayAppointmentForm:function(a){if($h.ScriptHelpers.isNullOrUndefined(a))throw Error.argumentNull("itemId");this.invokeHostMethod(9,{itemId:window.OSF.DDA.OutlookAppOm.getItemIdBasedOnHost(a)},null)},RegisterConsentAsync:function(a){if(a!==2&&a!==1&&a)throw Error.argumentOutOfRange("consentState");var b={};b.consentState=a.toString();b.extensionId=this.GetExtensionId();this.invokeHostMethod(40,b,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(h,g,c,f,e){var b={},a=null;b[window.OSF.DDA.AsyncResultEnum.Properties.Value]=h;b[window.OSF.DDA.AsyncResultEnum.Properties.Context]=f;if(0!==g){a={};var d=$h.OutlookErrorManager.getErrorArgs(c);a[window.OSF.DDA.AsyncResultEnum.ErrorProperties.Name]=d.name;a[window.OSF.DDA.AsyncResultEnum.ErrorProperties.Message]=!e?d.message:e;a[window.OSF.DDA.AsyncResultEnum.ErrorProperties.Code]=c}return new window.OSF.DDA.AsyncResult(b,a)},_throwOnMethodCallForInsufficientPermission$i$0:function(a,b){if(this._initialData$p$0._permissionLevel$p$0<a)throw Error.create(String.format(window._u.ExtensibilityStrings.l_ElevatedPermissionNeededForMethod_Text,b));},_displayReplyForm$i$0:function(a){this._displayReplyFormHelper$p$0(a,false)},_displayReplyAllForm$i$0:function(a){this._displayReplyFormHelper$p$0(a,true)},_displayReplyFormHelper$p$0:function(a,b){if(String.isInstanceOfType(a))this._doDisplayReplyForm$p$0(a,b);else if(Object.isInstanceOfType(a)&&Object.getTypeName(a)==="Object")this._doDisplayReplyFormWithAttachments$p$0(a,b);else throw Error.argumentType();},_doDisplayReplyForm$p$0:function(a,b){!$h.ScriptHelpers.isNullOrUndefined(a)&&window.OSF.DDA.OutlookAppOm._throwOnOutOfRange$i(a.length,0,window.OSF.DDA.OutlookAppOm.maxBodyLength,"htmlBody");this.invokeHostMethod(b?11:10,{htmlBody:a},null)},_doDisplayReplyFormWithAttachments$p$0:function(a,d){var e=window.OSF.DDA.OutlookAppOm._getHtmlBody$p(a),c=window.OSF.DDA.OutlookAppOm._getAttachments$p(a),b=$h.CommonParameters.parse(window.OSF.DDA.OutlookAppOm._getOptionsAndCallback$p(a),false),f=this;this._standardInvokeHostMethod$i$0(d?31:30,{htmlBody:e,attachments:window.OSF.DDA.OutlookAppOm._createAttachmentsDataForHost$p(c)},function(a){return a},b._asyncContext$p$0,b._callback$p$0)},_standardInvokeHostMethod$i$0:function(e,f,d,a,c){var b=this;this.invokeHostMethod(e,f,function(i,g){if(c){var f=null;if(Object.isInstanceOfType(g)){var e=g;if("error"in e||"data"in e||"errorCode"in e)if(!e.error){var h=d?d(e.data):e.data;f=b.createAsyncResult(h,0,0,a,null)}else{var j=e.errorCode;f=b.createAsyncResult(null,1,j,a,null)}}if(!f&&i)f=b.createAsyncResult(null,1,9002,a,null);c(f)}})},invokeHostMethod:function(b,d,a){if(64===this._officeAppContext$p$0.get_appName()){var c={ApiParams:d};c.MethodData={ControlId:window.OSF._OfficeAppFactory.getId(),DispatchId:b};if(b===1)this.get_clientEndPoint().invoke("GetInitialData",a,c);else this.get_clientEndPoint().invoke("ExecuteMethod",a,c)}else if(!this._isOwaOnlyMethod$p$0(b)){var e=window.OSF.DDA.OutlookAppOm._convertToOutlookParameters$p(b,d),f=this;window.OSF.ClientHostController.execute(b,e,function(g,f){if(a){var c=g.toArray(),d=window.JSON.parse(c[0]);if(Object.isInstanceOfType(d)){var b=d;if(c.length>1&&c[1]){b.error=true;b.errorCode=c[1]}else b.error=false;a(f,b)}else if(Number.isInstanceOfType(d)){var e={};e.error=true;e.errorCode=d;a(f,e)}else throw Error.notImplemented("Return data type from host must be Dictionary or int");}})}else a&&a(-2,null)},_dictionaryToDate$i$0:function(a){var b=new Date(a.year,a.month,a.date,a.hours,a.minutes,a.seconds,!a.milliseconds?0:a.milliseconds);if(window.isNaN(b.getTime()))throw Error.format(window._u.ExtensibilityStrings.l_InvalidDate_Text);return b},_dateToDictionary$i$0:function(b){var a={};a.month=b.getMonth();a.date=b.getDate();a.year=b.getFullYear();a.hours=b.getHours();a.minutes=b.getMinutes();a.seconds=b.getSeconds();a.milliseconds=b.getMilliseconds();return a},_isOwaOnlyMethod$p$0:function(a){switch(a){case 402:case 401:case 400:case 403:return true;default:return false}},_displayNewAppointmentFormApi$p$0:function(a){var d=window.OSF.DDA.OutlookAppOm._validateAndNormalizeRecipientEmails$p(a.requiredAttendees,"requiredAttendees"),c=window.OSF.DDA.OutlookAppOm._validateAndNormalizeRecipientEmails$p(a.optionalAttendees,"optionalAttendees");window.OSF.DDA.OutlookAppOm._validateOptionalStringParameter$p(a.location,0,window.OSF.DDA.OutlookAppOm._maxLocationLength$p,"location");window.OSF.DDA.OutlookAppOm._validateOptionalStringParameter$p(a.body,0,window.OSF.DDA.OutlookAppOm.maxBodyLength,"body");window.OSF.DDA.OutlookAppOm._validateOptionalStringParameter$p(a.subject,0,window.OSF.DDA.OutlookAppOm._maxSubjectLength$p,"subject");if(!$h.ScriptHelpers.isNullOrUndefined(a.start)){window.OSF.DDA.OutlookAppOm._throwOnArgumentType$p(a.start,Date,"start");var f=a.start;a.start=f.getTime();if(!$h.ScriptHelpers.isNullOrUndefined(a.end)){window.OSF.DDA.OutlookAppOm._throwOnArgumentType$p(a.end,Date,"end");var e=a.end;if(e<f)throw Error.argumentOutOfRange("end",e,window._u.ExtensibilityStrings.l_InvalidEventDates_Text);a.end=e.getTime()}}var b=null;if(d||c){b={};var g=a;for(var h in g){var i={key:h,value:g[h]};b[i.key]=i.value}if(d)b.requiredAttendees=d;if(c)b.optionalAttendees=c}this.invokeHostMethod(7,b||a,null)},displayNewMessageFormApi:function(a){var b={};if(a){var e=window.OSF.DDA.OutlookAppOm._validateAndNormalizeRecipientEmails$p(a.toRecipients,"toRecipients"),d=window.OSF.DDA.OutlookAppOm._validateAndNormalizeRecipientEmails$p(a.ccRecipients,"ccRecipients"),c=window.OSF.DDA.OutlookAppOm._validateAndNormalizeRecipientEmails$p(a.bccRecipients,"bccRecipients");window.OSF.DDA.OutlookAppOm._validateOptionalStringParameter$p(a.htmlBody,0,window.OSF.DDA.OutlookAppOm.maxBodyLength,"htmlBody");window.OSF.DDA.OutlookAppOm._validateOptionalStringParameter$p(a.subject,0,window.OSF.DDA.OutlookAppOm._maxSubjectLength$p,"subject");var f=window.OSF.DDA.OutlookAppOm._getAttachments$p(a),g=a;for(var h in g){var i={key:h,value:g[h]};b[i.key]=i.value}if(e)b.toRecipients=e;if(d)b.ccRecipients=d;if(c)b.bccRecipients=c;if(f)b.attachments=window.OSF.DDA.OutlookAppOm._createAttachmentsDataForHost$p(f)}this.invokeHostMethod(44,b||a,null)},displayContactCardAsync:function(d,e){if($h.ScriptHelpers.isNullOrUndefined(d))throw Error.argumentNull("ewsIdOrEmail");var c=null,a=null;if(e){var b=$h.CommonParameters.parse([e],false);c=b._asyncContext$p$0;a=b._callback$p$0}this._standardInvokeHostMethod$i$0(43,{ewsIdOrEmail:d.trim()},null,c,a)},_initializeMethods$p$0:function(){var a=this;if($h.Item.isInstanceOfType(this._item$p$0)){a.displayNewAppointmentForm=this.$$d__displayNewAppointmentFormApi$p$0;a.displayNewMessageForm=this.$$d_displayNewMessageFormApi;a.displayContactCardAsync=this.$$d_displayContactCardAsync}},_getInitialDataResponseHandler$p$0:function(a,b){if(a)return;this.initialize(b);this.displayName="mailbox";window.setTimeout(this.$$d__callAppReadyCallback$p$0,0)},_callAppReadyCallback$p$0:function(){this._appReadyCallback$p$0()},_invokeGetTokenMethodAsync$p$0:function(d,e,c,a){if($h.ScriptHelpers.isNullOrUndefined(c))throw Error.argumentNull("callback");var b=this;this.invokeHostMethod(d,null,function(f,g){var e;if(f)e=b.createAsyncResult(null,1,9017,a,String.format(window._u.ExtensibilityStrings.l_InternalProtocolError_Text,f));else{var d=g;if(d.wasSuccessful)e=b.createAsyncResult(d.token,0,0,a,null);else e=b.createAsyncResult(null,1,d.errorCode,a,d.errorMessage)}c(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(d){for(var c=this._initialData$p$0.get__timeZoneOffsets$i$0(),b=0;b<c.length;b++){var a=c[b],e=window.parseInt(a.start),f=window.parseInt(a.end);if(d.getTime()-e>=0&&d.getTime()-f<0)return window.parseInt(a.offset)}throw Error.format(window._u.ExtensibilityStrings.l_InvalidDate_Text);},_areStringsLoaded$p$0:function(){var a=false;try{a=!$h.ScriptHelpers.isNullOrUndefined(window._u.ExtensibilityStrings.l_EwsRequestOversized_Text)}catch(b){}return a},_loadLocalizedScript$p$0:function(i){for(var g=null,l="",m=document.getElementsByTagName("script"),h=m.length-1;h>=0;h--){var b=null,j=m[h].attributes;if(j){var k=j.getNamedItem("src");if(k)b=k.value;if(b){var o=false;b=b.toLowerCase();var e=b.indexOf("office_strings.js");if(e<0){e=b.indexOf("office_strings.debug.js");o=true}if(e>0&&e<b.length){g=b.replace(o?"office_strings.debug.js":"office_strings.js","outlook_strings.js");var c=b.substring(0,e),d=c.lastIndexOf("/",c.length-2);if(d===-1)d=c.lastIndexOf("\\",c.length-2);if(d!==-1&&c.length>d+1)l=c.substring(0,d+1);break}}}}if(g){var p=document.getElementsByTagName("head")[0],a=null,r=this,f=function(){if(i&&(!a.readyState||a.readyState&&(a.readyState==="loaded"||a.readyState==="complete"))){a.onload=null;a.onreadystatechange=null;i()}},n=this,q=function(){if(!n._areStringsLoaded$p$0()){var b=l+"en-us/outlook_strings.js";a.onload=null;a.onreadystatechange=null;a=n._createScriptElement$p$0(b);a.onload=f;a.onreadystatechange=f;p.appendChild(a)}};a=this._createScriptElement$p$0(g);a.onload=f;a.onreadystatechange=f;window.setTimeout(q,2e3);p.appendChild(a)}},_createScriptElement$p$0:function(b){var a=document.createElement("script");a.type="text/javascript";a.src=b;return a}};window.OSF.DDA.Settings=OSF.DDA.Settings=function(a){this._rawData$p$0=a};window.OSF.DDA.Settings._convertFromRawSettings$p=function(a){if(!a)return{};if(window.OSF.DDA.OutlookAppOm._instance$p.get__appName$i$0()===8){var b=a.SettingsKey;if(b)return window.OSF.DDA.SettingsManager.deserializeSettings(b)}return a};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(a){return this.get__data$p$0()[a]},"set":function(b,a){this.get__data$p$0()[b]=a},remove:function(a){delete this.get__data$p$0()[a]},saveAsync:function(){for(var c=[],b=0;b<arguments.length;++b)c[b]=arguments[b];var a=$h.CommonParameters.parse(c,false);if(window.JSON.stringify(window.OSF.DDA.SettingsManager.serializeSettings(this.get__data$p$0())).length>32768){var d=window.OSF.DDA.OutlookAppOm._instance$p.createAsyncResult(null,1,9019,a._asyncContext$p$0,""),e=this;window.setTimeout(function(){a._callback$p$0(d)},0);return}if(window.OSF.DDA.OutlookAppOm._instance$p.get__appName$i$0()===64)this._saveSettingsForOwa$p$0(a._callback$p$0,a._asyncContext$p$0);else this._saveSettingsForOutlook$p$0(a._callback$p$0,a._asyncContext$p$0)},_saveSettingsForOutlook$p$0:function(d,c){var a=null;try{var f=window.OSF.DDA.SettingsManager.serializeSettings(this.get__data$p$0()),g=window.JSON.stringify(f),e={SettingsKey:g};window.OSF.DDA.RichClientSettingsManager.write(e)}catch(h){a=h}if(d){var b;if(a)b=window.OSF.DDA.OutlookAppOm._instance$p.createAsyncResult(null,1,9019,c,a.message);else b=window.OSF.DDA.OutlookAppOm._instance$p.createAsyncResult(null,0,0,c,null);d(b)}},_saveSettingsForOwa$p$0:function(b,a){var c=window.OSF.DDA.SettingsManager.serializeSettings(this.get__data$p$0()),d=this;window.OSF.DDA.OutlookAppOm._instance$p.invokeHostMethod(404,[c],function(e,f){if(b){var c;if(e)c=window.OSF.DDA.OutlookAppOm._instance$p.createAsyncResult(null,1,9017,a,String.format(window._u.ExtensibilityStrings.l_InternalProtocolError_Text,e));else{var d=f;if(!d.error)c=window.OSF.DDA.OutlookAppOm._instance$p.createAsyncResult(null,0,0,a,null);else c=window.OSF.DDA.OutlookAppOm._instance$p.createAsyncResult(null,1,9019,a,d.errorMessage)}b(c)}})}};Type.registerNamespace("$h");var $h=window.$h||{};Type.registerNamespace("Office.cast");var Office=window.Office||{};Office.cast=Office.cast||{};$h.Appointment=function(a){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,[a]);$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(a){return this._data$p$0._getEntitiesByType$i$0(a)},getRegExMatches:function(){window.OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(1,"getRegExMatches");return this._data$p$0._getRegExMatches$i$0()},getFilteredEntitiesByName:function(a){return this._data$p$0._getFilteredEntitiesByName$i$0(a)},getRegExMatchesByName:function(a){window.OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(1,"getRegExMatchesByName");return this._data$p$0._getRegExMatchesByName$i$0(a)},displayReplyForm:function(a){window.OSF.DDA.OutlookAppOm._instance$p._displayReplyForm$i$0(a)},displayReplyAllForm:function(a){window.OSF.DDA.OutlookAppOm._instance$p._displayReplyAllForm$i$0(a)},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(a){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,[a]);$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();if(!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();if(!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();if(!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();if(!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();if(!this._location$p$2)this._location$p$2=new $h.ComposeLocation;return this._location$p$2}};$h.AttachmentConstants=function(){};$h.AttachmentDetails=function(a){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=a;$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 a=this._data$p$0.attachmentType;return a<$h.AttachmentDetails._attachmentTypeMap$p.length?$h.AttachmentDetails._attachmentTypeMap$p[a]: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(b,a){a.val=undefined;if(b===window.Microsoft.Office.WebExtension.CoercionType.Html)a.val=3;else if(b===window.Microsoft.Office.WebExtension.CoercionType.Text)a.val=0;else return false;return true};$h.Body.prototype={getAsync:function(g){for(var f=[],a=1;a<arguments.length;++a)f[a-1]=arguments[a];window.OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(1,"body.getAsync");var c=$h.CommonParameters.parse(f,true),b,d,e;if(!(e=$h.Body._tryMapToHostCoercionType$i(g,d={val:b}),b=d.val,e))throw Error.argument("coercionType");var h={coercionType:b};window.OSF.DDA.OutlookAppOm._instance$p._standardInvokeHostMethod$i$0(37,h,null,c._asyncContext$p$0,c._callback$p$0)}};$h.ComposeBody=function(){$h.ComposeBody.initializeBase(this)};$h.ComposeBody._createParameterDictionaryToHost$i=function(f,a){var c={data:f};if(a._options$p$0&&!$h.ScriptHelpers.isNull(a._options$p$0.coercionType)){var b,d,e;if(!(e=$h.Body._tryMapToHostCoercionType$i(a._options$p$0.coercionType,d={val:b}),b=d.val,e)){a._callback$p$0&&a._callback$p$0(window.OSF.DDA.OutlookAppOm._instance$p.createAsyncResult(null,1,1e3,a._asyncContext$p$0,null));return null}c.coercionType=b}else c.coercionType=0;return c};$h.ComposeBody.prototype={getTypeAsync:function(){for(var c=[],a=0;a<arguments.length;++a)c[a]=arguments[a];window.OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(1,"body.getTypeAsync");var b=$h.CommonParameters.parse(c,true);window.OSF.DDA.OutlookAppOm._instance$p._standardInvokeHostMethod$i$0(14,null,null,b._asyncContext$p$0,b._callback$p$0)},setSelectedDataAsync:function(b){for(var e=[],a=1;a<arguments.length;++a)e[a-1]=arguments[a];window.OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(2,"body.setSelectedDataAsync");var c=$h.CommonParameters.parse(e,false);if(!String.isInstanceOfType(b))throw Error.argumentType("data",Object.getType(b),String);window.OSF.DDA.OutlookAppOm._throwOnOutOfRange$i(b.length,0,1e6,"data");var d=$h.ComposeBody._createParameterDictionaryToHost$i(b,c);if(!d)return;window.OSF.DDA.OutlookAppOm._instance$p._standardInvokeHostMethod$i$0(13,d,null,c._asyncContext$p$0,c._callback$p$0)},prependAsync:function(b){for(var e=[],a=1;a<arguments.length;++a)e[a-1]=arguments[a];window.OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(2,"body.prependAsync");var c=$h.CommonParameters.parse(e,false);if(!String.isInstanceOfType(b))throw Error.argumentType("data",Object.getType(b),String);window.OSF.DDA.OutlookAppOm._throwOnOutOfRange$i(b.length,0,1e6,"data");var d=$h.ComposeBody._createParameterDictionaryToHost$i(b,c);if(!d)return;window.OSF.DDA.OutlookAppOm._instance$p._standardInvokeHostMethod$i$0(23,d,null,c._asyncContext$p$0,c._callback$p$0)},setAsync:function(b){for(var e=[],a=1;a<arguments.length;++a)e[a-1]=arguments[a];window.OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(2,"body.setAsync");var c=$h.CommonParameters.parse(e,false);if(!String.isInstanceOfType(b))throw Error.argumentType("data",Object.getType(b),String);window.OSF.DDA.OutlookAppOm._throwOnOutOfRange$i(b.length,0,1e6,"data");var d=$h.ComposeBody._createParameterDictionaryToHost$i(b,c);if(!d)return;window.OSF.DDA.OutlookAppOm._instance$p._standardInvokeHostMethod$i$0(38,d,null,c._asyncContext$p$0,c._callback$p$0)}};$h.ComposeItem=function(a){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,[a]);$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(c,b){for(var e=[],a=2;a<arguments.length;++a)e[a-2]=arguments[a];window.OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(2,"addFileAttachmentAsync");if(!$h.ScriptHelpers.isNonEmptyString(c))throw Error.argument("uri");if(!$h.ScriptHelpers.isNonEmptyString(b))throw Error.argument("attachmentName");window.OSF.DDA.OutlookAppOm._throwOnOutOfRange$i(c.length,0,2048,"uri");window.OSF.DDA.OutlookAppOm._throwOnOutOfRange$i(b.length,0,255,"attachmentName");var d=$h.CommonParameters.parse(e,false),f={uri:c,name:b,__timeout__:6e5};window.OSF.DDA.OutlookAppOm._instance$p._standardInvokeHostMethod$i$0(16,f,null,d._asyncContext$p$0,d._callback$p$0)},addItemAttachmentAsync:function(c,b){for(var e=[],a=2;a<arguments.length;++a)e[a-2]=arguments[a];window.OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(2,"addItemAttachmentAsync");if(!$h.ScriptHelpers.isNonEmptyString(c))throw Error.argument("itemId");if(!$h.ScriptHelpers.isNonEmptyString(b))throw Error.argument("attachmentName");window.OSF.DDA.OutlookAppOm._throwOnOutOfRange$i(c.length,0,200,"itemId");window.OSF.DDA.OutlookAppOm._throwOnOutOfRange$i(b.length,0,255,"attachmentName");var d=$h.CommonParameters.parse(e,false),f={itemId:window.OSF.DDA.OutlookAppOm.getItemIdBasedOnHost(c),name:b,__timeout__:6e5};window.OSF.DDA.OutlookAppOm._instance$p._standardInvokeHostMethod$i$0(19,f,null,d._asyncContext$p$0,d._callback$p$0)},removeAttachmentAsync:function(b){for(var d=[],a=1;a<arguments.length;++a)d[a-1]=arguments[a];window.OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(2,"removeAttachmentAsync");if(!$h.ScriptHelpers.isNonEmptyString(b))throw Error.argument("attachmentId");window.OSF.DDA.OutlookAppOm._throwOnOutOfRange$i(b.length,0,200,"attachmentId");var c=$h.CommonParameters.parse(d,false);window.OSF.DDA.OutlookAppOm._instance$p._standardInvokeHostMethod$i$0(20,{attachmentIndex:b},null,c._asyncContext$p$0,c._callback$p$0)},getSelectedDataAsync:function(c){for(var g=[],a=1;a<arguments.length;++a)g[a-1]=arguments[a];window.OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(1,"getSelectedDataAsync");var d=$h.CommonParameters.parse(g,true),b,e,f;if(c!==window.Microsoft.Office.WebExtension.CoercionType.Html&&c!==window.Microsoft.Office.WebExtension.CoercionType.Text||!(f=$h.Body._tryMapToHostCoercionType$i(c,e={val:b}),b=e.val,f))throw Error.argument("coercionType");var h={coercionType:b};window.OSF.DDA.OutlookAppOm._instance$p._standardInvokeHostMethod$i$0(28,h,null,d._asyncContext$p$0,d._callback$p$0)},setSelectedDataAsync:function(b){for(var e=[],a=1;a<arguments.length;++a)e[a-1]=arguments[a];window.OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(2,"setSelectedDataAsync");var c=$h.CommonParameters.parse(e,false);if(!String.isInstanceOfType(b))throw Error.argumentType("data",Object.getType(b),String);window.OSF.DDA.OutlookAppOm._throwOnOutOfRange$i(b.length,0,1e6,"data");var d=$h.ComposeBody._createParameterDictionaryToHost$i(b,c);if(!d)return;window.OSF.DDA.OutlookAppOm._instance$p._standardInvokeHostMethod$i$0(29,d,null,c._asyncContext$p$0,c._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();if(!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();if(!this._subject$p$1)this._subject$p$1=new $h.ComposeSubject;return this._subject$p$1},saveAsync:function(){for(var c=[],a=0;a<arguments.length;++a)c[a]=arguments[a];window.OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(2,"saveAsync");var b=$h.CommonParameters.parse(c,false);window.OSF.DDA.OutlookAppOm._instance$p._standardInvokeHostMethod$i$0(32,null,null,b._asyncContext$p$0,b._callback$p$0)}};$h.ComposeRecipient=function(b,a){this._type$p$0=b;this._propertyName$p$0=a};$h.ComposeRecipient._throwOnInvalidDisplayNameOrEmail$p=function(b,a){if(!b&&!a)throw Error.argument("recipients");if(b&&b.length>255)throw Error.argumentOutOfRange("recipients",b.length,window._u.ExtensibilityStrings.l_DisplayNameTooLong_Text);if(a&&a.length>571)throw Error.argumentOutOfRange("recipients",a.length,window._u.ExtensibilityStrings.l_EmailAddressTooLong_Text);};$h.ComposeRecipient._getAsyncFormatter$p=function(d){for(var c=d,b=[],a=0;a<c.length;a++){var e=new $h.EmailAddressDetails(c[a]);b[a]=e}return b};$h.ComposeRecipient._createEmailDictionaryForHost$p=function(a,b){return{address:a,name:b}};$h.ComposeRecipient.prototype={_propertyName$p$0:null,_type$p$0:0,getAsync:function(){for(var c=[],a=0;a<arguments.length;++a)c[a]=arguments[a];var b=$h.CommonParameters.parse(c,true);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,b._asyncContext$p$0,b._callback$p$0)},setAsync:function(c){for(var b=[],a=1;a<arguments.length;++a)b[a-1]=arguments[a];window.OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(2,this._propertyName$p$0+".setAsync");this.setAddHelper(c,b,true)},addAsync:function(c){for(var b=[],a=1;a<arguments.length;++a)b[a-1]=arguments[a];window.OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(2,this._propertyName$p$0+".addAsync");this.setAddHelper(c,b,false)},setAddHelper:function(b,j,i){window.OSF.DDA.OutlookAppOm._throwOnOutOfRange$i(b.length,0,100,"recipients");var g=$h.CommonParameters.parse(j,false),c=[];if(Array.isInstanceOfType(b))for(var a=0;a<b.length;a++)if(String.isInstanceOfType(b[a])){$h.ComposeRecipient._throwOnInvalidDisplayNameOrEmail$p(b[a],b[a]);c[a]=$h.ComposeRecipient._createEmailDictionaryForHost$p(b[a],b[a])}else if($h.EmailAddressDetails.isInstanceOfType(b[a])){var d=b[a];$h.ComposeRecipient._throwOnInvalidDisplayNameOrEmail$p(d.displayName,d.emailAddress);c[a]=$h.ComposeRecipient._createEmailDictionaryForHost$p(d.emailAddress,d.displayName)}else if(Object.isInstanceOfType(b[a])){var h=b[a],e=h.emailAddress,f=h.displayName;$h.ComposeRecipient._throwOnInvalidDisplayNameOrEmail$p(f,e);c[a]=$h.ComposeRecipient._createEmailDictionaryForHost$p(e,f)}else throw Error.argument("recipients");else throw Error.argument("recipients");var k=this;window.OSF.DDA.OutlookAppOm._instance$p._standardInvokeHostMethod$i$0(i?21:22,{recipientField:this._type$p$0,recipientArray:c},function(a){return a},g._asyncContext$p$0,g._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",false);$h.ComposeLocation=function(){};$h.ComposeLocation.prototype={getAsync:function(){for(var c=[],a=0;a<arguments.length;++a)c[a]=arguments[a];window.OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(1,"location.getAsync");var b=$h.CommonParameters.parse(c,true);window.OSF.DDA.OutlookAppOm._instance$p._standardInvokeHostMethod$i$0(26,null,null,b._asyncContext$p$0,b._callback$p$0)},setAsync:function(c){for(var d=[],a=1;a<arguments.length;++a)d[a-1]=arguments[a];window.OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(2,"location.setAsync");var b=$h.CommonParameters.parse(d,false);window.OSF.DDA.OutlookAppOm._throwOnOutOfRange$i(c.length,0,255,"location");window.OSF.DDA.OutlookAppOm._instance$p._standardInvokeHostMethod$i$0(27,{location:c},null,b._asyncContext$p$0,b._callback$p$0)}};$h.ComposeSubject=function(){};$h.ComposeSubject.prototype={getAsync:function(){for(var c=[],a=0;a<arguments.length;++a)c[a]=arguments[a];var b=$h.CommonParameters.parse(c,true);window.OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(1,"subject.getAsync");window.OSF.DDA.OutlookAppOm._instance$p._standardInvokeHostMethod$i$0(18,null,null,b._asyncContext$p$0,b._callback$p$0)},setAsync:function(b){for(var d=[],a=1;a<arguments.length;++a)d[a-1]=arguments[a];var c=$h.CommonParameters.parse(d,false);window.OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(2,"subject.setAsync");if(!String.isInstanceOfType(b))throw Error.argument("data");window.OSF.DDA.OutlookAppOm._throwOnOutOfRange$i(b.length,0,255,"data");window.OSF.DDA.OutlookAppOm._instance$p._standardInvokeHostMethod$i$0(17,{subject:b},null,c._asyncContext$p$0,c._callback$p$0)}};$h.ComposeTime=function(a){this.$$d__ticksToDateFormatter$p$0=Function.createDelegate(this,this._ticksToDateFormatter$p$0);this._timeType$p$0=a};$h.ComposeTime.prototype={_timeType$p$0:0,getAsync:function(){for(var c=[],a=0;a<arguments.length;++a)c[a]=arguments[a];window.OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(1,this._getPropertyName$p$0()+".getAsync");var b=$h.CommonParameters.parse(c,true);window.OSF.DDA.OutlookAppOm._instance$p._standardInvokeHostMethod$i$0(24,{TimeProperty:this._timeType$p$0},this.$$d__ticksToDateFormatter$p$0,b._asyncContext$p$0,b._callback$p$0)},setAsync:function(a){for(var d=[],b=1;b<arguments.length;++b)d[b-1]=arguments[b];window.OSF.DDA.OutlookAppOm._instance$p._throwOnMethodCallForInsufficientPermission$i$0(2,this._getPropertyName$p$0()+".setAsync");if(!Date.isInstanceOfType(a))throw Error.argumentType("dateTime",Object.getType(a),Date);if(window.isNaN(a.getTime()))throw Error.argument("dateTime");if(a.getTime()<-864e13||a.getTime()>864e13)throw Error.argumentOutOfRange("dateTime");var c=$h.CommonParameters.parse(d,false);window.OSF.DDA.OutlookAppOm._instance$p._standardInvokeHostMethod$i$0(25,{TimeProperty:this._timeType$p$0,time:a.getTime()},null,c._asyncContext$p$0,c._callback$p$0)},_ticksToDateFormatter$p$0:function(a){var b=a;return new Date(b)},_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",false);$h.Contact=function(a){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)