@microsoft/office-js
Version:
Office JavaScript Library ESM Module for Excel/Word/PowerPoint/Outlook
15 lines • 662 kB
JavaScript
/*
* Office JavaScript API library
*
* Copyright (c) Microsoft Corporation. All rights reserved.
*
* Your use of this file is governed by the license terms for the Microsoft Office JavaScript (Office.js) API library: https://github.com/OfficeDev/office-js/blob/release/LICENSE.md
*
* This file also contains the following Promise implementation (with a few small modifications):
* * @overview es6-promise - a tiny implementation of Promises/A+.
* * @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald)
* * @license Licensed under MIT license
* * See https://raw.githubusercontent.com/jakearchibald/es6-promise/master/LICENSE
* * @version 2.3.0
*/
var OSFPerformance,CustomFunctionMappings,CustomFunctions,Strings;window.Type&&window.Type.registerNamespace?Type.registerNamespace("Strings"):void 0===window.Strings&&(window.Strings=new Object,window.Strings.__namespace=!0),(Strings=window.Strings).OfficeOM=function(){},Strings.OfficeOM.registerClass&&Strings.OfficeOM.registerClass("Strings.OfficeOM"),Strings.OfficeOM.L_APICallFailed="API Call Failed",Strings.OfficeOM.L_APINotSupported="API Not Supported",Strings.OfficeOM.L_ActivityLimitReached="Activity limit has been reached.",Strings.OfficeOM.L_AddBindingFromPromptDefaultText="Please make a selection.",Strings.OfficeOM.L_AddinIsAlreadyRequestingToken="Add-in is already requesting an access token.",Strings.OfficeOM.L_AddinIsAlreadyRequestingTokenMessage="The operation failed because this add-in is already requesting an access token.",Strings.OfficeOM.L_ApiNotFoundDetails="The method or property {0} is part of the {1} requirement set, which is not available in your version of {2}.",Strings.OfficeOM.L_AppNameNotExist="Add-in Name for {0} doesn't exist.",Strings.OfficeOM.L_AppNotExistInitializeNotCalled="Application {0} does not exist. Microsoft.Office.WebExtension.initialize(reason) is not called.",Strings.OfficeOM.L_AttemptingToSetReadOnlyProperty="Attempting to set read-only property '{0}'.",Strings.OfficeOM.L_BadSelectorString="The string passed into the selector is improperly formatted or unsupported.",Strings.OfficeOM.L_BindingCreationError="Binding Creation Error",Strings.OfficeOM.L_BindingNotExist="The specified binding does not exist.",Strings.OfficeOM.L_BindingToMultipleSelection="Noncontiguous selections are not supported.",Strings.OfficeOM.L_BrowserAPINotSupported="This browser does not support the requested API.",Strings.OfficeOM.L_CallbackNotAFunction="Callback must be of type function, was of type {0}.",Strings.OfficeOM.L_CancelButton="Cancel",Strings.OfficeOM.L_CannotApplyPropertyThroughSetMethod="Changes to property '{0}' cannot be applied through an \"object.set\" method.",Strings.OfficeOM.L_CannotNavigateTo="The object is located in a place where navigation is not supported.",Strings.OfficeOM.L_CannotRegisterEvent="The event handler cannot be registered.",Strings.OfficeOM.L_CannotWriteToSelection="Cannot write to the current selection.",Strings.OfficeOM.L_CellDataAmountBeyondLimits="Note: The number of cells in a table is suggested to be below 20,000 cells.",Strings.OfficeOM.L_CellFormatAmountBeyondLimits="Note: The formatting sets set by a Formatting API call is suggested to be below 100.",Strings.OfficeOM.L_CloseFileBeforeRetrieve="Call closeAsync on the current File before retrieving another.",Strings.OfficeOM.L_CoercionTypeNotMatchBinding="The specified coercion type is not compatible with this binding type.",Strings.OfficeOM.L_CoercionTypeNotSupported="The specified coercion type is not supported.",Strings.OfficeOM.L_ColIndexOutOfRange="The column index value is out of the allowed range. Use a value (0 or higher) that's less than the number of columns.",Strings.OfficeOM.L_ConfirmCancelMessage="Sorry, we can't continue.",Strings.OfficeOM.L_ConfirmDialog="The domain {0} is acting as Microsoft Office and can run Office add-ins, which may access your personal data. If you trust the domain to run as Office and access your data, click OK to continue.",Strings.OfficeOM.L_ConfirmDialogApiTrustsParent="You are about to send and receive potentially sensitive information from {0}. Only click OK if you trust the following website recieving the sensitive information: {1}.",Strings.OfficeOM.L_ConfirmDialogConsent="By clicking OK, you will allow {0} access to your content and personal information. ",Strings.OfficeOM.L_ConfirmDialogConsentTitle="One moment ...",Strings.OfficeOM.L_ConfirmRefreshMessage="To continue, remove the add-in and add it again, or refresh the page.",Strings.OfficeOM.L_ConnectionFailureWithDetails="The request failed with status code of {0}, error code {1} and the following error message: {2}",Strings.OfficeOM.L_ConnectionFailureWithStatus="The request failed with status code of {0}.",Strings.OfficeOM.L_ContinueButton="Continue",Strings.OfficeOM.L_CustomFunctionDefinitionMissing="A property with this name that represents the function's definition must exist on Excel.Script.CustomFunctions.",Strings.OfficeOM.L_CustomFunctionImplementationMissing="The property with this name on Excel.Script.CustomFunctions that represents the function's definition must contain a 'call' property that implements the function.",Strings.OfficeOM.L_CustomFunctionNameCannotSplit="The function name must contain a non-empty namespace and a non-empty short name.",Strings.OfficeOM.L_CustomFunctionNameContainsBadChars="The function name may only contain letters, digits, underscores, and periods.",Strings.OfficeOM.L_CustomXmlError="Custom XML Error.",Strings.OfficeOM.L_CustomXmlExceedQuotaMessage="XPath limits selection to 1024 items.",Strings.OfficeOM.L_CustomXmlExceedQuotaName="Selection Limit Reached",Strings.OfficeOM.L_CustomXmlNodeNotFound="The specified node was not found.",Strings.OfficeOM.L_CustomXmlOutOfDateMessage="The data is out of date. Retrieve the object again.",Strings.OfficeOM.L_CustomXmlOutOfDateName="Data Not Current",Strings.OfficeOM.L_DataNotMatchBindingSize="The supplied data object does not match the size of the current selection.",Strings.OfficeOM.L_DataNotMatchBindingType="The specified data object is not compatible with the binding type.",Strings.OfficeOM.L_DataNotMatchCoercionType="The type of the specified data object is not compatible with the current selection.",Strings.OfficeOM.L_DataNotMatchSelection="The supplied data object is not compatible with the shape or dimensions of the current selection.",Strings.OfficeOM.L_DataReadError="Data Read Error",Strings.OfficeOM.L_DataStale="Data Not Current",Strings.OfficeOM.L_DataWriteError="Data Write Error",Strings.OfficeOM.L_DataWriteReminder="Data Write Reminder",Strings.OfficeOM.L_DialogAddressNotTrusted="The domain of the URL is not included in the AppDomains element in the manifest, and is not subdomain of source location.",Strings.OfficeOM.L_DialogAlreadyOpened="The operation failed because this add-in already has an active dialog.",Strings.OfficeOM.L_DialogInvalidScheme="The URL scheme is not supported. Use HTTPS instead.",Strings.OfficeOM.L_DialogNavigateError="Dialog Navigation Error",Strings.OfficeOM.L_DialogOK="OK",Strings.OfficeOM.L_DialogParentIsMinimized="The operation failed because parent window is minimized.",Strings.OfficeOM.L_DialogRequireHTTPS="The HTTP protocol is not supported. Use HTTPS instead",Strings.OfficeOM.L_DisplayDialogError="Display Dialog Error",Strings.OfficeOM.L_DocumentIsInactive="The operation failed because the document containing this add-in is inactive.",Strings.OfficeOM.L_DocumentReadOnly="The requested operation is not allowed on the current document mode.",Strings.OfficeOM.L_ElementMissing="We couldn't format the table cell because some parameter values are missing. Double-check the parameters and try again.",Strings.OfficeOM.L_EventHandlerAdditionFailed="Failed to add the event handler.",Strings.OfficeOM.L_EventHandlerNotExist="The specified event handler was not found for this binding.",Strings.OfficeOM.L_EventHandlerRemovalFailed="Failed to remove the event handler.",Strings.OfficeOM.L_EventRegistrationError="Event Registration Error",Strings.OfficeOM.L_FileTypeNotSupported="The specified file type is not supported.",Strings.OfficeOM.L_FormatValueOutOfRange="The value is out of the allowed range.",Strings.OfficeOM.L_FormattingReminder="Formatting Reminder",Strings.OfficeOM.L_FunctionCallFailed="Function {0} call failed, error code: {1}.",Strings.OfficeOM.L_GetDataIsTooLarge="The requested data set is too large.",Strings.OfficeOM.L_GetDataParametersConflict="The specified parameters conflict.",Strings.OfficeOM.L_GetSelectionNotSupported="The current selection is not supported.",Strings.OfficeOM.L_HostError="Host Error",Strings.OfficeOM.L_ImplicitGetAuthContextMissing="The function to get authentication context is missing",Strings.OfficeOM.L_ImplicitNotLoaded="The module is not loaded before acquire a token",Strings.OfficeOM.L_InValidOptionalArgument="invalid optional argument",Strings.OfficeOM.L_IndexOutOfRange="Index out of range.",Strings.OfficeOM.L_InitializeNotReady="Office.js has not been fully loaded yet. Please try again later or make sure to add your initialization code on the Office.initialize function.",Strings.OfficeOM.L_InternalError="Internal Error",Strings.OfficeOM.L_InternalErrorDescription="An internal error has occurred.",Strings.OfficeOM.L_InvalidAPICall="Invalid API Call",Strings.OfficeOM.L_InvalidApiArgumentsMessage="Invalid input arguments.",Strings.OfficeOM.L_InvalidApiCallInContext="Invalid API call in the current context.",Strings.OfficeOM.L_InvalidArgument="The argument '{0}' doesn't work for this situation, is missing, or isn't in the right format.",Strings.OfficeOM.L_InvalidArgumentGeneric="The argument(s) passed into the function don't work for this situation, are missing, or aren't in the right format.",Strings.OfficeOM.L_InvalidBinding="Invalid Binding",Strings.OfficeOM.L_InvalidBindingError="Invalid Binding Error",Strings.OfficeOM.L_InvalidBindingOperation="Invalid Binding Operation",Strings.OfficeOM.L_InvalidCellsValue="One or more of the cells parameters have values that aren't allowed. Double-check the values and try again.",Strings.OfficeOM.L_InvalidCoercion="Invalid Coercion Type",Strings.OfficeOM.L_InvalidColumnsForBinding="The specified columns are invalid.",Strings.OfficeOM.L_InvalidDataFormat="The format of the specified data object is invalid.",Strings.OfficeOM.L_InvalidDataObject="Invalid Data Object",Strings.OfficeOM.L_InvalidFormat="Invalid Format Error",Strings.OfficeOM.L_InvalidFormatValue="One or more of the format parameters have values that aren't allowed. Double-check the values and try again.",Strings.OfficeOM.L_InvalidGetColumns="The specified columns are invalid.",Strings.OfficeOM.L_InvalidGetRowColumnCounts="The specified rowCount or columnCount values are invalid.",Strings.OfficeOM.L_InvalidGetRows="The specified rows are invalid.",Strings.OfficeOM.L_InvalidGetStartRowColumn="The specified startRow or startColumn values are invalid.",Strings.OfficeOM.L_InvalidGrant="Preauthorization missing.",Strings.OfficeOM.L_InvalidGrantMessage="Missing grant for this add-in.",Strings.OfficeOM.L_InvalidNamedItemForBindingType="The specified binding type is not compatible with the supplied named item.",Strings.OfficeOM.L_InvalidNode="Invalid Node",Strings.OfficeOM.L_InvalidObjectPath='The object path \'{0}\' isn\'t working for what you\'re trying to do. If you\'re using the object across multiple "context.sync" calls and outside the sequential execution of a ".run" batch, please use the "context.trackedObjects.add()" and "context.trackedObjects.remove()" methods to manage the object\'s lifetime.',Strings.OfficeOM.L_InvalidOperationInCellEditMode="Excel is in cell-editing mode. Please exit the edit mode by pressing ENTER or TAB or selecting another cell, and then try again.",Strings.OfficeOM.L_InvalidOrTimedOutSession="Invalid Or Timed Out Session",Strings.OfficeOM.L_InvalidOrTimedOutSessionMessage="Your Office session has expired or is invalid. To continue, refresh the page.",Strings.OfficeOM.L_InvalidParameters="Function {0} has invalid parameters.",Strings.OfficeOM.L_InvalidReadForBlankRow="The specified row is blank.",Strings.OfficeOM.L_InvalidRequestContext="Cannot use the object across different request contexts.",Strings.OfficeOM.L_InvalidResourceUrl="Invalid application resource Url provided.",Strings.OfficeOM.L_InvalidResourceUrlMessage="Invalid resource Url specified in the manifest.",Strings.OfficeOM.L_InvalidSSOAddinMessage="The identity API is not supported for this add-in.",Strings.OfficeOM.L_InvalidSelectionForBindingType="A binding cannot be created with the current selection and the specified binding type.",Strings.OfficeOM.L_InvalidSetColumns="The specified columns are invalid.",Strings.OfficeOM.L_InvalidSetRows="The specified rows are invalid.",Strings.OfficeOM.L_InvalidSetStartRowColumn="The specified startRow or startColumn values are invalid.",Strings.OfficeOM.L_InvalidTableOptionValue="One or more of the tableOptions parameters have values that aren't allowed. Double-check the values and try again.",Strings.OfficeOM.L_InvalidValue="Invalid Value",Strings.OfficeOM.L_MemoryLimit="Memory Limit Exceeded",Strings.OfficeOM.L_MissingParameter="Missing Parameter",Strings.OfficeOM.L_MissingRequiredArguments="missing some required arguments",Strings.OfficeOM.L_ModalDialogOpeng="The operation failed because this add-in already has an active modal dialog.",Strings.OfficeOM.L_MultipleNamedItemFound="Multiple objects with the same name were found.",Strings.OfficeOM.L_NamedItemNotFound="The named item does not exist.",Strings.OfficeOM.L_NavOutOfBound="The operation failed because the index is out of range.",Strings.OfficeOM.L_NetworkProblem="Network Problem",Strings.OfficeOM.L_NetworkProblemRetrieveFile="A network problem has prevented retrieval of the file.",Strings.OfficeOM.L_NewWindowCrossZone="The security settings in your browser prevent us from creating a dialog box. Try a different browser, or {0} so that '{1}' and the domain shown in your address bar are in the same security zone.",Strings.OfficeOM.L_NewWindowCrossZoneConfigureBrowserLink="configure your browser",Strings.OfficeOM.L_NewWindowCrossZoneErrorString="Browser restrictions prevented us from creating the dialog box. The domain of dialog box and the domain of the add-in host are not in the same security zone.",Strings.OfficeOM.L_NoCapability="You don't have sufficient permissions for this action.",Strings.OfficeOM.L_NoHttpsWAC="This Office session is not using a secure connection. We recommend that you take extra precautions.",Strings.OfficeOM.L_NonUniformPartialGetNotSupported="Coordinate parameters cannot be used with coercion type Table when the table contains merged cells.",Strings.OfficeOM.L_NonUniformPartialSetNotSupported="Coordinate parameters cannot be used with coercion type Table when the table contains merged cells.",Strings.OfficeOM.L_NotImplemented="Function {0} is not implemented.",Strings.OfficeOM.L_NotSupported="Function {0} is not supported.",Strings.OfficeOM.L_NotSupportedBindingType="The specified binding type {0} is not supported.",Strings.OfficeOM.L_NotSupportedEventType="The specified event type {0} is not supported.",Strings.OfficeOM.L_NotTrustedWAC="This add-in has been disabled to help keep you safe. To continue using the add-in, validate that this item is hosted in a trusted domain or open it in the Office desktop app.",Strings.OfficeOM.L_OKButton="OK",Strings.OfficeOM.L_OperationCancelledError="Operation Cancelled",Strings.OfficeOM.L_OperationCancelledErrorMessage="The operation was cancelled by the user.",Strings.OfficeOM.L_OperationNotSupported="The operation is not supported.",Strings.OfficeOM.L_OperationNotSupportedOnMatrixData="Selected content needs to be in table format. Format the data as a table and try again.",Strings.OfficeOM.L_OperationNotSupportedOnThisBindingType="Operation is not supported on this binding type.",Strings.OfficeOM.L_OsfControlTypeNotSupported="OsfControl type not supported.",Strings.OfficeOM.L_OutOfRange="Out of Range",Strings.OfficeOM.L_OverwriteWorksheetData="The set operation failed because the supplied data object will overwrite or shift data.",Strings.OfficeOM.L_PermissionDenied="Permission Denied",Strings.OfficeOM.L_PropertyDoesNotExist="Property '{0}' does not exist on the object.",Strings.OfficeOM.L_PropertyNotLoaded="The property '{0}' is not available. Before reading the property's value, call the load method on the containing object and call \"context.sync()\" on the associated request context.",Strings.OfficeOM.L_ReadSettingsError="Read Settings Error",Strings.OfficeOM.L_RedundantCallbackSpecification="Callback cannot be specified both in argument list and in optional object.",Strings.OfficeOM.L_RequestPayloadSizeLimitExceededMessage='The request payload size has exceeded the limit. Please refer to the documentation: "https://docs.microsoft.com/office/dev/add-ins/concepts/resource-limits-and-performance-optimization#excel-add-ins".',Strings.OfficeOM.L_RequestTimeout="The call took too long to execute.",Strings.OfficeOM.L_RequestTimeoutAPITookLong="The call took too long to run.",Strings.OfficeOM.L_RequestTokenUnavailable="This API has been throttled to slow the call frequency.",Strings.OfficeOM.L_ResponsePayloadSizeLimitExceededMessage='The response payload size has exceeded the limit. Please refer to the documentation: "https://docs.microsoft.com/office/dev/add-ins/concepts/resource-limits-and-performance-optimization#excel-add-ins".',Strings.OfficeOM.L_RowIndexOutOfRange="The row index value is out of the allowed range. Use a value (0 or higher) that's less than the number of rows.",Strings.OfficeOM.L_RunMustReturnPromise='The batch function passed to the ".run" method didn\'t return a promise. The function must return a promise, so that any automatically-tracked objects can be released at the completion of the batch operation. Typically, you return a promise by returning the response from "context.sync()".',Strings.OfficeOM.L_SSOClientError="Error occurred in the authentication request from Office.",Strings.OfficeOM.L_SSOClientErrorMessage="An unexpected error occurred in the client.",Strings.OfficeOM.L_SSOConnectionLostError="A connection was lost during the sign in process.",Strings.OfficeOM.L_SSOConnectionLostErrorMessage="A connection was lost during the sign in process, and the user may not be signed in. This was likely due to the user's browser configuration settings, such as security zones.",Strings.OfficeOM.L_SSOServerError="Error occurred in the authentication provider.",Strings.OfficeOM.L_SSOServerErrorMessage="An unexpected error occurred on the server.",Strings.OfficeOM.L_SSOUnsupportedPlatform="API is not supported in this platform.",Strings.OfficeOM.L_SSOUserConsentNotSupportedByCurrentAddinCategory="This add-in does not support user consent.",Strings.OfficeOM.L_SSOUserConsentNotSupportedByCurrentAddinCategoryMessage="The operation failed because this add-in does not support user consent in this category",Strings.OfficeOM.L_SaveSettingsError="Save Settings Error",Strings.OfficeOM.L_SelectionCannotBound="Cannot bind to the current selection.",Strings.OfficeOM.L_SelectionNotSupportCoercionType="The current selection is not compatible with the specified coercion type.",Strings.OfficeOM.L_SetDataIsTooLarge="The specified data object is too large.",Strings.OfficeOM.L_SetDataParametersConflict="The specified parameters conflict.",Strings.OfficeOM.L_SettingNameNotExist="The specified setting name does not exist.",Strings.OfficeOM.L_SettingsAreStale="Settings could not be saved because they are not current.",Strings.OfficeOM.L_SettingsCannotSave="The settings could not be saved.",Strings.OfficeOM.L_SettingsStaleError="Settings Stale Error",Strings.OfficeOM.L_ShowWindowDialogNotification="{0} wants to display a new window.",Strings.OfficeOM.L_ShowWindowDialogNotificationAllow="Allow",Strings.OfficeOM.L_ShowWindowDialogNotificationIgnore="Ignore",Strings.OfficeOM.L_ShuttingDown="Operation failed because the data is not current on the server.",Strings.OfficeOM.L_SliceSizeNotSupported="The specified slice size is not supported.",Strings.OfficeOM.L_SpecifiedIdNotExist="The specified ID does not exist.",Strings.OfficeOM.L_Timeout="The operation has timed out.",Strings.OfficeOM.L_TooManyArguments="too many arguments",Strings.OfficeOM.L_TooManyIncompleteRequests="Wait until the previous call completes.",Strings.OfficeOM.L_TooManyOptionalFunction="multiple optional functions in parameter list",Strings.OfficeOM.L_TooManyOptionalObjects="multiple optional objects in parameter list",Strings.OfficeOM.L_UndoNotSupportedMessage="The JavaScript API request failed due to the lack of support for the undo operation.",Strings.OfficeOM.L_UnknownBindingType="The binding type is not supported.",Strings.OfficeOM.L_UnsupportedDataObject="The supplied data object type is not supported.",Strings.OfficeOM.L_UnsupportedEnumeration="Unsupported Enumeration",Strings.OfficeOM.L_UnsupportedEnumerationMessage="The enumeration isn't supported in the current host application.",Strings.OfficeOM.L_UnsupportedUserIdentity="User identity type is not supported.",Strings.OfficeOM.L_UnsupportedUserIdentityMessage="The identity type of the user is not supported.",Strings.OfficeOM.L_UserAborted="User aborted the consent request.",Strings.OfficeOM.L_UserAbortedMessage="The user did not consent the add-in permissions.",Strings.OfficeOM.L_UserClickIgnore="The user chose to ignore the dialog box.",Strings.OfficeOM.L_UserNotSignedIn="No user is signed into Office.",Strings.OfficeOM.L_ValueNotLoaded='The value of the result object has not been loaded yet. Before reading the value property, call "context.sync()" on the associated request context.',Strings.OfficeOM.L_WorkbookHiddenMessage="The JavaScript API request failed because the workbook was hidden. Please unhide the workbook and try again.",Strings.OfficeOM.L_WriteNotSupportedWhenModalDialogOpen="Write operation is not supported for Office when a modal dialog is open.",function(e){e.now=function(){return"undefined"!=typeof performance&&performance.now?performance.now():0},e.getTotalJSHeapSize=function(){return"undefined"!=typeof performance&&performance.memory?performance.memory.totalJSHeapSize:0},e.getUsedJSHeapSize=function(){return"undefined"!=typeof performance&&performance.memory?performance.memory.usedJSHeapSize:0},e.getJSHeapSizeLimit=function(){return"undefined"!=typeof performance&&performance.memory?performance.memory.jsHeapSizeLimit:0},e.officeExecuteStartDate=e.officeExecuteStartDate||Date.now(),e.officeExecuteStart=e.officeExecuteStart||0,e.officeExecuteEnd=e.officeExecuteEnd||0,e.hostInitializationStart=0,e.hostInitializationEnd=0,e.totalJSHeapSize=0,e.usedJSHeapSize=0,e.jsHeapSizeLimit=0,e.createOMEnd=0,e.hostSpecificFileName="",e.getAppContextStart=0,e.getAppContextEnd=0,e.getAppContextXdmStart=0,e.getAppContextXdmEnd=0,e.officeOnReady=0}(OSFPerformance||(OSFPerformance={})),function(e){e.definePropertyOnNamespace=function(e,t,n){Object.defineProperty(e,t,{get:function(){return n()},configurable:!0,enumerable:!0})}}(OSF||(OSF={})),OSFPerformance.hostInitializationStart=OSFPerformance.now(),function(e){!function(e){function t(){return e.m_association||(e.m_association=new OSF.Association),e.m_association}e.m_association=e.m_association,e.associate=function(){OTel&&OTel.OTelLogger&&OTel.OTelLogger.onTelemetryLoaded((function(){Microsoft.Office.WebExtension.sendTelemetryEvent({eventName:"Office.Extensibility.OfficeJs.ApiCall",dataFields:[oteljs.makeStringDataField("Api","Office.actions.associate")],eventFlags:{dataCategories:2,diagnosticLevel:110}})})),t().associate.apply(t(),arguments)},OSF.definePropertyOnNamespace(e,"_association",t)}(e.actions||(e.actions={}))}(Office||(Office={})),function(e){!function(e){e[e.Select=0]="Select",e[e.UnSelect=1]="UnSelect",e[e.CancelDialog=2]="CancelDialog",e[e.InsertAgave=3]="InsertAgave",e[e.CtrlF6In=4]="CtrlF6In",e[e.CtrlF6Exit=5]="CtrlF6Exit",e[e.CtrlF6ExitShift=6]="CtrlF6ExitShift",e[e.SelectWithError=7]="SelectWithError",e[e.NotifyHostError=8]="NotifyHostError",e[e.RefreshAddinCommands=9]="RefreshAddinCommands",e[e.PageIsReady=10]="PageIsReady",e[e.TabIn=11]="TabIn",e[e.TabInShift=12]="TabInShift",e[e.TabExit=13]="TabExit",e[e.TabExitShift=14]="TabExitShift",e[e.EscExit=15]="EscExit",e[e.F2Exit=16]="F2Exit",e[e.ExitNoFocusable=17]="ExitNoFocusable",e[e.ExitNoFocusableShift=18]="ExitNoFocusableShift",e[e.MouseEnter=19]="MouseEnter",e[e.MouseLeave=20]="MouseLeave",e[e.UpdateTargetUrl=21]="UpdateTargetUrl",e[e.InstallCustomFunctions=22]="InstallCustomFunctions",e[e.SendTelemetryEvent=23]="SendTelemetryEvent",e[e.UninstallCustomFunctions=24]="UninstallCustomFunctions",e[e.SendMessage=25]="SendMessage",e[e.LaunchExtensionComponent=26]="LaunchExtensionComponent",e[e.StopExtensionComponent=27]="StopExtensionComponent",e[e.RestartExtensionComponent=28]="RestartExtensionComponent",e[e.EnableTaskPaneHeaderButton=29]="EnableTaskPaneHeaderButton",e[e.DisableTaskPaneHeaderButton=30]="DisableTaskPaneHeaderButton",e[e.TaskPaneHeaderButtonClicked=31]="TaskPaneHeaderButtonClicked",e[e.RemoveAppCommandsAddin=32]="RemoveAppCommandsAddin",e[e.RefreshRibbonGallery=33]="RefreshRibbonGallery",e[e.GetOriginalControlId=34]="GetOriginalControlId",e[e.OfficeJsReady=35]="OfficeJsReady",e[e.InsertDevManifest=36]="InsertDevManifest",e[e.InsertDevManifestError=37]="InsertDevManifestError",e[e.SendCustomerContent=38]="SendCustomerContent",e[e.KeyboardShortcuts=39]="KeyboardShortcuts",e[e.CloseSDXDialog=42]="CloseSDXDialog",e[e.ResizeSDXDialog=43]="ResizeSDXDialog",e[e.SendNonStandardEvent=44]="SendNonStandardEvent",e[e.Interactive=48]="Interactive",e[e.OfficeJsRuntimeInfo=49]="OfficeJsRuntimeInfo"}(e.AgaveHostAction||(e.AgaveHostAction={}))}(OSF||(OSF={})),function(e){var t=function(){function t(){var t=this;this._processAppCommandInvocation=function(e){var n=t._verifyManifestCallback(e.callbackName);if(0==n.errorCode){var r=t._constructEventObjectForCallback(e);r?window.setTimeout((function(){n.callback(r)}),0):t._invokeAppCommandCompletedMethod(e.appCommandId,5001,"")}else t._invokeAppCommandCompletedMethod(e.appCommandId,n.errorCode,"")},this._eventDispatch=new e.EventDispatch([{type:e.EventType.AppCommandInvoked,id:e.EventDispId.dispidAppCommandInvokedEvent,getTargetId:function(){return""},fromSafeArrayHost:function(t){return{type:e.EventType.AppCommandInvoked,appCommandId:t[0],callbackName:t[1],eventObjStr:t[2]}},fromWebHost:function(t){return{type:e.EventType.AppCommandInvoked,appCommandId:t[0],callbackName:t[1],eventObjStr:t[2]}}}])}return t.prototype.initializeEventHandler=function(t){var n=this;this.addHandlerAsync(e.EventType.AppCommandInvoked,(function(e){n._processAppCommandInvocation(e)}),t)},t.prototype.appCommandInvocationCompletedAsync=function(t,n,r,i){e._OfficeAppFactory.getAsyncMethodExecutor().executeAsync(94,{fromSafeArrayHost:function(e){return e},fromWebHost:function(e){return e},toSafeArrayHost:function(){return[t,n,r]},toWebHost:function(){var e={};return e[0]=t,e[1]=n,e[2]=r,e}},i)},t.prototype.addHandlerAsync=function(t,n,r){e.EventHelper.addEventHandler(t,n,r,this._eventDispatch,void 0,e.OUtil.isPopupWindow())},t.prototype._verifyManifestCallback=function(e){var t={callback:null,errorCode:11101};e=e.trim();try{var n=this._getCallbackFunc(e);if("function"!=typeof n)return t}catch(e){return t}return{callback:n,errorCode:0}},t.prototype._getCallbackFuncFromActionAssociateTable=function(e){var t=e.toUpperCase();return Office.actions._association.mappings[t]},t.prototype._getCallbackFunc=function(e){return this._getCallbackFuncFromActionAssociateTable(e)},t.prototype._invokeAppCommandCompletedMethod=function(e,t,n){this.appCommandInvocationCompletedAsync(e,t,n,(function(e){e.status!==Office.AsyncResultStatus.Succeeded&&console.error("Failed to notify the host thta app command is completed")}))},t.prototype._constructEventObjectForCallback=function(e){var t,n,r=this;try{t=JSON.parse(e.eventObjStr),n=JSON.parse(e.eventObjStr)}catch(e){}return t||(t={}),n||(n={}),t.completed=function(t){n.completedContext=t;var i=JSON.stringify(n);r._invokeAppCommandCompletedMethod(e.appCommandId,0,i)},t},t.initialize=function(){null==t._instance&&(t._instance=new t,t._instance.initializeEventHandler((function(e){e.status!==Office.AsyncResultStatus.Succeeded&&console.error("Cannot initialize app command: "+JSON.stringify(e))})))},t._instance=null,t}();e.AppCommandManager=t}(OSF||(OSF={})),function(e){!function(e){e[e.Unsupported=0]="Unsupported",e[e.Excel=1]="Excel",e[e.Word=2]="Word",e[e.PowerPoint=4]="PowerPoint",e[e.Outlook=8]="Outlook",e[e.ExcelWebApp=16]="ExcelWebApp",e[e.WordWebApp=32]="WordWebApp",e[e.OutlookWebApp=64]="OutlookWebApp",e[e.Project=128]="Project",e[e.AccessWebApp=256]="AccessWebApp",e[e.PowerpointWebApp=512]="PowerpointWebApp",e[e.ExcelIOS=1024]="ExcelIOS",e[e.Sway=2048]="Sway",e[e.WordIOS=4096]="WordIOS",e[e.PowerPointIOS=8192]="PowerPointIOS",e[e.Access=16384]="Access",e[e.Lync=32768]="Lync",e[e.OutlookIOS=65536]="OutlookIOS",e[e.OneNoteWebApp=131072]="OneNoteWebApp",e[e.OneNote=262144]="OneNote",e[e.ExcelWinRT=524288]="ExcelWinRT",e[e.WordWinRT=1048576]="WordWinRT",e[e.PowerpointWinRT=2097152]="PowerpointWinRT",e[e.OutlookAndroid=4194304]="OutlookAndroid",e[e.OneNoteWinRT=8388608]="OneNoteWinRT",e[e.ExcelAndroid=8388609]="ExcelAndroid",e[e.VisioWebApp=8388610]="VisioWebApp",e[e.OneNoteIOS=8388611]="OneNoteIOS",e[e.WordAndroid=8388613]="WordAndroid",e[e.PowerpointAndroid=8388614]="PowerpointAndroid",e[e.Visio=8388615]="Visio",e[e.OneNoteAndroid=4194305]="OneNoteAndroid"}(e.AppName||(e.AppName={}))}(OSF||(OSF={})),function(e){var t=function(){function e(){this.m_mappings={},this.m_onchangeHandlers=[]}return e.prototype.associate=function(e,t){function n(e){"undefined"!=typeof console&&console.warn&&console.warn(e)}if(1==arguments.length&&"object"==typeof arguments[0]&&arguments[0]){var r=arguments[0];for(var i in r)this.associate(i,r[i])}else if(2==arguments.length){var o=arguments[0],a=arguments[1];if("string"!=typeof o)return void n("[InvalidArg] Function=associate");if("function"!=typeof a)return void n("[InvalidArg] Function=associate");var s=o.toUpperCase();this.m_mappings[s]&&n("[DuplicatedName] Function="+o),this.m_mappings[s]=a;for(var c=0;c<this.m_onchangeHandlers.length;c++)this.m_onchangeHandlers[c]()}else n("[InvalidArg] Function=associate")},e.prototype.onchange=function(e){e&&this.m_onchangeHandlers.push(e)},Object.defineProperty(e.prototype,"mappings",{get:function(){return this.m_mappings},enumerable:!0,configurable:!0}),e}();e.Association=t}(OSF||(OSF={})),function(e){var t=function(){function e(){}return e.prototype.invokeCallback=function(e,t,n,r,i){if(0==n){var o={status:Office.AsyncResultStatus.Succeeded,value:r,asyncContext:i};"function"==typeof t&&t(o)}else{var a={status:Office.AsyncResultStatus.Failed,error:{code:n},asyncContext:i};"function"==typeof t&&t(a)}},e}();e.AsyncMethodExecutor=t}(OSF||(OSF={})),function(e){var t=function(){function t(e){this._asyncMethodExecutor=e}return t.prototype.handleSafeArrayHostResponse=function(t,n,r,i,o,a,s){var c,l;if("number"==typeof(t=e.Utility.fromSafeArray(t))?(c=[],l=t):l=(c=t)[0],1==l)return null!=(u=c[1])&&(r[u[0]]=u[1]),!1;if(i){var u;if(0==l){if(c.length>2){u=[];for(var f=1;f<c.length;f++)u[f-1]=c[f]}else u=c[1];if(r.length>0&&null!=u){var d=u[u.length-1];r.length==d?u[u.length-1]=r:l=5001}}else u=c[1];var p=null;0==l&&(p=o.fromSafeArrayHost(u)),this._asyncMethodExecutor.invokeCallback(a,i,l,p,s)}return!0},t.prototype.handleWebHostResponse=function(e,t,n,r,i,o){var a=null;0==t&&(a=r.fromWebHost(e)),this._asyncMethodExecutor.invokeCallback(i,n,t,a,o)},t}();e.AsyncMethodExecutorHelper=t}(OSF||(OSF={})),function(e){!function(e){!function(e){!function(e){e.Context="Context",e.Value="Value",e.Status="Status",e.Error="Error"}(e.Properties||(e.Properties={})),function(e){e[e.Success=0]="Success",e[e.Failed=1]="Failed"}(e.ErrorCode||(e.ErrorCode={})),function(e){e.Name="Name",e.Message="Message",e.Code="Code"}(e.ErrorProperties||(e.ErrorProperties={}))}(e.AsyncResultEnum||(e.AsyncResultEnum={}));var t=function(e,t){this.value=e.Value,this.status=t?Office.AsyncResultStatus.Failed:Office.AsyncResultStatus.Succeeded,e.Context&&(this.asyncContext=e.Context),t&&(this.error=new n(t.Name,t.Message,t.Code))};e.AsyncResult=t;var n=function(e,t,n){this.name=e,this.message=t,this.code=n};e.Error=n}(e.DDA||(e.DDA={}))}(OSF||(OSF={})),function(e){!function(t){t.createWebClientHostControllerHelper=function(t,n){return new e.WebClientHostControllerHelper(t,n)},t.createAsyncMethodExecutorHelper=function(t){return new e.AsyncMethodExecutorHelper(t)}}(e.BootStrapExtension||(e.BootStrapExtension={}))}(OSF||(OSF={})),function(e){!function(e){e.DefaultLocale="en-us",e.OfficeJS="office.js",e.OfficeDebugJS="office.debug.js",e.OfficeStringsId="OFFICESTRINGS",e.OfficeJsId="OFFICEJS",e.HostFileId="HOST",e.OfficeStringJS="office_strings.js",e.OfficeStringDebugJS="office_strings.debug.js",e.FileVersion="16.0.20717.15040"}(e.ConstantNames||(e.ConstantNames={}))}(OSF||(OSF={})),function(e){var t=function(){function e(){}return e.NotificationConversationIdSuffix="_ntf",e}();e.Constants=t}(OSF||(OSF={})),CustomFunctionMappings||(CustomFunctionMappings={}),function(e){e.delayInitialization=function(){CustomFunctionMappings.__delay__=!0},e._association=e._association||new OSF.Association,e.associate=function(){e._association.associate.apply(e._association,arguments),delete CustomFunctionMappings.__delay__}}(CustomFunctions||(CustomFunctions={})),function(e){!function(t){!function(t){var n={},r=!1;t.getErrorArgs=function(t){r||(n[1e3]={name:e.ErrorNames.InvalidCoercion},n[1001]={name:e.ErrorNames.DataReadError},n[1002]={name:e.ErrorNames.InvalidCoercion},n[1003]={name:e.ErrorNames.DataReadError},n[1004]={name:e.ErrorNames.DataReadError},n[1005]={name:e.ErrorNames.DataReadError},n[1006]={name:e.ErrorNames.DataReadError},n[1008]={name:e.ErrorNames.DataReadError},n[1009]={name:e.ErrorNames.DataReadError},n[1010]={name:e.ErrorNames.DataReadError},n[1011]={name:e.ErrorNames.DataReadError},n[1012]={name:e.ErrorNames.DataReadError},n[1013]={name:e.ErrorNames.DataReadError},n[2e3]={name:e.ErrorNames.DataWriteError},n[2001]={name:e.ErrorNames.DataWriteError},n[2002]={name:e.ErrorNames.DataWriteError},n[2003]={name:e.ErrorNames.DataWriteError},n[2004]={name:e.ErrorNames.DataWriteError},n[2005]={name:e.ErrorNames.DataWriteError},n[2006]={name:e.ErrorNames.InvalidFormat},n[2007]={name:e.ErrorNames.InvalidDataObject},n[2008]={name:e.ErrorNames.InvalidDataObject},n[2009]={name:e.ErrorNames.DataWriteError},n[2010]={name:e.ErrorNames.DataWriteError},n[2011]={name:e.ErrorNames.DataWriteError},n[2012]={name:e.ErrorNames.DataWriteError},n[2013]={name:e.ErrorNames.DataWriteError},n[3e3]={name:e.ErrorNames.BindingCreationError},n[3002]={name:e.ErrorNames.InvalidBindingError},n[3003]={name:e.ErrorNames.BindingCreationError},n[3004]={name:e.ErrorNames.BindingCreationError},n[3005]={name:e.ErrorNames.InvalidBindingOperation},n[3006]={name:e.ErrorNames.BindingCreationError},n[3007]={name:e.ErrorNames.BindingCreationError},n[3008]={name:e.ErrorNames.BindingCreationError},n[3009]={name:e.ErrorNames.InvalidBinding},n[3010]={name:e.ErrorNames.InvalidBindingOperation},n[3011]={name:e.ErrorNames.InvalidBinding},n[4e3]={name:e.ErrorNames.ReadSettingsError},n[4001]={name:e.ErrorNames.SaveSettingsError},n[4002]={name:e.ErrorNames.SettingsStaleError},n[5e3]={name:e.ErrorNames.HostError},n[5001]={name:e.ErrorNames.InternalError},n[5002]={name:e.ErrorNames.PermissionDenied},n[5003]={name:e.ErrorNames.EventRegistrationError},n[5004]={name:e.ErrorNames.InvalidAPICall},n[5005]={name:e.ErrorNames.ShuttingDown},n[5007]={name:e.ErrorNames.UnsupportedEnumeration},n[5008]={name:e.ErrorNames.IndexOutOfRange},n[5009]={name:e.ErrorNames.APINotSupported},n[5011]={name:e.ErrorNames.APICallFailed},n[5012]={name:e.ErrorNames.InvalidOrTimedOutSession},n[5013]={name:e.ErrorNames.APICallFailed},n[5015]={name:e.ErrorNames.APICallFailed},n[5016]={name:e.ErrorNames.APICallFailed},n[5017]={name:e.ErrorNames.APICallFailed},n[5018]={name:e.ErrorNames.APICallFailed},n[5100]={name:e.ErrorNames.APICallFailed},n[5101]={name:e.ErrorNames.APICallFailed},n[5102]={name:e.ErrorNames.APICallFailed},n[5103]={name:e.ErrorNames.APICallFailed},n[5104]={name:e.ErrorNames.APICallFailed},n[6e3]={name:e.ErrorNames.InvalidNode},n[6100]={name:e.ErrorNames.CustomXmlError},n[6101]={name:e.ErrorNames.CustomXmlExceedQuotaName},n[6102]={name:e.ErrorNames.CustomXmlOutOfDateName},n[7e3]={name:e.ErrorNames.PermissionDenied},n[7001]={name:e.ErrorNames.CannotNavigateTo},n[7002]={name:e.ErrorNames.SpecifiedIdNotExist},n[7004]={name:e.ErrorNames.NavOutOfBounds},n[2014]={name:e.ErrorNames.DataWriteReminder},n[8e3]={name:e.ErrorNames.MissingParameter},n[8001]={name:e.ErrorNames.PermissionDenied},n[8010]={name:e.ErrorNames.InvalidValue},n[8011]={name:e.ErrorNames.InvalidValue},n[8012]={name:e.ErrorNames.InvalidValue},n[8020]={name:e.ErrorNames.OutOfRange},n[8021]={name:e.ErrorNames.OutOfRange},n[8022]={name:e.ErrorNames.OutOfRange},n[8023]={name:e.ErrorNames.FormattingReminder},n[1e4]={name:e.ErrorNames.UserNotSignedIn},n[11e3]={name:e.ErrorNames.MemoryLimitExceeded},n[11001]={name:e.ErrorNames.NetworkProblem},n[11002]={name:e.ErrorNames.InvalidValue},n[12007]={name:e.ErrorNames.DisplayDialogError},n[12e3]={name:e.ErrorNames.IndexOutOfRange},n[12001]={name:e.ErrorNames.IndexOutOfRange},n[12002]={name:e.ErrorNames.DisplayDialogError},n[12003]={name:e.ErrorNames.DialogNavigateError},n[12004]={name:e.ErrorNames.DisplayDialogError},n[12005]={name:e.ErrorNames.DisplayDialogError},n[12009]={name:e.ErrorNames.DisplayDialogError},n[12011]={name:e.ErrorNames.DisplayDialogError},n[13e3]={name:e.ErrorNames.APINotSupported},n[13001]={name:e.ErrorNames.UserNotSignedIn},n[13002]={name:e.ErrorNames.UserAborted},n[13003]={name:e.ErrorNames.UnsupportedUserIdentity},n[13004]={name:e.ErrorNames.InvalidResourceUrl},n[13005]={name:e.ErrorNames.InvalidGrant},n[13006]={name:e.ErrorNames.SSOClientError},n[13007]={name:e.ErrorNames.SSOServerError},n[13008]={name:e.ErrorNames.AddinIsAlreadyRequestingToken},n[13009]={name:e.ErrorNames.SSOUserConsentNotSupportedByCurrentAddinCategory},n[13010]={name:e.ErrorNames.SSOConnectionLostError},n[13012]={name:e.ErrorNames.APINotSupported},n[13013]={name:e.ErrorNames.APICallFailed},n[5014]={name:e.ErrorNames.OperationCancelledError},r=!0);var i=n[t];return i||(i=n[5001]),i.name||(i.name=n[5001].name),i.message||(i.message=i.name),i},t.addErrorMessage=function(e,t){n[e]=t}}(t.ErrorCodeManager||(t.ErrorCodeManager={}))}(e.DDA||(e.DDA={}))}(OSF||(OSF={})),function(e){e.ErrorNames={AddinIsAlreadyRequestingToken:"AddinIsAlreadyRequestingToken",APICallFailed:"APICallFailed",APINotSupported:"APINotSupported",BindingCreationError:"BindingCreationError",CallbackNotFunction:"CallbackNotFunction",CannotNavigateTo:"CannotNavigateTo",CustomXmlError:"CustomXmlError",CustomXmlExceedQuotaName:"CustomXmlExceedQuota",CustomXmlOutOfDateName:"CustomXmlOutOfDate",DataReadError:"DataReadError",DataWriteError:"DataWriteError",DataWriteReminder:"DataWriteReminder",DialogNavigateError:"DialogNavigateError",DisplayDialogError:"DisplayDialogError",EventRegistrationError:"EventRegistrationError",FormattingReminder:"FormattingReminder",HostError:"HostError",IndexOutOfRange:"IndexOutOfRange",InternalError:"InternalError",InvalidAPICall:"InvalidAPICall",InvalidBinding:"InvalidBinding",InvalidBindingError:"InvalidBindingError",InvalidBindingOperation:"InvalidBindingOperation",InvalidCoercion:"InvalidCoercion",InvalidDataObject:"InvalidDataObject",InvalidFormat:"InvalidFormat",InvalidGrant:"InvalidGrant",InvalidNode:"InvalidNode",InvalidOptionalArgument:"InvalidOptionalArgument",InvalidOrTimedOutSession:"InvalidOrTimedOutSession",InvalidResourceUrl:"InvalidResourceUrl",InvalidValue:"InvalidValue",MemoryLimitExceeded:"MemoryLimitExceeded",MissingParameter:"MissingParameter",MissingRequiredArguments:"MissingRequiredArguments",NavOutOfBounds:"NavOutOfBounds",NetworkProblem:"NetworkProblem",OperationCancelledError:"OperationCancelledError",OutOfRange:"OutOfRange",PermissionDenied:"PermissionDenied",ReadSettingsError:"ReadSettingsError",RedundantCallbackSpecification:"RedundantCallbackSpecification",SaveSettingsError:"SaveSettingsError",SettingsStaleError:"SettingsStaleError",ShuttingDown:"ShuttingDown",SSOClientError:"SSOClientError",SSOConnectionLostError:"SSOConnectionLostError",SSOServerError:"SSOServerError",SSOUserConsentNotSupportedByCurrentAddinCategory:"SSOUserConsentNotSupportedByCurrentAddinCategory",SpecifiedIdNotExist:"SpecifiedIdNotExist",TooManyArguments:"TooManyArguments",TooManyOptionalFunctions:"TooManyOptionalFunctions",TooManyOptionalObjects:"TooManyOptionalObjects",UnsupportedEnumeration:"UnsupportedEnumeration",UnsupportedUserIdentity:"UnsupportedUserIdentity",UserAborted:"UserAborted",UserNotSignedIn:"UserNotSignedIn"}}(OSF||(OSF={})),function(e){var t=function(){function e(e){if(this._eventInfos={},this._queuedEventsArgs={},this._eventHandlers={},this._queuedEventsArgs={},null!=e)for(var t=0;t<e.length;t++)if("string"==typeof e[t]){var n=e[t];this._eventHandlers[n]=[],this._queuedEventsArgs[n]=[]}else{n=e[t].type;this._eventInfos[n]=e[t],this._eventHandlers[n]=[],this._queuedEventsArgs[n]=[]}}return e.prototype.getSupportedEvents=function(){var e=[];for(var t in this._eventHandlers)e.push(t);return e},e.prototype.supportsEvent=function(e){for(var t in this._eventHandlers)if(e==t)return!0;return!1},e.prototype.hasEventHandler=function(e,t){var n=this._eventHandlers[e];if(n&&n.length>0)for(var r=0;r<n.length;r++)if(n[r]===t)return!0;return!1},e.prototype.addEventHandler=function(e,t){if("function"!=typeof t)return!1;var n=this._eventHandlers[e];return!(!n||this.hasEventHandler(e,t))&&(n.push(t),!0)},e.prototype.addEventHandlerAndFireQueuedEvent=function(e,t){var n=this._eventHandlers[e],r=!n||0==n.length,i=this.addEventHandler(e,t);return r&&i&&this.fireQueuedEvent(e),i},e.prototype.removeEventHandler=function(e,t){var n=this._eventHandlers[e];if(n&&n.length>0)for(var r=0;r<n.length;r++)if(n[r]===t)return n.splice(r,1),!0;return!1},e.prototype.clearEventHandlers=function(e){return void 0!==this._eventHandlers[e]&&this._eventHandlers[e].length>0&&(this._eventHandlers[e]=[],!0)},e.prototype.getEventHandlerCount=function(e){return null!=this._eventHandlers[e]?this._eventHandlers[e].length:-1},e.prototype.getEventInfo=function(e){return this._eventInfos[e]},e.prototype.fireEvent=function(e){if(null==e.type)return!1;var t=e.type;if(t&&this._eventHandlers[t]){for(var n=this._eventHandlers[t],r=0;r<n.length;r++)n[r](e);return!0}return!1},e.prototype.fireOrQueueEvent=function(e){if(null==e.type)return!1;var t=e.type;if(t&&this._eventHandlers[t]){var n=this._eventHandlers[t],r=this._queuedEventsArgs[t];return 0==n.length?r.push(e):this.fireEvent(e),!0}return!1},e.prototype.fireQueuedEvent=function(e){if(e&&this._eventHandlers[e]){var t=this._eventHandlers[e],n=this._queuedEventsArgs[e];if(t.length>0){for(var r=t[0];n.length>0;){r(n.shift())}return!0}}return!1},e.prototype.clearQueuedEvent=function(e){e&&this._eventHandlers[e]&&(this._queuedEventsArgs[e]&&(this._queuedEventsArgs[e]=[]))},e}();e.EventDispatch=t}(OSF||(OSF={})),function(e){!function(e){e.dispidEventMin=0,e.dispidInitializeEvent=0,e.dispidSettingsChangedEvent=1,e.dispidDocumentSelectionChangedEvent=2,e.dispidBindingSelectionChangedEvent=3,e.dispidBindingDataChangedEvent=4,e.dispidDocumentOpenEvent=5,e.dispidDocumentCloseEvent=6,e.dispidActiveViewChangedEvent=7,e.dispidDocumentThemeChangedEvent=8,e.dispidOfficeThemeChangedEvent=9,e.dispidDialogMessageReceivedEvent=10,e.dispidDialogNotificationShownInAddinEvent=11,e.dispidDialogParentMessageReceivedEvent=12,e.dispidObjectDeletedEvent=13,e.dispidObjectSelectionChangedEvent=14,e.dispidObjectDataChangedEvent=15,e.dispidContentControlAddedEvent=16,e.dispidLiveShareStateChangedEvent=17,e.dispidActivationStatusChangedEvent=32,e.dispidRichApiMessageEvent=33,e.dispidAppCommandInvokedEvent=39,e.dispidOnSdxSendMessageEvent=40,e.dispidDataNodeAddedEvent=60,e.dispidDataNodeReplacedEvent=61,e.dispidDataNodeDeletedEvent=62}(e.EventDispId||(e.EventDispId={}))}(OSF||(OSF={})),function(e){var t=function(){function t(){}return t.addEventHandler=function(n,r,i,o,a,s){var c=0;function l(t){0==t&&(o.hasEventHandler(n,r)||o.addEventHandler(n,r)||(t=5010));e._OfficeAppFactory.getAsyncMethodExecutor().invokeCallback(c,i,t,null,a)}var u=o.getEventInfo(n);if(u)try{if(s)return void l(0);c=u.id;var f=u.getTargetId();if(0==o.getEventHandlerCount(n))e._OfficeAppFactory.getAsyncMethodExecutor().registerEventAsync(c,u.type,f,(function(e){o.fireEvent(e)}),u,(function(t){l(e.Utility.getErrorCodeFromAsyncResult(t))}),a);else l(0)}catch(e){t.onException(c,e,i)}else l(5010)},t.removeEventHandler=function(n,r,i,o,a,s){var c=0;function l(t){e._OfficeAppFactory.getAsyncMethodExecutor().invokeCallback(c,i,t,null,a)}var u=o.getEventInfo(n);if(u)try{c=u.id;var f=u.getTargetId(),d=0,p=!0;null===r?(p=o.clearEventHandlers(n),d=0):d=(p=o.removeEventHandler(n,r))?0:5003;var m=o.getEventHandlerCount(n);if(p&&0==m)e._OfficeAppFactory.getAsyncMethodExecutor().unregisterEventAsync(c,u.type,f,(function(t){l(e.Utility.getErrorCodeFromAsyncResult(t))}),a);else l(d)}catch(e){t.onException(c,e,i)}else l(5010)},t.onException=function(t,n,r){if("number"!=typeof n)throw n;e._OfficeAppFactory.getAsyncMethodExecutor().invokeCallback(t,r,n,null)},t}();e.EventHelper=t}(OSF||(OSF={})),function(e){!function(e){e.ActiveViewChanged="activeViewChanged",e.AppCommandInvoked="appCommandInvoked",e.RichApiMessage="richApiMessage",e.DocumentSelectionChanged="documentSelectionChanged",e.BindingSelectionChanged="bindingSelectionChanged",e.BindingDataChanged="bindingDataChanged",e.OfficeThemeChanged="officeThemeChanged",e.DocumentThemeChanged="documentThemeChanged",e.LiveShareStateChanged="liveShareStateChanged",e.DataNodeDeleted="nodeDeleted",e.DataNodeInserted="nodeInserted",e.DataNodeReplaced="nodeReplaced",e.DialogMessageReceived="dialogMessageReceived",e.DialogParentMessageReceived="dialogParentMessageReceived",e.DialogParentEventReceived="dialogParentEventReceived",e.DialogEventReceived="dialogEventReceived",e.NodeDeleted="nodeDeleted",e.NodeInserted="nodeInserted",e.NodeReplaced="nodeReplaced",e.SettingsChanged="settingsChanged"}(e.EventType||(e.EventType={}))}(OSF||(OSF={})),function(e){!function(t){var n=function(){function t(){this.platformRemappings={web:Office.PlatformType.OfficeOnline,winrt:Office.PlatformType.Universal,win32:Office.PlatformType.PC,mac:Office.PlatformType.Mac,ios:Office.PlatformType.iOS,android:Office.PlatformType.Android},this.camelCaseMappings={powerpoint:Office.HostType.PowerPoint,onenote:Office.HostType.OneNote},this.hostInfo=e._OfficeAppFactory.getHostInfo()}return t.prototype.capitalizeFirstLetter=function(e){return e?e[0].toUpperCase()+e.slice(1).toLowerCase():e},t.getInstance=function(){return void 0===t.hostObj&&(t.hostObj=new t),t.hostObj},t.prototype.getPlatform=function(e){if(this.hostInfo&&this.hostInfo.hostPlatform){var t=this.hostInfo.hostPlatform.toLowerCase();if(this.platformRemappings[t])return this.platformRemappings[t]}return null},t.prototype.getHost=function(e){if(this.hostInfo&&this.hostInfo.hostType){var t=this.hostInfo.hostType.toLowerCase();if(this.camelCaseMappings[t])return this.camelCaseMappings[t];if(t=this.capitalizeFirstLetter(this.hostInfo.hostType),Office.HostType[t])return Office.HostType[t]}return null},t.prototype.getDefaultVersion=function(){return this.getHost()?"16.0.0000.0000":null},t.prototype.getDiagnostics=function(e){return{host:this.getHost(),version:e||this.getDefaultVersion(),platform:this.getPlatform()}},t}();t.Host=n}(e.HostName||(e.HostName={}))}(OSF||(OSF={})),function(e){!function(e){e[e.SharedApp=1]="SharedApp",e[e.CustomFunction=2]="CustomFunction",e[e.ProtectedDocDisable=4]="ProtectedDocDisable",e[e.ExperimentJsEnabled=8]="ExperimentJsEnabled",e[e.PublicAddin=16]="PublicAddin",e[e.BundleJsEnabled=32]="BundleJsEnabled",e[e.IsMos=64]="IsMos",e[e.IsMonarch=128]="IsMonarch",e[e.CustomFunctionsInitAfterCFRuntimeReady=256]="CustomFunctionsInitAfterCFRuntimeReady"}(e.HostInfoFlags||(e.HostInfoFlags={}))}(OSF||(OSF={})),function(e){!function(e){e.excel="excel",e.word="word"}(e.HostInfoHostType||(e.HostInfoHostType={}))}(OSF||(OSF={})),function(e){!function(e){e.web="web",e.winrt="winrt",e.win32="win32",e.mac="mac",e.ios="ios",e.android="android"}(e.HostInfoPlatform||(e.HostInfoPlatform={}))}(OSF||(OSF={})),function(e){var t=function(){function t(e,t,n,r){this._hostInfo=e,this._webAppState=t,this._context=n,this._hostFacade=r}return t.prototype.saveAndSetDialogInfo=function(e){},t.prototype.setAgaveHostCommunication=function(){},t.prototype.createClientHostController=function(){return null},t.prototype.createAsyncMethodExecutor=function(){return null},t.prototype.createClientSettingsManager=function(){return null},t.prototype.createSettings=function(t){var n=e.OUtil.getSessionStorage();if(n){var r=n.getItem(e._OfficeAppFactory.getCachedSessionSettingsKey());r?t=JSON.parse(r):(r=JSON.stringify(t),n.setItem(e._OfficeAppFactory.getCachedSessionSettingsKey(),r))}var i=e.OUtil.deserializeSettings(t),o=this.createClientSettingsManager();return new Office.Settings(i,o)},t.prototype.prepareApiSurface=function(t){var n=t.get_featureGates();n&&(Microsoft.Office.WebExtension.FeatureGates=n),e.BootStrapExtension.prepareApiSurface&&e.BootStrapExtension.prepareApiSurface(),e.BootStrapExtension.prepareHostSpecificSurface&&e.BootStrapExtension.prepareHostSpecificSurface(),OSFPerformance.createOMEnd=OSFPerformance.now()},t.prototype.getTabbableElements=function(){return null},t.prototype.setupNestedAppAuthDependencies=function(){},t.prototype.setCreateNaaBridge=function(e){this._createNaaBridge=e},t}();e.InitializationHelper=t}(OSF||(OSF={})),function(e){!function(e){e.Inserted="inserted",e.DocumentOpened="documentOpened"}(e.InitializationReason||(e.InitializationReason={}))}(OSF||(OSF={})),OSF||(OSF={}),function(e){var t;e.DisabledChangeGates=[],function(t){var n=0,r="resources.office.net",i="officeapps.live.com";t.getLibraryReleaseVehicle=function(){return n},t.setLibraryReleaseVehicle=function(e){n=e},t.isChangeGateEnabled=function(t){return!e.DisabledChangeGates||-1===e.DisabledChangeGates.indexOf(t)};var o=null,a=null,s=[];function c(){if(!a&&o&&o.officeCdnEndpoint)if(o.officeCdnEndpoint.origin&&o.officeCdnEndpoint.origin.length>0){var e="";e=o.officeCdnEndpoint.isOCDICompliant?"/"===o.officeCdnEndpoint.origin[o.officeCdnEndpoint.origin.length-1]?"beta/":"/beta/":"/"===o.officeCdnEndpoint.origin[o.officeCdnEndpoint.origin.length-1]?"appsforoffice/lib/beta/hosted/":"/appsforoffice/lib/beta/hosted/",a=o.officeCdnEndpoint.origin+e}else{var t=function(e){var t=new URL(e).hostname.toLowerCase();if(-1!==t.indexOf(r,t.length-r.length))return r;if(-1!==t.indexOf(i,t.length-i.length))return i;var n=t.split(".");return n.length<5||"mro1cdnstorage"!==n[1]?void 0:n.slice(2).join(".")}(window.location.href);t&&"public.onecdn.static.microsoft"!==t?"public.cdn.office.net"===t||t===r||t===i?(o.officeCdnEndpoint.isOCDICompliant=!1,o.officeCdnEndpoint.isSovereign=!1,a="https://appsforoffice.microsoft.com/lib/beta/hosted/"):(o.officeCdnEndpoint.isOCDICompliant=!1,o.officeCdnEndpoint.isSovereign=!0,a="https://appsforoffice."+t+"/appsforoffice/lib/beta/hosted/"):(o.officeCdnEndpoint.isOCDICompliant=!0,o.officeCdnEndpoint.isSovereign=!1,a="https://officeapis.public.onecdn.static.microsoft/beta/")}}function l(e){var t=[];return Array.isArray(e)?(e.forEach((function(e){if("string"==typeof e){e=e.toLowerCase();try{var n=new URL(e);if("https:"===n.protocol){var r=n.hostname;-1===t.indexOf(r)&&t.push(r)}}catch(e){}}})),t):t}function u(){if(!e.OUtil.isChangeGateEnabled("Microsoft.Office.SharedOnline.ChangeGate.OfficeVSO_10910853_OfficeJsNPMDownloadTrustedDomainList"))return"object"==typeof officeInitializationSettings&&officeInitializationSettings?officeInitializationSettings:{};if(!o){var t="officeInitializationSettings";if(window.hasOwnProperty(t)){var n=window.officeInitializationSettings;"object"==typeof n&&null!==n&&(o=n)}1!==e.OUtil.getLibraryReleaseVehicle()?o?(o.officeCdnEndpoint={},s=l(o.addinTrustedOrigins)):o={trustAllCloudEnvironments:!1,officeCdnEndpoint:{},addinTrustedOrigins:[]}:(o?(o.trustAllCloudEnvironments=!1,o.officeCdnEndpoint&&"object"==typeof o.officeCdnEndpoint||(o.officeCdnEndpoint={origin:"",isSovereign:!1,isOCDICompliant:!1,isSdx:!1,trustedTypesOptIn:!1}),"string"==typeof o.officeCdnEndpoint.origin?o.officeCdnEndpoint.origin=o.officeCdnEndpoint.origin.trim():o.officeCdnEndpoint.origin="",s=l(o.addinTrustedOrigins)):o={trustAllCloudEnvironments:!1,officeCdnEndpoint:{origin:"",isSovereign:!1,isOCDICompliant:!1,isSdx:!1,trustedTypesOptIn:!1},addinTrustedOrigins:[]},c())}return o}t.isHostNameInAddinTrustedDomains=function(e){return!!e&&(u(),!!s&&-1!==s.indexOf(e.toLowerCase()))},t.getCustomOfficeInitializationSettings=u,t.getAppsForOfficeBaseForNpm=function(){return a||u(),a||""}}(t=e.OUtil||(e.OUtil={})),function(n){var r,i=null,o=!1,a=["excel","word","powerpoint","onenote","outlook","visio","office-common","office.common","office","officebase"],s=[".js",".debug.js"],c="_osfDisableHostCheck",l=function(){try{return document.currentScript}catch(e){return null}}();function u(){return 1===e.OUtil.getLibraryReleaseVehicle()?e.OUtil.getCustomOfficeInitializationSettings().officeCdnEndpoint.trustedTypesOptIn:(d(),r.trustedTypesOptIn)}function f(e,t){var n=null!=e?e.src:null;if(!n)return null;var r=n.toLowerCase(),i="",o=!1,a=!0,s=void 0,c=!1;if(t){var l=r.indexOf(t);if(!(l>=0)||0!==l&&"/"!==n.charAt(l-1)&&"\\"!==n.charAt(l-1)||l+t.length!==n.length&&"?"!==n.charAt(l+t.length))a=!1;else{i=n.substring(0,l),o=r.indexOf(".debug.js",l)>0;var u=e.getAttribute("data-is-sdx");c="1"===u||"true"===u;var f=e.getAttribute("data-enable-trusted-types");s=null!=f?"1"===f||"true"===f:void 0}}return a?{basePath:i,name:t||"",isDebugJs:o,isSdx:c,trustedTypesOptIn:s}:null}function d(){if(!r){if(e.OUtil.isChangeGateEnabled("Microsoft.Office.SharedOnline.ChangeGate.OfficeVSO_10910853_OfficeJsNPMDownloadTrustedDomainList")){var t=function(e){for(var t=0;t<a.length;t++)for(var n=0;n<s.length;n++){var r=f(e,a[t]+s[n]);if(r)return r}return null};if(1===e.OUtil.getLibraryReleaseVehicle())return void(r={basePath:"",name:"",isDebugJs:!1,isSdx:!1,trustedTypesOptIn:!1});if(r=t(l))return;for(var n=document.getElementsByTagName("script"),i=n.length,o=0;o<i;o++)if(r=t(n[o]))return}else{var c=function(e){var t=null!=e?e.src:null;if(!t)return null;for(var n=t.toLowerCase(),r=0;r<a.length;r++)for(var i=0;i<s.length;i++){var o=a[r]+s[i],c=n.indexOf(o);if(c>=0&&(0===c||"/"===t.charAt(c-1)||"\\"===t.charAt(c-1))&&(c+o.length===t.length||"?"===t.charAt(c+o.length))){var l=t.substring(0,c),u=n.indexOf(".debug.js",c)>0,f=e.getAttribute("data-is-sdx"),d="1"===f||"true"===f,p=e.getAttribute("data-enable-trusted-types");return{basePath:l,name:o,isDebugJs:u,isSdx:d,trustedTypesOptIn:null!=p?"1"===p||"true"===p:void 0}}}return null};if(r=c(l))return;var u=document.getElementsByTagName("script"),d=u.length;for(o=0;o<d;o++)if(r=c(u[o]))return}r={basePath:"",name:"",isDebugJs:!1,isSdx:!1,trustedTypesOptIn:!1}}}n.getHostBundleJsBasePath=function(){return e.OUtil.isChangeGateEnabled("Microsoft.Office.SharedOnline.ChangeGate.OfficeVSO_10910853_OfficeJsNPMDownloadTrustedDomainList")&&1===e.OUtil.getLibraryReleaseVehicle()?e.OUtil.getAppsForOfficeBaseForNpm():(d(),r.basePath)},n.getHostBundleJsName=function(){return d(),r.name},n.getOfficeStringJsName=function(){return d(),r.isDebugJs?e.ConstantNames.OfficeStringDebugJS:e.ConstantNames.OfficeStringJS},n.isSdx=function(){return 1===e.OUtil.getLibraryReleaseVehicle()?e.OUtil.getCustomOfficeInitializationSettings().officeCdnEndpoint.isSdx:(d(),r.isSdx)},n.setIsSdx=function(t){1===e.OUtil.getLibraryReleaseVehicle()&&(e.OUtil.getCustomOfficeInitializationSettings().officeCdnEndpoint.isSdx=t)},n.disableHostCheck=function(){return d(),window.hasOwnProperty(c)&&!0===window._osfDisableHostCheck},n.getTrustedTypesOptIn=u,n.loadScriptWithBasename=function(e,n,i){d();var o=e+(r.isDebugJs?".debug.js":".js");o=o.toLowerCase();var a=r.basePath+o;t.loadScript(a,n,m())};var p=["https://alcdn.msauth.net/browser-1p/2.28.1/js/msal-browser-1p.min.js"];function m(){if(!o){o=!0;try{var t=u();if(!(null!=t?t:e.OUtil.isSecureDefaultsEnabled())||!window.trustedTypes||!window.trustedTypes.createPolicy)return null;var n=l.src,r=new URL(n).origin.toLowerCase();if(!r)return null;i=window.trustedTypes.createPolicy("officejs",{createScriptURL:function(e){var t=e.toLowerCase(),n=new URL(t).origin;if(r&&r===n)return e;for(var i=0,o=p;i<o.length;i++){if(t===o[i])return e}throw new Error("Untrusted script URL")}})}catch(e){}}return i}n.getTrustedTypesPolicy=m}(e.LoadScriptHelper||(e.LoadScriptHelper={}))}(OSF||(OSF={})),function(e){var t;!function(e){e[e.MaxLiveShareStateDataSizeInBytes=1024]="MaxLiveShareStateDataSizeInBytes"}(t=e.LiveShareStateParams||(e.LiveShareStateParams={}));var n=function(){function e(e){var t=this;e=e||null,this._liveShareState=e,this._eventDispatch=new OSF.EventDispatch([{id:OSF.EventDispId.dispidLiveShareStateChangedEvent,type:OSF.EventType.LiveShareStateChanged,getTargetId:function(){return""},fromSafeArrayHost:function(e){return{type:OSF.EventType.LiveShareStateChanged,liveShareState:t}},fromWebHost:function(e){return{type:OSF.EventType.LiveShareStateChanged,liveShareState:t}}}])}return e.prototype.get=function(){return this._liveShareState},e.prototype.set=function(e){if((new TextEncoder).encode(e).length>t.MaxLiveShareStateDataSizeInBytes)throw new Error("State data size is limited to "+t.MaxLiveShareStateDataSizeInBytes+" bytes.");this._liveShareState=e},e.prototype.addHandlerAsync=function(e,t,n){OSF.EventHelper.addEventHandler(e,t,n,this._eventDispatch)},e.prototype.removeHandlerAsync=function(e,t,n){OSF.EventHelper.removeEventHandler(e,t,n,this._eventDispatch)},e}();e.LiveShareState=n}(Office||(Office={})),function(e){var t={"ar-sa":!0,"bg-bg":!0,"bn-in":!0,"ca-es":!0,"cs-cz":!0,"da-dk":!0,"de-de":!0,"el-gr":!0,"en-us":!0,"es-es":!0,"et-ee":!0,"eu-es":!0,"fa-ir":!0,"fi-fi":!0,"fr-fr":!0,"gl-es":!0,"he-il":!0,"hi-in":!0,"hr-hr":!0,"hu-hu":!0,"id-id":!0,"it-it":!0,"ja-jp":!0,"kk-kz":!0,"ko-kr":!0,"lo-la":!0,"lt-lt":!0,"lv-lv":!0,"ms-my":!0,"nb-no":!0,"nl-nl":!0,"nn-no":!0,"pl-pl":!0,"pt-br":!0,"pt-pt":!0,"ro-ro":!0,"ru-ru":!0,"sk-sk":!0,"sl-si":!0,"sr-cyrl-cs":!0,"sr-cyrl-rs":!0,"sr-latn-cs":!0,"sr-latn-rs":!0,"sv-se":!0,"th-th":!0,"tr-tr":!0,"uk-ua":!0,"ur-pk":!0,"vi-vn":!0,"zh-cn":!0,"zh-tw":!0},n={ar:"ar-sa",bg:"bg-bg",bn:"bn-in",ca:"ca-es",cs:"cs-cz",da:"da-dk",de:"de-de",el:"el-gr",en:"en-us",es:"es-es",et:"et-ee",eu:"eu-es",fa:"fa-ir",fi:"fi-fi",fr:"fr-fr",gl:"gl-es",he:"he-il",hi:"hi-in",hr:"hr-hr",hu:"hu-hu",id:"id-id",it:"it-it",ja:"ja-jp",kk:"kk-kz",ko:"ko-kr",lo:"lo-la",lt:"lt-lt",lv:"lv-lv",ms:"ms-my",nb:"nb-no",nl:"nl-nl",nn:"nn-no",pl:"pl-pl",pt:"pt-br",ro:"ro-ro",ru:"ru-ru",sk:"sk-sk",sl:"sl-si",sr:"sr-cyrl-cs",sv:"sv-se",th:"th-th",tr:"tr-tr",uk:"uk-ua",ur:"ur-pk",vi:"vi-vn",zh:"zh-cn"};e.getSupportedLocale=function(e,r){if(void 0===r&&(r="en-us"),!e)return r;var i;if((e=e.toLowerCase())in t)i=e;else{var o=e.split("-",1);o&&o.length>0&&(i=n[o[0]])}return i||(i=r),i}}(OSF||(OSF={})),function(e){e.OfficeOM||(e.OfficeOM={})}(Strings||(Strings={})),function(e){!function(t){var n;t.ensureOfficeStringsJs=function(){return n||(n=1==e.OUtil.getLibraryReleaseVehicle()?new Office.Promise((function(e,t){e()})):new Office.Promise((function(n,r){if(e.OUtil.isChangeGateEnabled("Microsoft.Office.SharedOnline.ChangeGate.OfficeVSO_9441111_DefaultLocaleOfficeStrings")){var i=e.LoadScriptHelper.getHostBundleJsBasePath()+e.ConstantNames.DefaultLocale+"/"+e.LoadScriptHelper.getOfficeStringJsName();e.OUtil.loadScript(i,(function(t){t?n():r(new Error("Cannot load "+e.ConstantNames.OfficeStringJS))}),e.LoadScriptHelper.getTrustedTypesPolicy())}else{if(!e._OfficeAppFactory.getHostInfo().hostLocale)return void r(new Error("No host locale"));i=e.LoadScriptHelper.getHostBundleJsBasePath()+e._OfficeAppFactory.getHostInfo().hostLocale+"/"+e.LoadScriptHelper.getOfficeStringJsName();e.OUtil.loadScript(i,(function(i){if(i)n();else{var o=e.LoadScriptHelper.getHostBundleJsBasePath()+e.ConstantNames.DefaultLocale+"/"+e.LoadScriptHelper.getOfficeStringJsName();t.loadScript(o,(function(t){t?n():r(new Error("Cannot load "+e.ConstantNames.OfficeStringJS))}),e.LoadScriptHelper.getTrustedTypesPolicy())}}),e.LoadScriptHelper.getTrustedTypesPolicy())}}))),n}}(e.OUtil||(e.OUtil={}))}(OSF||(OSF={})),function(e){!function(t){!function(t){var n;OSF.definePropertyOnNamespace(t,"url",(function(){return OSF._OfficeAppFactory.getOfficeAppContext().get_docUrl()})),OSF.definePropertyOnNamespace(t,"mode",(function(){return 0==OSF._OfficeAppFactory.getOfficeAppContext().get_clientMode()?e.DocumentMode.ReadOnly:e.DocumentMode.ReadWrite})),OSF.definePropertyOnNamespace(t,"settings",(function(){if(!n){var e=OSF._OfficeAppFactory.getOfficeAppContext().get_settingsFunc()();n=OSF._OfficeAppFactory.getInitializationHelper().createSettings(e)}return n})),t.goToByIdAsync=function(t,n,r,i){var o={};o[e.GoToType.Binding]=0,o[e.GoToType.NamedItem]=1,o[e.GoToType.Slide]=2,o[e.GoToType.Index]=3;var a={};a[e.SelectionMode.Default]=0,a[e.SelectionMode.Selected]=1,a[e.SelectionMode.None]=2;var s=o[n],c=0,l=i;"function"==typeof r?l=r:void 0!==r&&(c=a[r]);var u={toSafeArrayHost:function(){return[t,s,c]},fromSafeArrayHost:function(e){return e},toWebHost:function(){return{DdaGoToByIdMethod:{Id:t,GoToType:s,SelectionMode:c}}},fromWebHost:function(e){return e}};OSF._OfficeAppFactory.getAsyncMethodExecutor().executeAsync(82,u,l)}}(t.document||(t.document={}))}(e.context||(e.context={}))}(Office||(Office={})),function(e){!function(e){!function(e){e.sendMessage=function(e){if(OSF._OfficeAppFactory.getHostInfo().hostPlatform==OSF.HostInfoPlatform.web){var t=OSF._OfficeAppFactory.getWebAppState();t.clientEndPoint.invoke("ContextActivationManager_notifyHost",null,[t.id,OSF.AgaveHostAction.SendMessage,e])}else{var n=JSON.stringify(e);OSF._OfficeAppFactory.getClientHostController().execute(208,[n],null)}},e.registerOnMessageEventHandler=function(t){if(OSF._OfficeAppFactory.getHostInfo().hostPlatform==OSF.HostInfoPlatform.web)e.onMessage=t;else{OSF._OfficeAppFactory.getClientHostController().registerEvent(OSF.EventDispId.dispidOnSdxSendMessageEvent,"","",(function(e,n){var r=n.toArray();t(JSON.parse(r[0]))}),null)}}}(e.messaging||(e.messaging={}))}(e.context||(e.context={}))}(Office||(Office={})),function(e){!function(t){var n,r;OSF.definePropertyOnNamespace(t,"contentLanguage",(function(){return OSF._OfficeAppFactory.getOfficeAppContext().get_dataLocale()})),OSF.definePropertyOnNamespace(t,"displayLanguage",(function(){return OSF._OfficeAppFactory.getOfficeAppContext().get_appUILocale()})),OSF.definePropertyOnNamespace(t,"partitionKey",(function(){return OSF._OfficeAppFactory.getOfficeAppContext().get_partitionKey()})),OSF.definePropertyOnNamespace(t,"isDialog",(function(){return OSF._OfficeAppFactory.getHostInfo().isDialog})),OSF.definePropertyOnNamespace(t,"touchEnabled",(function(){return OSF._OfficeAppFactory.getOfficeAppContext().get_touchEnabled()})),OSF.definePropertyOnNamespace(t,"commerceAllowed",(function(){return OSF._OfficeAppFactory.getOfficeAppContext().get_commerceAllowed()})),OSF.definePropertyOnNamespace(t,"host",(function(){return OSF.HostName.Host.getInstance().getHost()})),OSF.definePropertyOnNamespace(t,"platform",(function(){return OSF.HostName.Host.getInstance().getPlatform()})),OSF.definePropertyOnNamespace(t,"diagnostics",(function(){return OSF.HostName.Host.getInstance().getDiagnostics(OSF._OfficeAppFactory.getOfficeAppContext().get_hostFullVersion())})),OSF.definePropertyOnNamespace(t,"requirements",(function(){if(!n){var e=OSF._OfficeAppFactory.getOfficeAppContext();e&&(n=e.get_isDialog()?OSF.Requirement.RequirementsMatrixFactory.getDefaultDialogRequirementMatrix(e):OSF.Requirement.RequirementsMatrixFactory.getDefaultRequirementMatrix(e))}return n})),OSF.definePropertyOnNamespace(t,"officeTheme",(function(){var e=OSF._OfficeAppFactory.getOfficeAppContext().get_officeThemeFunc();return e?"function"==typeof e?e():e:void 0})),OSF.definePropertyOnNamespace(t,"webAuth",(function(){if(OSF.DDA.WebAuth)return OSF.DDA.WebAuth})),OSF.definePropertyOnNamespace(t,"auth",(function(){if(OSF.DDA.Auth)return OSF.DDA.Auth})),OSF.definePropertyOnNamespace(t,"license",(function(){return OSF._OfficeAppFactory.getOfficeAppContext().get_eToken()})),OSF.definePropertyOnNamespace(t,"hostSettings",(function(){if(!r){var t=OSF._OfficeAppFactory.getOfficeAppContext().get_hostSettingsFunc();if(void 0!==t){var n=t(),i=OSF.OUtil.deserializeSettings(n);r=new e.Settings(i,void 0)}}return r}))}(e.context||(e.context={}))}(Office||(Office={})),function(e){!function(e){!function(e){e.refreshRibbon=function(e){OSF.getClientEndPoint().invoke("ContextActivationManager_notifyHost",null,[OSF._OfficeAppFactory.getWebAppState().id,OSF.AgaveHostAction.RefreshRibbonGallery,e])}}(e.ribbonGallery||(e.ribbonGallery={}))}(e.context||(e.context={}))}(Office||(Office={})),function(e){!function(e){!function(e){e.taskPaneAction||(e.taskPaneAction={})}(e.ui||(e.ui={}))}(e.context||(e.context={}))}(Office||(Office={}));var __assign=this&&this.__assign||function(){return(__assign=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};!function(e){function t(){e._officeOnReadyState.officeOnReadyPromise||(e._officeOnReadyState.officeOnReadyPromise=new e.Promise((function(t,n){e._officeOnReadyState.officeOnReadyPromiseResolve=t,e._officeOnReadyState.officeOnReadyPromiseReject=n})))}function n(){if(!e._officeOnReadyState.onReadyAllowsRejection||!e._officeOnReadyState.officeOnReadyRejected){for(OSFPerformance.officeOnReady||(OSFPerformance.officeOnReady=OSFPerformance.now()),e._officeOnReadyState.officeOnReadyPromiseResolve(e._officeOnReadyState.officeOnReadyHostAndPlatformInfo),e._officeOnReadyState.officeOnReadyPromiseReject=null;e._officeOnReadyState.officeOnReadyExternalCallbacks.length>0;)e._officeOnReadyState.officeOnReadyExternalCallbacks.shift()(e._officeOnReadyState.officeOnReadyHostAndPlatformInfo);e._officeOnReadyState.isOfficeOnReadyCalled||OSF.OUtil.waitForFunction((function(){return"function"==typeof e.initialize}),(function(t){t&&e.initialize(OSF._OfficeAppFactory.getOfficeAppContext().get_reason())}),400,50)}}function r(n,r){t();var i=e._officeOnReadyState.officeOnReadyFired&&(!r||0===Object.keys(e._officeOnReadyState.heldLocks).length);return r&&e._officeOnReadyState.onReadyAllowsRejection&&e._officeOnReadyState.officeOnReadyRejected||n&&(i?n(e._officeOnReadyState.officeOnReadyHostAndPlatformInfo):r?e._officeOnReadyState.officeOnReadyExternalCallbacks.push(n):e._officeOnReadyState.officeOnReadyInternalCallbacks.push(n)),e._officeOnReadyState.officeOnReadyPromise}e.OnReadyLockId=e.OnReadyLockId||{CustomFunctionsRuntimeReady:"CustomFunctionsRuntimeReady"},e._officeOnReadyState=e._officeOnReadyState||{isOfficeOnReadyCalled:!1,officeOnReadyPromise:null,officeOnReadyPromiseResolve:null,officeOnReadyPromiseReject:null,officeOnReadyInternalCallbacks:[],officeOnReadyExternalCallbacks:[],officeOnReadyHostAndPlatformInfo:null,officeOnReadyFired:!1,officeOnReadyRejected:!1,officeOnReadyRejectionError:null,heldLocks:{},onReadyAllowsRejection:!1},e.initialize=e.initialize,e.onReadyInternal=function(e){return r(e,!1)},e.onReady=function(t){return e._officeOnReadyState.isOfficeOnReadyCalled=!0,r(t,!0)},e.onReadyOptions=e.onReadyOptions||{setRejectionEnabled:function(){e._officeOnReadyState.onReadyAllowsRejection=!0}},e.rejectOfficeOnReady=function(n){e._officeOnReadyState.officeOnReadyRejected||(e._officeOnReadyState.officeOnReadyRejectionError=n,e._officeOnReadyState.officeOnReadyRejected=!0,e._officeOnReadyState.onReadyAllowsRejection&&(t(),e._officeOnReadyState.officeOnReadyPromiseReject&&(e._officeOnReadyState.officeOnReadyPromiseReject(n),e._officeOnReadyState.officeOnReadyExternalCallbacks=[])))},e.fireOnReady=function(r){t(),e._officeOnReadyState.officeOnReadyHostAndPlatformInfo=__assign({},r),e._officeOnReadyState.officeOnReadyFired=!0,function(){for(;e._officeOnReadyState.officeOnReadyInternalCallbacks.length>0;)e._officeOnReadyState.officeOnReadyInternalCallbacks.shift()(e._officeOnReadyState.officeOnReadyHostAndPlatformInfo)}(),Object.keys(e._officeOnReadyState.heldLocks).length>0||n()},e.acquireOnReadyLock=function(t){return Object.keys(e.OnReadyLockId).some((function(n){return e.OnReadyLockId[n]===t}))?(e._officeOnReadyState.heldLocks[t]=!0,t):null},e.releaseOnReadyLock=function(t){e._officeOnReadyState.heldLocks[t]&&(delete e._officeOnReadyState.heldLocks[t],0===Object.keys(e._officeOnReadyState.heldLocks).length&&e._officeOnReadyState.officeOnReadyPromise&&e._officeOnReadyState.officeOnReadyFired&&n())}}(Office||(Office={})),function(e){var t=function(){function t(t,n,r,i,o,a,s,c,l,u,f,d,p,m,g,h,y,v,O,S,b,_,A,C,P,E,I,w,T,D,x,F,M,N){this._id=t,this._appName=n,this._appVersion=r,this._appUILocale=i,this._dataLocale=o,this._docUrl=a,this._clientMode=s,this._settingsFunc=c,this._reason=l,this._osfControlType=u,this._eToken=f,this._correlationId=d,this._appInstanceId=p,this._touchEnabled=m,this._commerceAllowed=g,this._appMinorVersion=h,this._requirementMatrix=y,this._hostCustomMessage=v,this._hostFullVersion=O,this._isDialog=e.OUtil.isDialog(),this._clientWindowHeight=S,this._clientWindowWidth=b,this._addinName=_,this._appDomains=A,this._dialogRequirementMatrix=C,this._featureGates=P,this._officeThemeFunc=E,this._initialDisplayMode=I,this._isFromWacAutomation=w,this._wopiHostOriginForSingleSignOn=T,this._hostSettingsFunc=D,this._isWeb=x,this._nestedAppAuthBridgeType=F,this._partitionKey=M,this._topFrameOrigin=N}return t.prototype.get_id=function(){return this._id},t.prototype.get_appName=function(){return this._appName},t.prototype.get_appVersion=function(){return this._appVersion},t.prototype.get_appUILocale=function(){return this._appUILocale},t.prototype.get_dataLocale=function(){return this._dataLocale},t.prototype.get_docUrl=function(){return this._docUrl},t.prototype.get_clientMode=function(){return this._isWeb?this._clientMode:0==this._clientMode?Office.DocumentMode.ReadWrite:Office.DocumentMode.ReadOnly},t.prototype.get_settingsFunc=function(){return this._settingsFunc},t.prototype.get_reason=function(){return this._reason},t.prototype.get_osfControlType=function(){return this._osfControlType},t.prototype.get_eToken=function(){return this._eToken},t.prototype.get_correlationId=function(){return this._correlationId},t.prototype.get_appInstanceId=function(){return this._appInstanceId},t.prototype.get_touchEnabled=function(){return this._touchEnabled},t.prototype.get_commerceAllowed=function(){return this._commerceAllowed},t.prototype.get_appMinorVersion=function(){return this._appMinorVersion},t.prototype.get_requirementMatrix=function(){return this._requirementMatrix},t.prototype.get_dialogRequirementMatrix=function(){return this._dialogRequirementMatrix},t.prototype.get_hostCustomMessage=function(){return this._hostCustomMessage},t.prototype.get_hostFullVersion=function(){return this._hostFullVersion},t.prototype.get_isDialog=function(){return this._isDialog},t.prototype.get_clientWindowHeight=function(){return this._clientWindowHeight},t.prototype.get_clientWindowWidth=function(){return this._clientWindowWidth},t.prototype.get_addinName=function(){return this._addinName},t.prototype.get_appDomains=function(){return this._appDomains},t.prototype.get_taskpaneUrl=function(){return this._taskpaneUrl},t.prototype.set_taskpaneUrl=function(e){this._taskpaneUrl=e},t.prototype.get_featureGates=function(){return this._featureGates},t.prototype.get_officeThemeFunc=function(){return this._officeThemeFunc},t.prototype.get_initialDisplayMode=function(){return this._initialDisplayMode?this._initialDisplayMode:0},t.prototype.get_isFromWacAutomation=function(){return this._isFromWacAutomation},t.prototype.get_wopiHostOriginForSingleSignOn=function(){return this._wopiHostOriginForSingleSignOn},t.prototype.get_hostSettingsFunc=function(){return this._hostSettingsFunc},t.prototype.get_isWeb=function(){return this._isWeb},t.prototype.get_nestedAppAuthBridgeType=function(){return this._nestedAppAuthBridgeType},t.prototype.get_partitionKey=function(){return this._partitionKey},t.prototype.get_topFrameOrigin=function(){return this._topFrameOrigin},t}();e.OfficeAppContext=t}(OSF||(OSF={})),function(e){!function(t){t.retrieveHostInfo=function(){var t={isO15:!0,isRichClient:!0,hostType:"",hostPlatform:"",hostSpecificFileVersion:"",hostLocale:"",osfControlAppCorrelationId:"",isDialog:!1,disableLogging:!1,flags:0},n="_host_Info",r=null;try{if(window.external=window.external||{},"undefined"!=typeof agaveHost&&agaveHost.GetHostInfo&&(window.external.GetHostInfo=function(){return agaveHost.GetHostInfo()}),window.external.GetHostInfo){var i=window.external.GetHostInfo();if("isDialog"==i)t.isO15=!0,t.isDialog=!0;else{var o=i.split("_host_Info=");r=o.length>1?o[1]:i}}}catch(t){e.Utility.log(JSON.stringify(t))}if(!r)try{var a=window.name;if(a){var s=JSON.parse(a);r=s?s.hostInfo:null}}catch(t){e.Utility.log(JSON.stringify(t))}r||(r=e.Utility.getQueryStringValue(n));var c=e.OUtil.getSessionStorage();if(!r&&c.getItem("hostInfoValue")&&(r=c.getItem("hostInfoValue")),r){r=decodeURIComponent(r),t.isO15=!1;var l=r.split("$");void 0===l[2]&&(l=r.split("|")),t.hostType=void 0===l[0]?"":l[0].toLowerCase(),t.hostPlatform=void 0===l[1]?"":l[1].toLowerCase(),t.hostSpecificFileVersion=void 0===l[2]?"":l[2].toLowerCase(),t.hostLocale=void 0===l[3]?"":l[3].toLowerCase(),t.osfControlAppCorrelationId=void 0===l[4]?"":l[4],"telemetry"==t.osfControlAppCorrelationId&&(t.osfControlAppCorrelationId=""),t.isDialog=void 0!==l[5]&&"isDialog"==l[5],t.disableLogging=void 0!==l[6]&&"disableLogging"==l[6],t.flags="string"==typeof l[7]&&l[7].length>0?parseInt(l[7]):0,c.setItem("hostInfoValue",r)}else t.isO15=!0,t.hostLocale=e.Utility.getQueryStringValue("locale");return t}}(e._OfficeAppFactory||(e._OfficeAppFactory={}))}(OSF||(OSF={})),function(e){var t;!function(t){var n,r,i,o,a,s,c,l,u;"undefined"!=typeof window&&(window.location&&(n=window.location.hash,r=window.location.search),i=window.name);var f={0:"Unknown",1:"Hidden",2:"Taskpane",3:"Dialog"};function d(t,n){e.AppCommandManager.initialize();var r=t.get_appName(),i=null;0!=(o.flags&e.HostInfoFlags.SharedApp)&&(i={visibilityMode:f[t.get_initialDisplayMode()]});var s={host:e.HostName.Host.getInstance().getHost(r),platform:e.HostName.Host.getInstance().getPlatform(r),addin:i};0==(o.flags&e.HostInfoFlags.CustomFunctionsInitAfterCFRuntimeReady)||0==(o.flags&e.HostInfoFlags.CustomFunction)||t.get_isDialog()||"function"==typeof Office.acquireOnReadyLock&&Office.OnReadyLockId,o.hostPlatform!=e.HostInfoPlatform.web||Microsoft.Office.WebExtension.Interactive||(Microsoft.Office.WebExtension.Interactive=function(t){null!=a.clientEndPoint&&a.clientEndPoint.invoke("ContextActivationManager_notifyHost",null,[a.id,e.AgaveHostAction.Interactive,{isInteractive:t,timestamp:Date.now()}])}),Office.fireOnReady(s),o.hostPlatform==e.HostInfoPlatform.web&&null!=a.clientEndPoint&&a.clientEndPoint.invoke("ContextActivationManager_notifyHost",null,[a.id,e.AgaveHostAction.OfficeJsReady,Date.now()]),n(t)}function p(t,n,r,i){var o={schemaVersion:1,libraryVersion:i,timestamp:Date.now()};try{if(t==e.HostInfoPlatform.web)null!=n.clientEndPoint&&n.clientEndPoint.invoke("ContextActivationManager_notifyHost",null,[n.id,e.AgaveHostAction.OfficeJsRuntimeInfo,o]);else if(r&&e.Utility.externalNativeFunctionExists(typeof r.GetContext)){var a=r.GetContext();a&&e.Utility.externalNativeFunctionExists(typeof a.NotifyOfficeJsRuntimeInfo)&&a.NotifyOfficeJsRuntimeInfo(JSON.stringify(o))}}catch(e){}}t.bootstrap=function(n,r){if(a={id:null,webAppUrl:null,conversationID:null,clientEndPoint:null,wnd:window.parent,focused:!1,serviceEndPoint:null},o=t.retrieveHostInfo(),function(){!0;try{if(o.disableLogging)return void!1;window.external=window.external||{},void 0===window.external.GetLoggingAllowed||window.external.GetLoggingAllowed()}catch(e){}}(),function(){if(o.hostPlatform===e.HostInfoPlatform.web)s=new e.WebInitializationHelper(o,a,null,null);else if(o.hostPlatform===e.HostInfoPlatform.win32)s=new e.RichClientInitializationHelper(o,a,null,null);else if(o.hostPlatform===e.HostInfoPlatform.ios||o.hostPlatform===e.HostInfoPlatform.mac){if(!(window.webkit&&window.webkit.messageHandlers&&window.webkit.messageHandlers.Agave))throw e.Utility.createNotImplementedException();s=new e.WebkitInitializationHelper(o,a,null,null)}else o.hostPlatform===e.HostInfoPlatform.android||o.hostPlatform===e.HostInfoPlatform.winrt?s=new e.WebViewInitializationHelper(o,a,null,null):console.warn("Office.js is loaded inside in unknown host or platform "+o.hostPlatform)}(),s){o.hostPlatform===e.HostInfoPlatform.web&&s.saveAndSetDialogInfo(e.Utility.getQueryStringValue("_host_Info")),s.setAgaveHostCommunication(),p(o.hostPlatform,a,window.external,e.ConstantNames.FileVersion),s.setupNestedAppAuthDependencies(),OSFPerformance.getAppContextStart=OSFPerformance.now();s.getAppContext(window,(function(t){OSFPerformance.getAppContextEnd=OSFPerformance.now(),e.AppTelemetry.initialize(t),l=t,u=s.createClientHostController(),c=s.createAsyncMethodExecutor(),s.prepareApiSurface(t),e.BootStrapExtension.onGetAppContext?e.BootStrapExtension.onGetAppContext(t,a.wnd).then((function(){d(t,n)})):d(t,n)}),(function(e){r(e)}))}else r(new Error("Office.js cannot be initialized."))},t.notifyHostOfficeJsRuntimeInfo=p,t.getWindowName=function(){return i},t.getWindowLocationHash=function(){return n},t.getWindowLocationSearch=function(){return r},t.getAsyncMethodExecutor=function(){return c},t.getOfficeAppContext=function(){return l},t.getHostInfo=function(){return o},t.getCachedSessionSettingsKey=function(){return(null!=a.conversationID?a.conversationID:l.get_appInstanceId())+"CachedSessionSettings"},t.getWebAppState=function(){return a},t.getId=function(){return a.id},t.getInitializationHelper=function(){return s},t.getClientHostController=function(){return u}}(t=e._OfficeAppFactory||(e._OfficeAppFactory={})),e.getClientEndPoint=function(){return t.getWebAppState().clientEndPoint}}(OSF||(OSF={})),function(e){!function(e){e.Succeeded="succeeded",e.Failed="failed"}(e.AsyncResultStatus||(e.AsyncResultStatus={})),function(e){e.ReadOnly="readOnly",e.ReadWrite="readWrite"}(e.DocumentMode||(e.DocumentMode={})),function(e){e.Word="Word",e.Excel="Excel",e.PowerPoint="PowerPoint",e.Outlook="Outlook",e.OneNote="OneNote",e.Project="Project",e.Access="Access",e.Visio="Visio"}(e.HostType||(e.HostType={})),function(e){e.Inserted="inserted",e.DocumentOpened="documentOpened"}(e.InitializationReason||(e.InitializationReason={})),function(e){e.PC="PC",e.OfficeOnline="OfficeOnline",e.Mac="Mac",e.iOS="iOS",e.Android="Android",e.Universal="Universal"}(e.PlatformType||(e.PlatformType={})),function(e){e.Binding="binding",e.NamedItem="namedItem",e.Slide="slide",e.Index="index"}(e.GoToType||(e.GoToType={})),function(e){e.Default="default",e.Selected="selected",e.None="none"}(e.SelectionMode||(e.SelectionMode={})),function(e){e.Unformatted="unformatted",e.Formatted="formatted"}(e.ValueFormat||(e.ValueFormat={})),function(e){e.Text="text",e.Compressed="compressed",e.Pdf="pdf"}(e.FileType||(e.FileType={})),e.CoercionType={Html:"html",Matrix:"matrix",Ooxml:"ooxml",OoxmlPackage:"ooxmlPackage",PdfFile:"pdfFile",SlideRange:"slideRange",Table:"table",Text:"text"},function(e){e.Table="table",e.Text="text",e.Matrix="matrix"}(e.BindingType||(e.BindingType={})),function(e){e.OnlyVisible="onlyVisible",e.All="all"}(e.FilterType||(e.FilterType={})),function(e){e[e.All=0]="All",e[e.Data=1]="Data",e[e.Headers=2]="Headers"}(e.Table||(e.Table={})),function(e){e.Read="read",e.Edit="edit"}(e.ActiveView||(e.ActiveView={})),function(e){e[e.None=0]="None",e[e.EditOccurred=1]="EditOccurred",e[e.NewUndoEntry=2]="NewUndoEntry",e[e.UndoPerformed=4]="UndoPerformed",e[e.RedoPerformed=8]="RedoPerformed",e[e.UndoStackCleared=16]="UndoStackCleared"}(e.UndoStackChangedReason||(e.UndoStackChangedReason={}))}(Office||(Office={}));var OSFPerfUtil,OSFWebkit,SDX,OTel,Microsoft,__extends=this&&this.__extends||function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),__awaiter=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{c(r.next(e))}catch(e){o(e)}}function s(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){e.done?i(e.value):new n((function(t){t(e.value)})).then(a,s)}c((r=r.apply(e,t||[])).next())}))},__generator=this&&this.__generator||function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=t.call(e,a)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}};!function(e){e.appSpecificCheckOrigin=function(e,t,n,r){return!1}}(OfficeExt||(OfficeExt={})),function(e){var t=function(){function e(e,t,n){this._method=e,this._invokeType=t,this._blockingOthers=n}return e.prototype.getMethod=function(){return this._method},e.prototype.getInvokeType=function(){return this._invokeType},e.prototype.getBlockingFlag=function(){return this._blockingOthers},e}();e.XdmMethodObject=t;var n=function(){function e(e,t){this._registerMethodObject=e,this._unregisterMethodObject=t}return e.prototype.getRegisterMethodObject=function(){return this._registerMethodObject},e.prototype.getUnregisterMethodObject=function(){return this._unregisterMethodObject},e}();e.XdmEventMethodObject=n;var r=function(){function r(e){this._methodObjectList={},this._eventHandlerProxyList={},this._conversations={},this._policyManager=null,this._appDomains={},this._onHandleRequestError=null,this._methodObjectList={},this._eventHandlerProxyList={},this._Id=e,this._conversations={},this._policyManager=null,this._appDomains={},this._onHandleRequestError=null}return r.prototype.registerMethod=function(n,r,i,o){if(0!==i&&1!==i)throw e.Utility.createArgumentException("invokeType");var a=new t(r,i,o);this._methodObjectList[n]=a},r.prototype.unregisterMethod=function(e){delete this._methodObjectList[e]},r.prototype.registerEvent=function(e,r,i){var o=new n(new t(r,4,!1),new t(i,5,!1));this._methodObjectList[e]=o},r.prototype.registerEventEx=function(e,r,i,o,a){var s=new n(new t(r,i,!1),new t(o,a,!1));this._methodObjectList[e]=s},r.prototype.unregisterEvent=function(e){this.unregisterMethod(e)},r.prototype.registerConversation=function(t,n,r){if(e.Utility.xdmDebugLog("registerConversation: cId="+t+" Url="+n),r){if(!Array.isArray(r))throw e.Utility.createArgumentException("appDomains");this._appDomains[t]=r}this._conversations[t]={url:n}},r.prototype.unregisterConversation=function(e){delete this._conversations[e]},r.prototype.setPolicyManager=function(t){if(!t.checkPermission)throw e.Utility.createArgumentException("policyManager");this._policyManager=t},r.prototype.getPolicyManager=function(){return this._policyManager},r.prototype.dispose=function(){this._methodObjectList=null,this._eventHandlerProxyList=null,this._Id=null,this._conversations=null,this._policyManager=null,this._appDomains=null,this._onHandleRequestError=null},r}();e.XdmServiceEndPoint=r;var i,o=function(){function e(e,t,n){this._callbackList={},this._eventHandlerList={},this._hostTrustCheckStatus=0,this._checkStatusLogged=!1,this._fHostTrusted=!1,this._conversationId=e,this._targetWindow=t,this._targetUrl=n,this._callingIndex=0,this._callbackList={},this._eventHandlerList={},this._checkReceiverOriginAndRun=null}return Object.defineProperty(e.prototype,"targetUrl",{get:function(){return this._targetUrl},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"hostTrustCheckStatus",{get:function(){return this._hostTrustCheckStatus},set:function(e){this._hostTrustCheckStatus=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"fHostTrusted",{get:function(){return this._fHostTrusted},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"checkStatusLogged",{get:function(){return this._checkStatusLogged},set:function(e){this._checkStatusLogged=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"checkReceiverOriginAndRun",{get:function(){return this._checkReceiverOriginAndRun},set:function(e){this._checkReceiverOriginAndRun=e},enumerable:!0,configurable:!0}),e.prototype.invoke=function(e,t,n){var r=this,o=function(){var o=r._callingIndex++,a=new Date,c={callback:t,createdOn:a.getTime()};n&&"object"==typeof n&&"number"==typeof n.__timeout__&&(c.timeout=n.__timeout__,delete n.__timeout__),r._callbackList[o]=c;try{if(3!==r._hostTrustCheckStatus&&"ContextActivationManager_getAppContextAsync"!==e)throw"Access Denied";var u=new s(e,0,r._conversationId,o,n),f=l.envelope(u);r._targetWindow.postMessage(f,r._targetUrl),i._startMethodTimeoutTimer()}catch(e){try{null!==t&&t(-1,e)}finally{delete r._callbackList[o]}}};this._checkReceiverOriginAndRun?this._checkReceiverOriginAndRun(o):(this._hostTrustCheckStatus=3,o())},e.prototype.registerForEvent=function(e,t,n,r){var o=this._callingIndex++,a=new Date;this._callbackList[o]={callback:n,createdOn:a.getTime()};try{var c=new s(e,1,this._conversationId,o,r),u=l.envelope(c);this._targetWindow.postMessage(u,this._targetUrl),i._startMethodTimeoutTimer(),this._eventHandlerList[e]=t}catch(e){try{null!==n&&n(-1,e)}finally{delete this._callbackList[o]}}},e.prototype.unregisterForEvent=function(e,t,n){var r=this._callingIndex++,o=new Date;this._callbackList[r]={callback:t,createdOn:o.getTime()};try{var a=new s(e,2,this._conversationId,r,n),c=l.envelope(a);this._targetWindow.postMessage(c,this._targetUrl),i._startMethodTimeoutTimer()}catch(e){try{null!==t&&t(-1,e)}finally{delete this._callbackList[r]}}finally{delete this._eventHandlerList[e]}},e}();e.XdmClientEndPoint=o,function(t){var n,i=[],a=null,s=null,u=!1,p={},m={},g=!1;function h(t){for(var n in p)if(p[n]._conversations[t])return p[n];throw e.Utility.createArgumentException("conversationId")}function y(t){var n=m[t];return n||e.Utility.xdmDebugLog("Unknown conversation Id."),n}function v(t,n){var r=t._methodObjectList[n._actionName];if(!r)throw e.Utility.xdmDebugLog("The specified method is not registered on service endpoint:"+n._actionName),e.Utility.createArgumentException("messageObject");return 0===n._actionType?r:1===n._actionType?r.getRegisterMethodObject():r.getUnregisterMethodObject()}function O(e){i.push(e)}function S(){null!==s?u||(i.length>0?b(i.shift()):(clearInterval(s),s=null)):e.Utility.xdmDebugLog("channel is not ready.")}function b(e){u=e.getInvokeBlockingFlag(),e.invoke(),a=(new Date).getTime()}function _(){u=!1}function A(t){if(window.addEventListener)window.addEventListener("message",t,!1);else{if(!(navigator.userAgent.indexOf("MSIE")>-1&&window.attachEvent))throw e.Utility.xdmDebugLog("Browser doesn't support the required API."),e.Utility.createArgumentException("Browser");window.attachEvent("onmessage",t)}}function C(t,n){return!!(t&&n&&"null"!==t&&"null"!==n&&t.length&&n.length)&&F(e.OUtil.parseUrl(t,!0),e.OUtil.parseUrl(n,!0))}function P(t){try{return e.OUtil.parseUrl(t,!0)}catch(e){return}}function E(e){if(e&&e.length){var t=e.indexOf("://"),n=-1!==t,r=n?e.substring(0,t).toLowerCase():"",i=n?e.substring(t+3):e,o=0;if(!n||"https"===r)for(;0===i.indexOf("*.");)o++,i=i.substring("*.".length);if(o>0&&o<=2){var a=P("https://"+i);if(a&&a.hostname)return{parser:a,wildcardLabelCount:o}}var s=P(n?e:"https://"+e);if(s&&s.hostname)return{parser:s,wildcardLabelCount:0}}}function I(e,t){return 0===e.wildcardLabelCount?F(e.parser,t):!!t&&t.protocol===e.parser.protocol&&e.parser.port===t.port&&function(e,t,n){var r=e.length-t.length-1;if(r<=0||e.substring(r)!=="."+t)return!1;var i=e.substring(0,r).split(".");return i.length===n&&-1===i.indexOf("")}(t.hostname,e.parser.hostname,e.wildcardLabelCount)}function w(t,n){var r=!1;if(!(n&&"null"!==n&&n.length&&t&&t instanceof Array&&t.length))return r;if(!e.OUtil.checkFlight(e.FlightTreatmentNames.MetaOSJsonManifestAppDomainWildcards)){for(var i=0;i<t.length&&!r;i++)if(-1!==t[i].indexOf("://")){var o=e.OUtil.parseUrl(n,!0);r=F(e.OUtil.parseUrl(t[i],!0),o)}return r}var a=e.OUtil.parseUrl(n,!0);for(i=0;i<t.length&&!r;i++){var s=E(t[i]);s&&(r=I(s,a))}return r}function T(t){if(!t||"null"===t)return!1;var n=new Array("^outlook\\.office\\.com$","^outlook-sdf\\.office\\.com$","^outlook\\.live\\.com$","^outlook-sdf\\.live\\.com$","^consumer\\.live-int\\.com$","^outlook-tdf\\.live\\.com$","^sdfpilot\\.live\\.com$","^outlook\\.office365\\.us$","^outlook\\.office365\\.com$","^exchangelabs\\.live-int\\.com$","^outlook\\.cloud\\.microsoft$","^sdf\\.outlook\\.cloud\\.microsoft$","^.*\\.dod\\.online\\.office365\\.us$","^.*\\.gov\\.online\\.office365\\.us$","^.*\\.officeapps\\.live\\.com$","^.*\\.officeapps-df\\.live\\.com$","^"+document.domain.replace(new RegExp("\\.","g"),"\\.")+"$");return!0===e.OUtil.getCustomOfficeInitializationSettings().trustAllCloudEnvironments&&n.push("^partner\\.outlook\\.cn$","^.*\\.partner\\.officewebapps\\.cn$"),new RegExp(n.join("|")).test(t)}function D(t){return __awaiter(this,void 0,void 0,(function(){var r;return __generator(this,(function(i){switch(i.label){case 0:return n||(n=new e.SovereignHelper),[4,(r=n).isConfigAvailable()];case 1:return i.sent()?[4,r.isSovereignHostTrusted(t)]:[2,!1];case 2:return[2,i.sent()]}}))}))}function x(t,n){if(!t||!n||"null"===t||"null"===n)return!1;var r=e.OUtil.parseUrl(t,!0),i=e.OUtil.parseUrl(n,!0);if(null==r||null==i)return!1;var o=r.protocol===i.protocol,a=r.port===i.port,s=i.hostname,c=r.hostname,l=s===c,u=!1;return!l&&s.length>c.length+1&&(u=s.slice(-(c.length+1))==="."+c),a&&o&&(l||u)}function F(e,t){return e.hostname==t.hostname&&e.protocol==t.protocol&&e.port==t.port}function M(t){return __awaiter(this,void 0,void 0,(function(){var n,r,i,o,p,m,g,A,P,E,I,T,D,F,M,N,R,k,j,U,L,B;return __generator(this,(function(W){switch(W.label){case 0:if(""==t.data)return[3,10];r=t.data;try{n=l.unenvelope(r)}catch(e){return[2]}if(e.Utility.xdmDebugLog(r),0!==n._messageType)return[3,9];i=null==t.origin||"null"===t.origin?n._origin:t.origin,W.label=1;case 1:if(W.trys.push([1,2,,8]),o=h(n._conversationId),e.Utility.xdmDebugLog("_receiveAsync: request, origin="+i+" sourceURL:"+o._conversations[n._conversationId]),p=o._conversations[n._conversationId],e.Utility.xdmDebugLog("_receiveAsync: request, origin="+i+" sourceURL:"+p.url),!w(m=[p.url].concat(o._appDomains[n._conversationId]),t.origin)&&!OfficeExt.appSpecificCheckOrigin(m,t,n._origin,w)&&!x(p.url,t.origin))throw"Failed origin check";if((g=o.getPolicyManager())&&!g.checkPermission(n._conversationId,n._actionName,n._data))throw"Access Denied";return A=v(o,n),P=new f(t.source,i,n._actionName,n._conversationId,n._correlationId,_),E=new d(A,n._data,P,o._eventHandlerProxyList,n._conversationId,n._actionName),I=!0,null==s&&((null==a||(new Date).getTime()-a>10)&&!u?(b(E),I=!1):s=setInterval(S,10)),I&&O(E),[3,8];case 2:T=W.sent(),o&&o._onHandleRequestError&&o._onHandleRequestError(n,T),D=-2,"Access Denied"==T&&(D=-5),F=new c(n._actionName,n._conversationId,n._correlationId,D,0,T),M=l.envelope(F),N=!1;try{N=!(!t.source||!t.source.postMessage)}catch(e){}return R=!1,window.location.href&&t.origin&&"null"!==t.origin&&x(window.location.href,t.origin)?(R=!0,[3,7]):[3,3];case 3:if(!t.origin||"null"===t.origin)return[3,7];k=e.OUtil.parseUrl(t.origin,!0).hostname,W.label=4;case 4:return W.trys.push([4,6,,7]),[4,H(k,null)];case 5:return R=W.sent(),[3,7];case 6:return j=W.sent(),e.Utility.xdmDebugLog("isHostNameValidWacDomainAsync failed with exception: "+j),R=!1,[3,7];case 7:return N&&R&&t.source.postMessage(M,i),[3,8];case 8:return[3,10];case 9:if(1!==n._messageType)return[2];if(!(U=y(n._conversationId)))return[2];if(e.Utility.xdmDebugLog("_receiveAsync: response, origin="+t.origin+" targetURL:"+U._targetUrl),!C(U._targetUrl,t.origin))throw"Failed orgin check";if(3==U._hostTrustCheckStatus&&(U._fHostTrusted=!0),0===n._responseType){if(L=U._callbackList[n._correlationId])try{L.callback&&L.callback(n._errorCode,n._data)}finally{delete U._callbackList[n._correlationId]}}else null!=(B=U._eventHandlerList[n._actionName])&&B(n._data);W.label=10;case 10:return[2]}}))}))}function N(t){if(""!=t.data){var n,r=t.data;try{n=l.unenvelope(r)}catch(e){return}if(e.Utility.xdmDebugLog(r),0===n._messageType){var i=null==t.origin||"null"===t.origin?n._origin:t.origin;try{var o=h(n._conversationId);e.Utility.xdmDebugLog("_receive: request, origin="+i+" sourceURL:"+o._conversations[n._conversationId]);var p=o._conversations[n._conversationId];e.Utility.xdmDebugLog("_receive: request, origin="+i+" sourceURL:"+p.url);var m=[p.url].concat(o._appDomains[n._conversationId]);if(!w(m,t.origin))if(!OfficeExt.appSpecificCheckOrigin(m,t,n._origin,w))if(!x(p.url,t.origin))throw"Failed origin check";var g=o.getPolicyManager();if(g&&!g.checkPermission(n._conversationId,n._actionName,n._data))throw"Access Denied";var A=v(o,n),P=new f(t.source,i,n._actionName,n._conversationId,n._correlationId,_),E=new d(A,n._data,P,o._eventHandlerProxyList,n._conversationId,n._actionName),I=!0;null==s&&((null==a||(new Date).getTime()-a>10)&&!u?(b(E),I=!1):s=setInterval(S,10)),I&&O(E)}catch(r){o&&o._onHandleRequestError&&o._onHandleRequestError(n,r);var D=-2;"Access Denied"==r&&(D=-5);var F=new c(n._actionName,n._conversationId,n._correlationId,D,0,r),M=l.envelope(F),N=!1;try{N=!(!t.source||!t.source.postMessage)}catch(e){}var R=!1;if(window.location.href&&t.origin&&"null"!==t.origin&&x(window.location.href,t.origin))R=!0;else if(t.origin&&"null"!==t.origin)R=T(e.OUtil.parseUrl(t.origin,!0).hostname);N&&R&&t.source.postMessage(M,i)}}else{if(1!==n._messageType)return;var H=y(n._conversationId);if(!H)return;if(e.Utility.xdmDebugLog("_receive: response, origin="+t.origin+" targetURL:"+H._targetUrl),!C(H._targetUrl,t.origin))throw"Failed orgin check";if(3==H._hostTrustCheckStatus&&(H._fHostTrusted=!0),0===n._responseType){var k=H._callbackList[n._correlationId];if(k)try{k.callback&&k.callback(n._errorCode,n._data)}finally{delete H._callbackList[n._correlationId]}}else{var j=H._eventHandlerList[n._actionName];null!=j&&j(n._data)}}}}function R(){g||(e.OUtil.isChangeGateEnabled("Microsoft.Office.SharedOnline.ChangeGate.OfficeVSO_10910853_OfficeJsNPMDownloadTrustedDomainList")?A(M):A(N),g=!0)}function H(t,n){return __awaiter(this,void 0,void 0,(function(){var r,i;return __generator(this,(function(o){switch(o.label){case 0:return r=!1,1===e.OUtil.getLibraryReleaseVehicle()?[3,3]:((i=e.SovereignHelper.isSovereignVersion())&&!0!==e.OUtil.getCustomOfficeInitializationSettings().trustAllCloudEnvironments||(r=T(t),n&&(r=r||n(t))),r||!i?[3,2]:[4,D(t)]);case 1:r=o.sent(),o.label=2;case 2:return[3,5];case 3:return(r=e.OUtil.isHostNameInAddinTrustedDomains(t))||!e.LoadScriptHelper.isSdx()||e.SovereignHelper.isSovereignVersion()||(r=T(t)),r?[3,5]:[4,D(t)];case 4:r=o.sent(),o.label=5;case 5:return[2,r]}}))}))}t.connect=function(e,t,n){var r=m[e];return r||(R(),r=new o(e,t,n),m[e]=r),r},t.getClientEndPoint=function(e){return m[e]},t.createServiceEndPoint=function(e){R();var t=new r(e);return p[e]=t,t},t.getServiceEndPoint=function(e){return p[e]},t.deleteClientEndPoint=function(e){delete m[e]},t.deleteServiceEndPoint=function(e){delete p[e]},t.checkUrlWithAppDomains=function(e,t){return w(e,t)},t.isTargetSubdomainOfSourceLocation=function(e,t){return x(e,t)},t._setMethodTimeout=function(e){e<=0?65e3:e},t._startMethodTimeoutTimer=function(){},t.isHostNameValidWacDomain=function(e){return T(e)},t.isHostNameValidWacDomainAsync=H}(i=e.XdmCommunicationManager||(e.XdmCommunicationManager={}));var a=function(){function e(e,t,n,r,i){this._messageType=e,this._actionName=t,this._conversationId=n,this._correlationId=r,this._origin=window.location.origin,this._data=void 0===i?null:i}return e.prototype.getActionName=function(){return this._actionName},e.prototype.getConversationId=function(){return this._conversationId},e.prototype.getCorrelationId=function(){return this._correlationId},e.prototype.getOrigin=function(){return this._origin},e.prototype.getData=function(){return this._data},e.prototype.getMessageType=function(){return this._messageType},e}(),s=function(e){function t(t,n,r,i,o){var a=e.call(this,0,t,r,i,o)||this;return a._actionType=n,a}return __extends(t,e),t.prototype.getActionType=function(){return this._actionType},t}(a),c=function(e){function t(t,n,r,i,o,a){var s=e.call(this,1,t,n,r,a)||this;return s._errorCode=i,s._responseType=o,s}return __extends(t,e),t.prototype.getErrorCode=function(){return this._errorCode},t.prototype.getResponseType=function(){return this._responseType},t}(a),l=function(){function e(){}return e.envelope=function(e){return JSON.stringify(e)},e.unenvelope=function(e){return JSON.parse(e)},e}(),u=function(){function t(t,n,r,i,o,a){var s=this;this._invokeResultCode=0,this._requesterWindow=t,this._requesterUrl=n,this._actionName=r,this._conversationId=i,this._correlationId=o,this._invokeResultCode=0,this._responseType=a,this._send=function(t){try{var n=new c(s._actionName,s._conversationId,s._correlationId,s._invokeResultCode,s._responseType,t),r=l.envelope(n);s._requesterWindow.postMessage(r,s._requesterUrl),e.Utility.xdmDebugLog("_send: requestUrl="+s._requesterUrl+" _actionName:"+s._actionName)}catch(t){e.Utility.xdmDebugLog("ResponseSender._send error:"+t.message)}}}return t.prototype.getRequesterWindow=function(){return this._requesterWindow},t.prototype.getRequesterUrl=function(){return this._requesterUrl},t.prototype.getActionName=function(){return this._actionName},t.prototype.getConversationId=function(){return this._conversationId},t.prototype.getCorrelationId=function(){return this._correlationId},t.prototype.getSend=function(){return this._send},t.prototype.setResultCode=function(e){this._invokeResultCode=e},t}(),f=function(t){function n(n,r,i,o,a,s){var u=t.call(this,n,r,i,o,a,0)||this;return u._postCallbackHandler=s,u._send=function(t,n){null!=n&&(u._invokeResultCode=n);try{var r=new c(u._actionName,u._conversationId,u._correlationId,u._invokeResultCode,u._responseType,t),i=l.envelope(r);u._requesterWindow.postMessage(i,u._requesterUrl),u._postCallbackHandler()}catch(t){e.Utility.xdmDebugLog("InvokeCompleteCallback._send error:"+t.message)}},u}return __extends(n,t),n}(u),d=function(){function e(e,t,n,r,i,o){this._callerId="",this._methodObject=e,this._param=t,this._invokeCompleteCallback=n,this._eventHandlerProxyList=r,this._conversationId=i,this._eventName=o}return e.prototype.invoke=function(){try{var e;switch(this._methodObject.getInvokeType()){case 0:this._methodObject.getMethod()(this._param,this._invokeCompleteCallback.getSend());break;case 1:e=this._methodObject.getMethod()(this._param),this._invokeCompleteCallback.getSend()(e);break;case 4:var t=this._createEventHandlerProxyObject(this._invokeCompleteCallback);e=this._methodObject.getMethod()(t.getSend(),this._param),this._eventHandlerProxyList[this._conversationId+this._eventName]=t.getSend(),this._invokeCompleteCallback.getSend()(e);break;case 5:var n=this._eventHandlerProxyList[this._conversationId+this._eventName];e=this._methodObject.getMethod()(n,this._param),delete this._eventHandlerProxyList[this._conversationId+this._eventName],this._invokeCompleteCallback.getSend()(e);break;case 2:var r=this._createEventHandlerProxyObject(this._invokeCompleteCallback);this._methodObject.getMethod()(r.getSend(),this._invokeCompleteCallback.getSend(),this._param),this._eventHandlerProxyList[this._callerId+this._eventName]=r.getSend();break;case 3:var i=this._eventHandlerProxyList[this._callerId+this._eventName];this._methodObject.getMethod()(i,this._invokeCompleteCallback.getSend(),this._param),delete this._eventHandlerProxyList[this._callerId+this._eventName]}}catch(e){this._invokeCompleteCallback.setResultCode(-3),this._invokeCompleteCallback.getSend()(e)}},e.prototype.getInvokeBlockingFlag=function(){return this._methodObject.getBlockingFlag()},e.prototype._createEventHandlerProxyObject=function(e){return new u(e.getRequesterWindow(),e.getRequesterUrl(),e.getActionName(),e.getConversationId(),e.getCorrelationId(),1)},e}()}(OSF||(OSF={})),function(e){function t(e,t){return t+="_Resource",void 0!==oteljs?[oteljs.makeDoubleDataField(t+"_responseEnd",e.responseEnd),oteljs.makeDoubleDataField(t+"_responseStart",e.responseStart),oteljs.makeDoubleDataField(t+"_startTime",e.startTime),oteljs.makeDoubleDataField(t+"_transferSize",e.transferSize)]:[]}e.sendPerformanceTelemetry=function(){if(OSF.AppTelemetry.enableTelemetry&&"undefined"!=typeof performance&&performance.getEntriesByType){var e,n,r=OSF.LoadScriptHelper.getHostBundleJsName().toLowerCase();performance.getEntriesByType("resource").forEach((function(t){var i=t.name.toLowerCase();OSF.Utility.stringEndsWith(i,r)?e=t:(OSF.Utility.stringEndsWith(i,OSF.ConstantNames.OfficeDebugJS)||OSF.Utility.stringEndsWith(i,OSF.ConstantNames.OfficeJS))&&(n=t)})),OTel.OTelLogger.onTelemetryLoaded((function(){var r=[];e&&(r=r.concat(t(e,"HostJs"))),n&&(r=r.concat(t(n,"OfficeJs"))),r=r.concat([oteljs.makeDoubleDataField("officeExecuteStartDate",OSFPerformance.officeExecuteStartDate),oteljs.makeDoubleDataField("officeExecuteStart",OSFPerformance.officeExecuteStart),oteljs.makeDoubleDataField("officeExecuteEnd",OSFPerformance.officeExecuteEnd),oteljs.makeDoubleDataField("hostInitializationStart",OSFPerformance.hostInitializationStart),oteljs.makeDoubleDataField("hostInitializationEnd",OSFPerformance.hostInitializationEnd),oteljs.makeDoubleDataField("totalJSHeapSize",OSFPerformance.totalJSHeapSize),oteljs.makeDoubleDataField("usedJSHeapSize",OSFPerformance.usedJSHeapSize),oteljs.makeDoubleDataField("jsHeapSizeLimit",OSFPerformance.jsHeapSizeLimit),oteljs.makeDoubleDataField("getAppContextStart",OSFPerformance.getAppContextStart),oteljs.makeDoubleDataField("getAppContextEnd",OSFPerformance.getAppContextEnd),oteljs.makeDoubleDataField("getAppContextXdmStart",OSFPerformance.getAppContextXdmStart),oteljs.makeDoubleDataField("getAppContextXdmEnd",OSFPerformance.getAppContextXdmEnd),oteljs.makeDoubleDataField("createOMEnd",OSFPerformance.createOMEnd),oteljs.makeDoubleDataField("officeOnReady",OSFPerformance.officeOnReady),oteljs.makeBooleanDataField("isSharedRuntime",0!=(OSF._OfficeAppFactory.getHostInfo().flags&OSF.HostInfoFlags.SharedApp)),oteljs.makeBooleanDataField("isExperimentJsEnabled",0!=(OSF._OfficeAppFactory.getHostInfo().flags&OSF.HostInfoFlags.ExperimentJsEnabled))]),Microsoft.Office.WebExtension.sendTelemetryEvent({eventName:"Office.Extensibility.OfficeJs.JSPerformanceTelemetryV06",dataFields:r,eventFlags:{dataCategories:2,diagnosticLevel:110}})}))}}}(OSFPerfUtil||(OSFPerfUtil={})),function(e){!function(t){var n,r,i={};function o(e,t,n,r){if(e&&t){var o=window.document,a=i[e];if(a)a.loaded?t(!0):a.pendingCallbacks.push(t);else{var s=o.createElement("script");s.type="text/javascript",a={loaded:!1,pendingCallbacks:[t],timer:null},i[e]=a;var c=function(){null!=a.timer&&(clearTimeout(a.timer),delete a.timer),a.loaded=!0;for(var e=a.pendingCallbacks.length,t=0;t<e;t++){a.pendingCallbacks.shift()(!0)}},l=function(){delete i[e],null!=a.timer&&(clearTimeout(a.timer),delete a.timer);for(var t=a.pendingCallbacks.length,n=0;n<t;n++){a.pendingCallbacks.shift()(!1)}};s.readyState?s.onreadystatechange=function(){"loaded"!=s.readyState&&"complete"!=s.readyState||(s.onreadystatechange=null,c())}:s.onload=c,s.onerror=l,r=r||3e4,a.timer=setTimeout(l,r),s.setAttribute("crossOrigin","anonymous"),s.src=n?n.createScriptURL(e):e,o.getElementsByTagName("head")[0].appendChild(s)}}}!function(e){var t=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"];e.generateNewGuid=function(){for(var e="",n=(new Date).getTime(),r=0;r<32&&n>0;r++)8!=r&&12!=r&&16!=r&&20!=r||(e+="-"),e+=t[n%16],n=Math.floor(n/16);for(;r<32;r++)8!=r&&12!=r&&16!=r&&20!=r||(e+="-"),e+=t[Math.floor(16*Math.random())];return e}}(t.Guid||(t.Guid={})),t.loadScriptPromise=function(e,t,n){return new Promise((function(r,i){o(e,(function(e){r(e)}),t,n)}))},t.loadScript=o,t.getSessionStorage=function(){if(!n){try{var t=window.sessionStorage}catch(e){t=null}n=new e.SafeStorage(t)}return n},t.getLocalStorage=function(){if(!r){try{var t=window.localStorage}catch(e){t=null}r=new e.SafeStorage(t)}return r},t.waitForFunction=function(e,t,n,r){var i,o=n,a=function(){o--,e()?t(!0):o>0?(i=window.setTimeout(a,r),o--):(window.clearTimeout(i),t(!1))};a()},t.isSecureDefaultsEnabled=function(){return"undefined"!=typeof isOsfSecurityDefaultsEnabled&&!0===isOsfSecurityDefaultsEnabled}}(e.OUtil||(e.OUtil={}))}(OSF||(OSF={})),function(e){e.Flights=[];e.FlightTreatmentNames={MetaOSJsonManifestAppDomainWildcards:"Microsoft.Office.SharedOnline.MetaOSJsonManifestAppDomainWildcards",ForceUpgradeMsal5:"Microsoft.Office.SharedOnline.ForceUpgradeMsal5"},function(t){var n="&_flights=",r="&_disabledChangeGates=",i="_flights=",o="_disabledChangeGates=";function a(e,t){return e.substr(0,t.length)===t}function s(e,t,n,r){return a(e,t+"//"+n+":"+r)||a(e,n+":"+r)}t.isArray=function(e){return"[object Array]"===Object.prototype.toString.apply(e)},t.isFunction=function(e){return"[object Function]"===Object.prototype.toString.apply(e)},t.isDate=function(e){return"[object Date]"===Object.prototype.toString.apply(e)},t.addEventListener=function(e,t,n){if(e.addEventListener)e.addEventListener(t,n,!1);else{if(!e.attachEvent)throw new Error("Cannot attach event");e.attachEvent("on"+t,n)}},t.removeEventListener=function(e,t,n){if(e.removeEventListener)e.removeEventListener(t,n,!1);else{if(!e.detachEvent)throw new Error("Cannot remove event");e.detachEvent("on"+t,n)}};var c="Date(";function l(e){var t=[];try{t=JSON.parse(e)}catch(e){}return Array.isArray(t)||(t=[]),t}function u(e,n,r){try{var i=JSON.parse(n),o=null!=i?i[r]:null,a=t.getSessionStorage();if(!e&&a&&null!=i){var s=i.baseFrameName+r;o?a.setItem(s,o):o=a.getItem(s)}return o}catch(e){return null}}function f(e,n,r,i,o){var a=o.split(e),s=a.length>1?a[a.length-1]:null;r&&null!=s&&(s.indexOf("&")>=0&&(s=s.split("&")[0]),s=decodeURIComponent(s));var c=t.getSessionStorage();if(!i&&c){var l=window.name.indexOf(n);if(l>-1){var u=window.name.indexOf(";",l);-1==u&&(u=window.name.length);var f=window.name.substring(l,u);s?c.setItem(f,s):s=c.getItem(f)}}return s}function d(e,t){for(var n=0;n<e.length;n++)if(e.charAt(n)===t){if(n+1>=e.length)return this.removeChar(e,n);if("/"===t){if("?"===e.charAt(n+1)||"#"===e.charAt(n+1))return this.removeChar(e,n)}else if("?"===t&&"#"===e.charAt(n+1))return this.removeChar(e,n)}return e}function p(e){if(e=d(e,"/"),e=d(e,"?"),"https://"==(e=d(e,"#")).substr(0,8))-1!=(t=e.indexOf(":443"))&&(t!=e.length-4&&"/"!=e.charAt(t+4)&&"?"!=e.charAt(t+4)&&"#"!=e.charAt(t+4)||(e=e.substring(0,t)+e.substring(t+4)));else if("http://"==e.substr(0,7)){var t;-1!=(t=e.indexOf(":80"))&&(t!=e.length-3&&"/"!=e.charAt(t+3)&&"?"!=e.charAt(t+3)&&"#"!=e.charAt(t+3)||(e=e.substring(0,t)+e.substring(t+3)))}return e}function m(e){var t,n,r=[],i=[],o=e.length;for(t=0;t<o;t++)(n=e[t]).tabIndex?n.tabIndex>0?i.push(n):0===n.tabIndex&&r.push(n):r.push(n);return i=i.sort((function(e,t){var n=e.tabIndex-t.tabIndex;return 0===n&&(n=i.indexOf(e)-i.indexOf(t)),n})),[].concat(i,r)}t.serializeSettings=function(t){var n={};for(var r in t){var i=t[r];try{i=JSON.stringify(i,(function(t,n){return e.OUtil.isDate(this[t])?c+this[t].getTime()+")":n})),n[r]=i}catch(e){}}return n},t.deserializeSettings=function(e){var t={};for(var n in e=e||{}){var r=e[n];try{r=JSON.parse(r,(function(e,t){var n;return"string"==typeof t&&t&&t.length>6&&t.slice(0,5)===c&&")"===t.slice(-1)&&(n=new Date(parseInt(t.slice(5,-1))))?n:t})),t[n]=r}catch(e){}}return t},t.convertIntToCssHexColor=function(e){return"#"+(Number(e)+16777216).toString(16).slice(-6)},t.parseAppContextFromWindowName=function(e,n){return t.parseInfoFromWindowName(e,n,"appContext")},t.parseHostInfoFromWindowName=function(t,n){return e.OUtil.parseInfoFromWindowName(t,n,"hostInfo")},t.parseXdmInfo=function(e){var n=t.parseXdmInfoWithGivenFragment(e,window.location.hash);return n||(n=t.parseXdmInfoFromWindowName(e,window.name)),n},t.parseXdmInfoFromWindowName=function(t,n){return e.OUtil.parseInfoFromWindowName(t,n,"xdmInfo")},t.parseXdmInfoWithGivenFragment=function(t,n){return e.OUtil.parseInfoWithGivenFragment("&_xdm_Info=","_xdm_",!1,t,n)},t.parseFlights=function(e){var t=function(e,t){return l(f(n,i,!0,e,t))}(e,window.location.hash);return 0==t.length&&(t=function(e,t){return l(u(e,t,"flights"))}(e,window.name)),t},t.parseDisabledChangeGates=function(e){var t=function(e,t){return l(f(r,o,!0,e,t))}(e,window.location.hash);return 0==t.length&&(t=function(e,t){return l(u(e,t,"disabledChangeGates"))}(e,window.name)),t},t.checkFlight=function(t){return e.Flights&&e.Flights.indexOf(t)>=0},t.parseInfoFromWindowName=u,t.parseInfoWithGivenFragment=f,t.getConversationId=function(){var e=window.location.search,t=null;if(e){var n=e.indexOf("&");(t=n>0?e.substring(1,n):e.substr(1))&&"="===t.charAt(t.length-1)&&(t=t.substring(0,t.length-1))&&(t=decodeURIComponent(t))}return t},t.getInfoItems=function(e){var t=e.split("$");return void 0===t[1]&&(t=e.split("|")),void 0===t[1]&&(t=e.split("%7C")),t},t.getXdmFieldValue=function(t,n){var r="",i=e.OUtil.parseXdmInfo(n);if(i){var o=e.OUtil.getInfoItems(i);if(null!=o&&o.length>=3)switch(t){case"ConversationUrl":r=o[2];break;case"AppId":r=o[1]}}return r},t.parseUrl=function(t,n){if(void 0===n&&(n=!1),void 0!==t&&t){var r="NotHttps",i="undefined"!=typeof window&&void 0!==window.navigator&&window.navigator.userAgent.indexOf("Trident")>0,o=("undefined"!=typeof window&&void 0!==window.navigator&&window.navigator.userAgent.indexOf("Edge"),{protocol:void 0,hostname:void 0,host:void 0,port:void 0,pathname:void 0,search:void 0,hash:void 0,isPortPartOfUrl:void 0});try{if(i){var a=document.createElement("a");if(a.href=t,!(a&&a.protocol&&a.host&&a.hostname&&a.href&&p(a.href).toLowerCase()===p(t).toLowerCase()))throw"InvalidUrl";if(e.OUtil.checkFlight(2)&&n&&"https:"!=a.protocol)throw new Error(r);var c=function(e,t){return e&&t?"https:"==t.protocol&&s(e,"https:",t.hostname,"443")?":443":"http:"==t.protocol&&s(e,"http:",t.hostname,"80")?":80":"":""}(t,a);o.protocol=a.protocol,o.hostname=a.hostname,o.port=""==c?a.port:"",o.host=""!=c?a.hostname:a.host,o.pathname=(i?"/":"")+a.pathname,o.search=a.search,o.hash=a.hash,o.isPortPartOfUrl=s(t,a.protocol,a.hostname,a.port)}else{var l=new URL(t);if(l&&l.protocol&&l.host&&l.hostname){if(e.OUtil.checkFlight(2)&&n&&"https:"!=l.protocol)throw new Error(r);o.protocol=l.protocol,o.hostname=l.hostname,o.port=l.port,o.host=l.host,o.pathname=l.pathname,o.search=l.search,o.hash=l.hash,o.isPortPartOfUrl=l.host.lastIndexOf(":"+l.port)==l.host.length-l.port.length-1}}}catch(e){if(e.message===r)throw e}return o}},t.focusToFirstTabbable=function(e,t){var n,r,i=!1,o=function(e){i=!0},a=function(e,t,n){return t<0||t>e||0===t&&n?-1:t!==e-1||n?n?t-1:t+1:-1};if(e=m(e),n=t?e.length-1:0,0===e.length)return null;for(;!i&&n>=0&&n<e.length;)r=e[n],window.focus(),r.addEventListener("focus",o),r.focus(),r.removeEventListener("focus",o),n=a(e.length,n,t),i||r!==document.activeElement||(i=!0);return i?r:null},t.focusToNextTabbable=function(e,t,n){var r,i,o,a=!1,s=function(e){a=!0},c=function(e,t,n){return t<0||t>e||0===t&&n?-1:t!==e-1||n?n?t-1:t+1:-1};if(r=function(e,t){for(var n=0;n<e.length;n++)if(e[n]===t)return n;return-1}(e=m(e),t),(i=c(e.length,r,n))<0)return null;for(;!a&&i>=0&&i<e.length;)(o=e[i]).addEventListener("focus",s),o.focus(),o.removeEventListener("focus",s),i=c(e.length,i,n),a||o!==document.activeElement||(a=!0);return a?o:null},t.defineMethodOnNamespace=function(e,t,n){e[t]=n},t.isDialog=function(){return e._OfficeAppFactory.getHostInfo().isDialog},t.isPopupWindow=function(){return e.OUtil.isDialog()&&e._OfficeAppFactory.getHostInfo().hostPlatform==e.HostInfoPlatform.web&&null!=window.opener},t.getHostPlatform=function(){return e._OfficeAppFactory.getHostInfo().hostPlatform}}(e.OUtil||(e.OUtil={}))}(OSF||(OSF={})),function(e){!function(e){e.Callback="callback",e.AsyncContext="asyncContext",e.Data="data",e.MessageToParent="messageToParent",e.MessageContent="messageContent",e.MessageOrigin="messageOrigin",e.TargetOrigin="targetOrigin",e.AppCommandInvocationCompletedData="appCommandInvocationCompletedData"}(e.ParameterNames||(e.ParameterNames={}))}(OSF||(OSF={})),function(e){!function(t){var n=function(){};t.RequirementVersion=n;var r=function(){function e(e){this._setMap=e}return e.prototype.isSetSupported=function(e,t){if(null==e)return!1;null==t&&(t=0);var n=this._setMap._sets;if(n.hasOwnProperty(e.toLowerCase())){var r=n[e.toLowerCase()];try{var i=this._getVersion(r+"");t+="";var o=this._getVersion(t);if(i.major>0&&i.major>o.major)return!0;if(i.major>0&&i.minor>=0&&i.major==o.major&&i.minor>=o.minor)return!0}catch(e){return!1}}return!1},e.prototype._getVersion=function(e){var t=(e+="").split("."),n=0,r=0;if(t.length<2&&isNaN(Number(e)))throw"version format incorrect";if(n=Number(t[0]),t.length>=2&&(r=Number(t[1])),isNaN(n)||isNaN(r))throw"version format incorrect";return{minor:r,major:n}},e}();t.RequirementMatrix=r;var i=function(){function e(e){this._sets=e}return e.prototype._addSetMap=function(e){for(var t in e)this._sets[t]=e[t]},e}();t.DefaultSetRequirement=i;var o=function(e){function t(){return e.call(this,{dialogapi:1.1})||this}return __extends(t,e),t}(i);t.DefaultRequiredDialogSetRequirement=o;var a=function(e){function t(){return e.call(this,{dialogorigin:1.1})||this}return __extends(t,e),t}(i);t.DefaultOptionalDialogSetRequirement=a;var s=function(){function t(){}return t.getDefaultRequirementMatrix=function(t){var n=void 0,o=t.get_requirementMatrix();if(null!=o&&o.length>0){var a=JSON.parse(t.get_requirementMatrix().toLowerCase());if(e._OfficeAppFactory.getHostInfo().hostPlatform==e.HostInfoPlatform.web)try{var s="dialogorigin";a.hasOwnProperty(s)||(a[s]=1.1)}catch(e){}n=new r(new i(a))}else n=new r(new i({}));return n},t.getDefaultDialogRequirementMatrix=function(t){var n=void 0,s=t.get_dialogRequirementMatrix();if(null!=s&&s.length>0){var c=JSON.parse(t.get_requirementMatrix().toLowerCase());n=new i(c)}else{n=new o;var l=t.get_requirementMatrix();if(null!=l&&l.length>0&&"undefined"!=typeof JSON){c=JSON.parse(l.toLowerCase());for(var u in n._sets)c.hasOwnProperty(u)&&(n._sets[u]=c[u]);var f=new a;for(var u in f._sets)c.hasOwnProperty(u)&&(n._sets[u]=c[u])}}if(e._OfficeAppFactory.getHostInfo().hostPlatform==e.HostInfoPlatform.web)try{var d="dialogorigin";!n._sets.hasOwnProperty(d)&&window.opener&&(n._sets[d]=1.1)}catch(e){}return new r(n)},t}();t.RequirementsMatrixFactory=s}(e.Requirement||(e.Requirement={}))}(OSF||(OSF={})),function(e){!function(t){!function(t){var n;t.executeRichApiRequestAsync=function(t,n){var r={toSafeArrayHost:function(){return[t]},fromSafeArrayHost:function(e){return{data:e}},toWebHost:function(){return{ArrayData:t}},fromWebHost:function(e){return{data:e.Data}}};e._OfficeAppFactory.getAsyncMethodExecutor().executeAsync(93,r,n)},Object.defineProperty(t,"richApiMessageManager",{get:function(){return n||(n=new e.RichApiMessageManager),n}})}(t.RichApi||(t.RichApi={}))}(e.DDA||(e.DDA={}))}(OSF||(OSF={})),function(e){var t=function(){function t(){this._registerHandlers=[],this._eventDispatch=new e.EventDispatch([{type:e.EventType.RichApiMessage,id:e.EventDispId.dispidRichApiMessageEvent,getTargetId:function(){return""},fromSafeArrayHost:function(e){var n=e;return t.transferEventArgument(n)},fromWebHost:function(e){var n=e.ArrayData;return t.transferEventArgument(n)}}])}return t.transferEventArgument=function(t){var n=[];if(t)for(var r=0;r<t.length;r++){var i=t[r];i.toArray&&(i=i.toArray()),n.push({messageCategory:i[0],messageType:i[1],targetId:i[2],message:i[3],id:i[4],isRemoteOverride:i[5]})}return{type:e.EventType.RichApiMessage,entries:n}},t.prototype.addHandlerAsync=function(t,n,r){e.EventHelper.addEventHandler(t,n,r,this._eventDispatch)},t.prototype.removeHandlerAsync=function(t,n,r){e.EventHelper.removeEventHandler(t,n,r,this._eventDispatch)},t.prototype.register=function(t){var n=this;return this._registerPromise||(this._registerPromise=new Office.Promise((function(t,r){n.addHandlerAsync(e.EventType.RichApiMessage,(function(e){n._registerHandlers.forEach((function(t){t&&t(e)}))}),(function(e){"failed"==e.status?r(e.error):t()}))}))),this._registerPromise.then((function(){n._registerHandlers.push(t)}))},t}();e.RichApiMessageManager=t}(OSF||(OSF={})),function(e){var t=function(){function t(){}return t.prototype.execute=function(e,t,n){"undefined"!=typeof OsfOMToken&&OsfOMToken?window.external.Execute(e,t,n,OsfOMToken):window.external.Execute(e,t,n)},t.prototype.registerEvent=function(e,t,n,r,i){"undefined"!=typeof OsfOMToken&&OsfOMToken?window.external.RegisterEvent(e,n,r,i,OsfOMToken):window.external.RegisterEvent(e,n,r,i)},t.prototype.unregisterEvent=function(e,t,n,r){"undefined"!=typeof OsfOMToken&&OsfOMToken?window.external.UnregisterEvent(e,n,r,OsfOMToken):window.external.UnregisterEvent(e,n,r)},t.prototype.closeSdxDialog=function(t){throw e.Utility.createNotImplementedException()},t.prototype.resizeSdxDialog=function(t,n){throw e.Utility.createNotImplementedException()},t}();e.RichClientHostController=t}(OSF||(OSF={})),function(e){var t=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.officeThemeTimeStamp=null,e.officeTheme=null,e}return __extends(n,t),n.prototype.getOsfControlContext=function(){if(!this._osfControlContext){var t="Warning: Office.js is loaded outside of Office client";try{if(!window.external)return console.error("There is no window.external."),e.Utility.trace(t),null;this._osfControlContext=window.external.GetContext()}catch(n){return console.error("Error when call window.external.GetContext() :"+JSON.stringify(n)),e.Utility.trace(t),null}}return this._osfControlContext},n.prototype.getAppContext=function(t,n,r){var i=this,o=this.getOsfControlContext();if(o){var a,s,c,l,u,f,d,p,m,g,h,y,v,O,S,b,_,A,C,P,E,I,w,T,D,x,F=0,M=!1;if((N=e.Utility.externalNativeFunctionExists)(typeof o.GetContextDataInJson))if("undefined"!=typeof OsfOMToken&&OsfOMToken)if((D=o.GetContextDataInJson(OsfOMToken))&&(x=JSON.parse(D)),x)a=x.appType,s=x.solutionRef,c=x.versionMajor,l=x.versionMinor,u=x.uiLocale,f=x.dataLocale,d=x.docUrl,p=x.clientMode,m=x.activationMode,h=x.controlType,y=x.eToken,v=x.correlationId,O=x.appInstanceId,S=x.touchEnabled,b=o.commerceAllowed,_=x.requirementMatrix,C=x.hostFullVersion,P=x.requirementMatrix,(R=x.featureGates)&&(E=JSON.parse(R)),F=x.initialDisplayMode,I=function(){var t={};if(x.settings)try{var n=JSON.parse(x.settings);if(n)for(var r=[n.names,n.values],i=r[0],o=r[1],a=0;a<i.length;a++)t[i[a]]=o[a]}catch(t){e.Utility.trace("Exception while parsing settings. Details: "+t)}return t},w=function(){var e=x.themeInfo;return i.getOfficeThemeFromInfoString(e)};else M=!0;else M=!0;else M=!0;if(M){a=o.GetAppType(),s=o.GetSolutionRef(),c=o.GetAppVersionMajor(),l=o.GetAppVersionMinor(),u=o.GetAppUILocale(),f=o.GetAppDataLocale(),d=o.GetDocUrl(),p=o.GetAppCapabilities(),m=o.GetActivationMode(),h=o.GetControlIntegrationLevel();try{y=o.GetSolutionToken()}catch(e){}var N;if((N=e.Utility.externalNativeFunctionExists)(typeof o.GetCorrelationId)&&(v=o.GetCorrelationId()),N(typeof o.GetInstanceId)&&(O=o.GetInstanceId()),N(typeof o.GetTouchEnabled)&&(S=o.GetTouchEnabled()),N(typeof o.GetCommerceAllowed)&&(b=o.GetCommerceAllowed()),N(typeof o.GetSupportedMatrix)&&(_=o.GetSupportedMatrix()),N(typeof o.GetHostCustomMessage)&&(A=o.GetHostCustomMessage()),N(typeof o.GetHostFullVersion)&&(C=o.GetHostFullVersion()),N(typeof o.GetDialogRequirementMatrix)&&(P=o.GetDialogRequirementMatrix()),N(typeof o.GetFeaturesForSolution))try{var R;(R=o.GetFeaturesForSolution())&&(E=JSON.parse(R))}catch(t){e.Utility.trace("Exception while creating the SDX FeatureGates object. Details: "+t)}N(typeof o.GetInitialDisplayMode)&&(F=o.GetInitialDisplayMode()),I=function(){return i.getSerializedSettings()},w=function(){return i.getOfficeTheme()},T=function(){return i.getSerializedHostSettings()}}g=2===m?Office.InitializationReason.DocumentOpened:Office.InitializationReason.Inserted,y=y?y.toString():"",n(new e.OfficeAppContext(s,a,c,u,f,d,p,I,g,h,y,v,O,S,b,l,_,A,C,void 0,void 0,void 0,void 0,P,E,w,F,void 0,void 0,T,!1,void 0,void 0,void 0))}else r(new Error("The Office.js is loaded outside of Office client"))},n.prototype.createClientHostController=function(){if(!this._clientHostController){if(this._hostInfo.hostPlatform!==e.HostInfoPlatform.win32)throw e.Utility.createNotImplementedException();this._clientHostController=new e.Win32RichClientHostController}return this._clientHostController},n.prototype.createAsyncMethodExecutor=function(){return new e.SafeArrayAsyncMethodExecutor(this._clientHostController)},n.prototype.createClientSettingsManager=function(){return new e.RichClientSettingsManager(this.getOsfControlContext())},n.prototype.getSerializedSettings=function(){var e=this.getOsfControlContext(),t=[],n=[];"undefined"!=typeof OsfOMToken&&OsfOMToken?e.GetSettings(OsfOMToken).Read(t,n):e.GetSettings().Read(t,n);for(var r={},i=0;i<t.length;i++)r[t[i]]=n[i];return r},n.prototype.getOfficeTheme=function(){var e=this.getOsfControlContext();if(e){if(!(this.officeTheme&&this.officeThemeTimeStamp&&(new Date).getTime()-this.officeThemeTimeStamp<n.officeThemeCacheValidPeriod)){var t=e.GetOfficeThemeInfo();this.officeTheme=this.getOfficeThemeFromInfoString(t),this.officeThemeTimeStamp=(new Date).getTime()}return this.officeTheme}},n.prototype.getOfficeThemeFromInfoString=function(t){var n=null;if(t)try{n=JSON.parse(t)}catch(t){e.AppTelemetry&&e.AppTelemetry.logAppException("Exception while parsing officeThemeInfo. Details: "+t)}var r={};if(n){var i={bodyBackgroundColor:{name:"bodyBackgroundColor",convertToHex:!0},bodyForegroundColor:{name:"bodyForegroundColor",convertToHex:!0},controlBackgroundColor:{name:"controlBackgroundColor",convertToHex:!0},controlForegroundColor:{name:"controlForegroundColor",convertToHex:!0},primaryFontColor:{name:"bodyForegroundColor",convertToHex:!0},primaryBackgroundColor:{name:"bodyBackgroundColor",convertToHex:!0},secondaryFontColor:{name:"controlForegroundColor",convertToHex:!0},secondaryBackgroundColor:{name:"controlBackgroundColor",convertToHex:!0},fluentThemeData:{name:"fluentThemeData",convertToHex:!1}};for(var o in n){var a=!1,s=o;i[o]&&(s=i[o].name,a=i[o].convertToHex),r[s]=a?e.OUtil.convertIntToCssHexColor(n[o]):n[o]}}return r},n.prototype.getSerializedHostSettings=function(){var e=this.getOsfControlContext(),t=[],n=[];"function"==typeof e.GetSettings().ReadHost&&("undefined"!=typeof OsfOMToken&&OsfOMToken?e.GetSettings(OsfOMToken).ReadHost(t,n):e.GetSettings().ReadHost(t,n));for(var r={},i=0;i<t.length;i++)r[t[i]]=n[i];return r},n.officeThemeCacheValidPeriod=5e3,n}(e.InitializationHelper);e.RichClientInitializationHelper=t}(OSF||(OSF={})),function(e){var t=function(){function e(e){this._osfClientContext=e}return e.prototype.read=function(e){var t,n=this._osfClientContext;t="undefined"!=typeof OsfOMToken&&OsfOMToken?n.GetSettings(OsfOMToken):n.GetSettings();var r=function(){var n=[],r=[];t.Read(n,r);for(var i={},o=0;o<n.length;o++)i[n[o]]=r[o];e&&e(0,i)};t.RefreshAsync?t.RefreshAsync((function(){r()})):r()},e.prototype.write=function(e,t){var n=[],r=[];for(var i in e)n.push(i),r.push(e[i]);var o,a=this._osfClientContext;void 0!==(o="undefined"!=typeof OsfOMToken&&OsfOMToken?a.GetSettings(OsfOMToken):a.GetSettings()).WriteAsync?o.WriteAsync(n,r,t):(o.Write(n,r),t(0))},e}();e.RichClientSettingsManager=t}(OSF||(OSF={})),function(e){var t=function(t){function n(n){var r=t.call(this)||this;return r._clientHostController=n,r._asyncMethodExecutorHelper=e.BootStrapExtension.createAsyncMethodExecutorHelper(r),r}return __extends(n,t),n.prototype.executeAsync=function(t,n,r,i){var o=this;try{var a=new Array;this._clientHostController.execute(t,n.toSafeArrayHost(),(function(s,c){var l=e.Utility.fromSafeArray(s);return o._asyncMethodExecutorHelper.handleSafeArrayHostResponse(l,c,a,r,n,t,i)}))}catch(e){this.onException(e,t,r)}},n.prototype.registerEventAsync=function(t,n,r,i,o,a,s){var c=this;try{this._clientHostController.registerEvent(t,n,r,(function(t,n){var r=e.Utility.fromSafeArray(n),a=o.fromSafeArrayHost(r);i(a)}),(function(n){var r,i=e.Utility.fromSafeArray(n);return"number"==typeof i?([],r=i):r=i[0],c.invokeCallback(t,a,r,null,s),!0}))}catch(e){this.onException(e,t,a)}},n.prototype.unregisterEventAsync=function(t,n,r,i,o){var a=this;try{this._clientHostController.unregisterEvent(t,n,r,(function(n,r){var s,c=e.Utility.fromSafeArray(n);return"number"==typeof c?([],s=c):s=c[0],a.invokeCallback(t,i,s,null,o),!0}))}catch(e){this.onException(e,t,i)}},n.prototype.onException=function(t,n,r){var i,o=t.number;if(o)switch(o){case-2146828218:i=7e3;break;case-2147467259:i=n==e.EventDispId.dispidDialogMessageReceivedEvent?12007:5001;break;case-2146828283:case-2147209089:i=5010;break;case-2147208704:i=5100;break;case-2146827850:default:i=5001}r&&this.invokeCallback(n,r,i||5001,null)},n}(e.AsyncMethodExecutor);e.SafeArrayAsyncMethodExecutor=t}(OSF||(OSF={})),function(e){var t=function(){function e(e){this._internalStorage=e}return e.prototype.getItem=function(e){try{return this._internalStorage&&this._internalStorage.getItem(e)}catch(e){return null}},e.prototype.setItem=function(e,t){try{this._internalStorage&&this._internalStorage.setItem(e,t)}catch(e){}},e.prototype.clear=function(){try{this._internalStorage&&this._internalStorage.clear()}catch(e){}},e.prototype.removeItem=function(e){try{this._internalStorage&&this._internalStorage.removeItem(e)}catch(e){}},e.prototype.getKeysWithPrefix=function(e){var t=[];try{for(var n=this._internalStorage&&this._internalStorage.length||0,r=0;r<n;r++){var i=this._internalStorage.key(r);0===i.indexOf(e)&&t.push(i)}}catch(e){}return t},e}();e.SafeStorage=t}(OSF||(OSF={})),function(e){var t=function(){function t(e,t){var n=this;this._clientSettingsManager=t,e=e||{},this._settings=e,this._eventDispatch=new OSF.EventDispatch([{id:OSF.EventDispId.dispidSettingsChangedEvent,type:OSF.EventType.SettingsChanged,getTargetId:function(){return""},fromSafeArrayHost:function(e){return{type:OSF.EventType.SettingsChanged,settings:n}},fromWebHost:function(e){return{type:OSF.EventType.SettingsChanged,settings:n}}}])}return t.prototype.cacheSessionSettings=function(e){var t=OSF.OUtil.getSessionStorage();if(t){var n=OSF.OUtil.serializeSettings(e),r=JSON.stringify(n);t.setItem(OSF._OfficeAppFactory.getCachedSessionSettingsKey(),r)}},t.prototype.get=function(e){var t=this._settings[e];return void 0===t?null:t},t.prototype.set=function(e,t){this._settings[e]=t,this.cacheSessionSettings(this._settings)},t.prototype.remove=function(e){delete this._settings[e],this.cacheSessionSettings(this._settings)},t.prototype.saveAsync=function(e){var t=this._clientSettingsManager,n=OSF.OUtil.serializeSettings(this._settings);t.write(n,(function(t){var n=OSF.Utility.asyncResultFromErrorCode(t);e&&e(n)}))},t.prototype.refreshAsync=function(t){var n=this;this._clientSettingsManager.read((function(r,i){var o=OSF.Utility.asyncResultFromErrorCode(r);o.status===e.AsyncResultStatus.Succeeded&&(n._settings=OSF.OUtil.deserializeSettings(i),o.value=n),t&&t(o)}))},t.prototype.addHandlerAsync=function(e,t,n){OSF.EventHelper.addEventHandler(e,t,n,this._eventDispatch)},t.prototype.removeHandlerAsync=function(e,t,n){OSF.EventHelper.removeEventHandler(e,t,n,this._eventDispatch)},t.prototype.toJSON=function(){return this._settings},t}();e.Settings=t}(Office||(Office={})),function(e){var t=function(){function t(){}return t.isSovereignVersion=function(){return 1!==e.OUtil.getLibraryReleaseVehicle()?"undefined"!=typeof isOsfSovereignVersion&&!0===isOsfSovereignVersion:e.OUtil.getCustomOfficeInitializationSettings().officeCdnEndpoint.isSovereign},t.prototype.getEnvironmentName=function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(t){switch(t.label){case 0:return[4,this.getConfig()];case 1:return[2,null!=(e=t.sent())&&e.envName?e.envName:null]}}))}))},t.prototype.getEnvironmentType=function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(t){switch(t.label){case 0:return[4,this.getConfig()];case 1:return[2,null!=(e=t.sent())&&e.envType?e.envType:null]}}))}))},t.prototype.getTrustedHostOrigins=function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(t){switch(t.label){case 0:return[4,this.getConfig()];case 1:return[2,null!=(e=t.sent())?e.trustedHostOrigins:null]}}))}))},t.prototype.isConfigAvailable=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:return[4,this.getConfig()];case 1:return[2,!!e.sent()]}}))}))},t.prototype.isSovereignHostTrusted=function(e){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(n){switch(n.label){case 0:return e?e===window.location.hostname?[2,!0]:[4,this.getTrustedHostOrigins()]:[2,!1];case 1:return(t=n.sent())&&0!=t.length?[2,new RegExp(t.join("|")).test(e)]:[2,!1]}}))}))},t.prototype.getConfigPath=function(){var t=e.LoadScriptHelper.getHostBundleJsBasePath(),n="undefined"!=typeof isOsfSecurityDefaultsEnabled&&!0===isOsfSecurityDefaultsEnabled;if(t){if(t=t.toLowerCase(),e.OUtil.isChangeGateEnabled("Microsoft.Office.SharedOnline.ChangeGate.OfficeVSO_10910853_OfficeJsNPMDownloadTrustedDomainList")&&1===e.OUtil.getLibraryReleaseVehicle()){var r="/lib/";if(e.OUtil.getCustomOfficeInitializationSettings().officeCdnEndpoint.isOCDICompliant){var i=t.indexOf("beta/");return i>-1?t.substring(0,i)+"officeconfig.json":""}return(o=t.indexOf(r))>-1?t.substring(0,o+r.length)+"officeconfig.json":""}if(n)try{return new URL(t).origin.toLowerCase()+"/officeconfig.json"}catch(e){}else{var o,a="/lib/";if((o=t.indexOf(a))>-1)return t.toLowerCase().substring(0,o+a.length)+"officeconfig.json"}}return""},t.prototype.getConfig=function(){return this._configPromise||(this._configPromise=this.tryLoadConfig()),this._configPromise},t.prototype.tryLoadConfig=function(){return __awaiter(this,void 0,void 0,(function(){var t,n,r,i,o,a,s;return __generator(this,(function(c){switch(c.label){case 0:if(!(t=this.getConfigPath()))return[3,2];if(n=e.OUtil.getLocalStorage(),r=t+"_cache",i=n.getItem(r),o=null,i){try{o=JSON.parse(i)}catch(e){}if(864e5,a=(new Date).getTime(),o&&o.config&&o.createTime<=a&&o.createTime+864e5>=a)return[2,o.config]}return[4,this.downloadConfig(t)];case 1:return(s=c.sent())?(o={createTime:(new Date).getTime(),config:s},n.setItem(r,JSON.stringify(o))):o&&(s=o.config),[2,s];case 2:return[2,null]}}))}))},t.prototype.downloadConfig=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:return t.trys.push([0,3,,4]),[4,fetch(e)];case 1:return[4,t.sent().json()];case 2:return[2,t.sent()];case 3:return t.sent(),[3,4];case 4:return[2,null]}}))}))},t}();e.SovereignHelper=t}(OSF||(OSF={})),function(e){!function(e){function t(e){return void 0===e||null===e}e.createParameterException=function(e){return new Error("Parameter count mismatch: "+e)},e.createArgumentException=function(e){return new Error("Invalid argument "+e)},e.createNotImplementedException=function(){return new Error("Not implemented yet")},e.log=function(e){console.log(e)},e.trace=function(e){console.log(e)},e.debugLog=function(e){console.log(e)},e.getQueryStringValue=function(e){if("undefined"!=typeof window&&window.location&&window.location.search){var t=new RegExp("[?&]"+e+"=([^&]*)").exec(window.location.search);if(t)return t[1]}return null},e.isNullOrUndefined=t,e.isNullOrEmpty=function(e){return!!t(e)||0===e.length},e.isInUnittest=function(){return"boolean"==typeof g_osfUnittest&&g_osfUnittest}}(e.Utility||(e.Utility={}))}(OSF||(OSF={})),function(e){e.isOfficeReactNative=function(){try{return"undefined"!=typeof OfficePlatformGlobal&&void 0!==OfficePlatformGlobal.ReactNativeReka}catch(e){return!1}},function(e){function t(e){return new Promise(e)}function n(e){var t=e,i=1;if(("object"==typeof e||"unknown"==typeof e)&&null!=e&&e.toArray)if(e.dimensions&&(i=e.dimensions()),2===i)t=r(e);else{var o=e.toArray();t=new Array(o.length);for(var a=0;a<o.length;a++)t[a]=n(o[a])}return t}function r(e){var t;try{var n=e.ubound(1),r=e.ubound(2);if(e=e.toArray(),1==n&&1==r)t=[e];else{t=[];for(var i=0;i<n;i++){for(var o=[],a=0;a<r;a++){var s=e[i*r+a];"{66e7831f-81b2-42e2-823c-89e872d541b3}"!=s&&o.push(s)}o.length>0&&t.push(o)}}}catch(e){}return t}e.xdmDebugLog=function(t){e._DebugXdm&&console.log(t)},e.enableDebugXdm=function(){e._DebugXdm=!0},e.createPromiseFromResult=function(e){return Promise.resolve(e)},e.createPromise=t,e.promisify=function(e,n){return t((function(t,r){e((function(e){0===e?t():r()})),setTimeout((function(){r()}),n)}))},e.compareVersions=function(e,t){var n,r=e.split("."),i=t.split(".");for(n in r){if(parseInt(r[n])<parseInt(i[n]))return!1;if(parseInt(r[n])>parseInt(i[n]))return!0}return!1},e.getErrorCodeFromAsyncResult=function(e){return e.status===Office.AsyncResultStatus.Succeeded?0:e.error&&e.error.code?e.error.code:5001},e.externalNativeFunctionExists=function(e){return"unknown"===e||"undefined"!==e},e.stringEndsWith=function(t,n){if(e.isNullOrUndefined(t))throw e.createArgumentException("value");if(e.isNullOrUndefined(n))throw e.createArgumentException("subString");return!(n.length>t.length)&&t.substr(t.length-n.length)===n},e.fromSafeArray=function(e){var t=e;if(("object"==typeof e||"unknown"==typeof e)&&null!=e&&e.toArray){var r=e.toArray();t=new Array(r.length);for(var i=0;i<r.length;i++)t[i]=n(r[i])}return t},e.twoDVBArrayToJaggedArray=r,e.asyncResultFromErrorCode=function(e){return Array.isArray(e)&&1===e.length&&(e=e[0]),0===e?{status:Office.AsyncResultStatus.Succeeded}:{status:Office.AsyncResultStatus.Failed,error:{code:e}}},e._DebugXdm=!1}(e.Utility||(e.Utility={}))}(OSF||(OSF={})),function(e){var t=function(t){function n(n){var r=t.call(this)||this;return r._clientHostController=n,r._asyncMethodExecutorHelper=e.BootStrapExtension.createAsyncMethodExecutorHelper(r),r}return __extends(n,t),n.prototype.executeAsync=function(e,t,n,r){var i=this;this._clientHostController.execute(e,t.toWebHost(),(function(o,a){return n&&i._asyncMethodExecutorHelper.handleWebHostResponse(a,o,n,t,e,r),!0}))},n.prototype.registerEventAsync=function(e,t,n,r,i,o,a){var s=this;this._clientHostController.registerEvent(e,t,n,(function(e){var t=e,n=i.fromWebHost(t);r(n)}),(function(t,n){return o&&s.invokeCallback(e,o,t,null,a),!0}))},n.prototype.unregisterEventAsync=function(e,t,n,r,i){var o=this;this._clientHostController.unregisterEvent(e,t,n,(function(t,n){return r&&o.invokeCallback(e,r,t,null,i),!0}))},n}(e.AsyncMethodExecutor);e.WebAsyncMethodExecutor=t}(OSF||(OSF={})),function(e){!function(t){!function(t){t.getAuthContextAsync=function(t){e._OfficeAppFactory.getAsyncMethodExecutor().executeAsync(99,{toSafeArrayHost:function(){return[]},fromSafeArrayHost:function(e){return null},toWebHost:function(){return{}},fromWebHost:function(e){return e.authContext}},t)}}(t.WebAuth||(t.WebAuth={}))}(e.DDA||(e.DDA={})),function(t){var n;!function(e){e.AuthCode="authcode",e.Broker="broker",e.Implicit="implicit"}(n=t.AuthFlow||(t.AuthFlow={})),t.loadAttempts=0;var r="webauth/",i="webauth.browserauth.debug.js",o="webauth.browserauth.js",a=!0,s=!1;t.load=function(c){if(t.config&&t.config.authFlow===n.AuthCode){t.loadAttempts++,t.msalVersion=void 0;var l=!0!==t.config.useMsal5&&e.OUtil.checkFlight(e.FlightTreatmentNames.ForceUpgradeMsal5);return!0===t.config.useMsal5||l?(i="webauth.browserauth.msal5.debug.js",o="webauth.browserauth.msal5.js",s=!0):(t.config&&!1===t.config.useMsal3&&(a=!1),a&&(i="webauth.browserauth.msal3.debug.js",o="webauth.browserauth.msal3.js",s=!0)),new Promise((function(n,a){var u=function(t,n,r){return new Promise((function(i,o){t?e.OUtil.loadScript(t,(function(e){if("boolean"!=typeof e||e)if(e instanceof Event&&e)o(new Event("loadScript: "+e.type+" '"+t+"'"));else if(r&&!n())var a=0,s=setInterval((function(){a+=500,!(n()||a>r)||(clearInterval(s),n())||o(new Event("Missing expected object after loaded."))}),500);else i(null);else o(new Event("loadScript: failed to load '"+t+"'"))}),e.LoadScriptHelper.getTrustedTypesPolicy(),r):i(null)}))},f=[u(t.config&&t.config.authVersion?e.LoadScriptHelper.getHostBundleJsBasePath()+r+t.config.authVersion+"/"+(t.config&&t.config.debugging?i:o):e.LoadScriptHelper.getHostBundleJsBasePath()+r+(t.config&&t.config.debugging?i:o),(function(){return!!BrowserAuth}),t.config.delayWebAuth)];s||f.push(u(t.config.msal,(function(){return!!msal}),t.config.delayMsal)),Promise.all(f).then((function(){if(t.msalVersion=s?BrowserAuth.msalVersion:"undefined"!=typeof msal?msal.version:void 0,t.config){var r=__assign({},t.config);l&&(r.useMsal5=!0,r.enableLegacyPolling=!0),c&&(r.appIds=c.appIds,r.redirectUri=c.redirectUri,r.prefetch=c.prefetch,r.clientCapabilities=c.clientCapabilities,r.usePairwiseBroker=c.usePairwiseBroker,r.trustedBrokerDomain=c.trustedBrokerDomain),BrowserAuth.Load(r,e._OfficeAppFactory.getHostInfo().osfControlAppCorrelationId).then((function(e){n(e)}),(function(e){a(e)}))}else a(new Event("config is empty."))}),(function(e){a(e)}))}))}return new Promise((function(e,t){return t(new Event("'authcode' as authFlow is only supported"))}))},t.getToken=function(e,r,i,o,a,c){return t.config&&t.config.authFlow===n.AuthCode?s?BrowserAuth.GetToken({resource:e,scopes:r,applicationId:i,correlationId:o,popup:!!a,claims:c}):BrowserAuth.GetToken(e,i,o,!!a,!!a,!1,c):Promise.reject(new Event("'authcode' as authFlow is only supported"))}}(e.WebAuth||(e.WebAuth={}))}(OSF||(OSF={})),function(e){var t=function(){function t(t){this._delegateVersion=1,this._webAppState=t,this._webClientHostControllerHelper=e.BootStrapExtension.createWebClientHostControllerHelper(this._webAppState,this._delegateVersion)}return t.prototype.execute=function(e,t,n){var r=this,i=this._webClientHostControllerHelper.getHostCallArgs(e,t),o=this._webClientHostControllerHelper.getTargetMethodName(e);this._webAppState.clientEndPoint.invoke(o,(function(t,i){var o=0;if(0==t)r._delegateVersion=i.Version,o=r._webClientHostControllerHelper.parseErrorFromPayload(e,i);else switch(t){case-5:o=7e3;break;default:o=5001}n&&n(o,i)}),i)},t.prototype.registerEvent=function(e,t,n,r,i){this._webAppState.clientEndPoint.registerForEvent(this.getXdmEventName(n,t),(function(e){r&&r(e)}),this._getOnAfterRegisterEvent(!0,e,i),{controlId:this._webAppState.id,eventDispId:e,targetId:n,__timeout__:-1})},t.prototype.unregisterEvent=function(e,t,n,r){this._webAppState.clientEndPoint.unregisterForEvent(this.getXdmEventName(n,t),this._getOnAfterRegisterEvent(!1,e,r),{controlId:this._webAppState.id,eventDispId:e,targetId:n,__timeout__:-1})},t.prototype.messageParent=function(t){throw e.Utility.createNotImplementedException()},t.prototype.openDialog=function(t,n,r,i,o){throw e.Utility.createNotImplementedException()},t.prototype.closeDialog=function(t,n,r,i){throw e.Utility.createNotImplementedException()},t.prototype.sendMessage=function(t){throw e.Utility.createNotImplementedException()},t.prototype.closeSdxDialog=function(t){this._webAppState.clientEndPoint.invoke("ContextActivationManager_notifyHost",null,[this._webAppState.id,e.AgaveHostAction.CloseSDXDialog,{InstanceId:this._webAppState.id,DialogCloseCallbackParam:t}])},t.prototype.resizeSdxDialog=function(t,n){this._webAppState.clientEndPoint.invoke("ContextActivationManager_notifyHost",null,[this._webAppState.id,e.AgaveHostAction.ResizeSDXDialog,{InstanceId:this._webAppState.id,DialogWidth:t+"px",DialogHeight:n+"px"}])},t.prototype.getXdmEventName=function(t,n){return n==e.EventType.BindingSelectionChanged||n==e.EventType.BindingDataChanged||n==e.EventType.DataNodeDeleted||n==e.EventType.DataNodeInserted||n==e.EventType.DataNodeReplaced?t+"_"+n:n},t.prototype._getOnAfterRegisterEvent=function(t,n,r){var i=(new Date).getTime();return function(o,a){var s;if(0!=o)switch(o){case-5:s=7e3;break;default:s=5001}else s=a?a.Error?a.Error:0:5001;r&&r(s),e.AppTelemetry&&e.AppTelemetry.onRegisterDone(t,n,Math.abs((new Date).getTime()-i),s)}},t}();e.WebClientHostController=t}(OSF||(OSF={})),function(e){var t=function(){function e(e,t){this._webAppState=e,this._delegateVersion=t}return e.prototype.getHostCallArgs=function(e,t){var n=t;return n||(n={}),n.DdaMethod={ControlId:this.getControlId(),DispatchId:e,Version:this._delegateVersion},n.__timeout__=-1,n},e.prototype.getTargetMethodName=function(e){return"executeMethod"},e.prototype.parseErrorFromPayload=function(e,t){return t.Error},e.prototype.getControlId=function(){return this._webAppState.id},e}();e.WebClientHostControllerHelper=t}(OSF||(OSF={})),function(e){var t=function(){function t(){}return t.prototype.read=function(t){e._OfficeAppFactory.getAsyncMethodExecutor().executeAsync(75,{toSafeArrayHost:function(){return[]},fromSafeArrayHost:function(e){return null},toWebHost:function(){return{}},fromWebHost:function(e){return e.Properties.Settings}},(function(e){if(e.status===Office.AsyncResultStatus.Succeeded){for(var n={},r=0;r<e.value.length;r++){var i=e.value[r];Array.isArray(i)?n[i[0]]=i[1]:n[i.Name]=i.Value}t(0,n)}else{var o=e.error.code;t(o,{})}}))},t.prototype.write=function(t,n){var r=e._OfficeAppFactory.getAsyncMethodExecutor(),i=[];for(var o in t){var a=[];a.push(o),a.push(t[o]),i.push(a)}var s={toSafeArrayHost:function(){return null},fromSafeArrayHost:function(e){return null},toWebHost:function(){return{DdaSettingsMethod:{OverwriteIfStale:!0,Properties:i}}},fromWebHost:function(e){return null}};r.executeAsync(76,s,(function(e){if(e.status===Office.AsyncResultStatus.Succeeded)n(0);else{var t=e.error.code;n(t)}}))},t}();e.WebClientSettingsManager=t}(OSF||(OSF={})),function(e){var t=function(t){function n(e,n,r,i){var o=t.call(this,e,n,r,i)||this;return o._serializedSettings={},o._serializedHostSettings={},o._initializeNestedAppAuthPromise=null,o._appContext={},o._tabbableElements="a[href]:not([tabindex='-1']),area[href]:not([tabindex='-1']),button:not([disabled]):not([tabindex='-1']),input:not([disabled]):not([tabindex='-1']),select:not([disabled]):not([tabindex='-1']),textarea:not([disabled]):not([tabindex='-1']),*[tabindex]:not([tabindex='-1']),*[contenteditable]:not([disabled]):not([tabindex='-1'])",o}return __extends(n,t),n.prototype.get_addInSourceUrlFromAppContext=function(){var e=this._appContext&&this._appContext._addInSourceUrl;return"string"==typeof e&&e?e:""},Object.defineProperty(n.prototype,"isHostOriginTrusted",{get:function(){return this._isHostOriginTrustedFunc},set:function(e){this._isHostOriginTrustedFunc=e},enumerable:!0,configurable:!0}),n.prototype.saveAndSetDialogInfo=function(t){var n,r=e.OUtil.getSessionStorage();if(r){if(t||(t=e.OUtil.parseHostInfoFromWindowName(!0,e._OfficeAppFactory.getWindowName())),t&&t.indexOf("isDialog")>-1){var i=(n=e.OUtil.parseXdmInfo(!0))?n.split("|")[1]:null;return null!=i&&r.setItem(i+"IsDialog","true"),void(this._hostInfo.isDialog=!0)}this._hostInfo.isDialog=null!=r.getItem(e.OUtil.getXdmFieldValue("AppId",!1)+"IsDialog")}},n.prototype.checkReceiverOriginAndRun=function(t){return __awaiter(this,void 0,void 0,(function(){var n,r,i,o,a,s,c,l,u,f,d;return __generator(this,(function(p){switch(p.label){case 0:return 3===(n=this)._webAppState.clientEndPoint.hostTrustCheckStatus?(t(),[2]):(r=e.OUtil.parseUrl(n._webAppState.clientEndPoint.targetUrl,!1),i="https:"==r.protocol,o=r.hostname,a="NotHttps",0!==n._webAppState.clientEndPoint.hostTrustCheckStatus?[3,6]:(i||(n._webAppState.clientEndPoint.hostTrustCheckStatus=2),2==n._webAppState.clientEndPoint.hostTrustCheckStatus?[3,6]:(s=!1,e.OUtil.isChangeGateEnabled("Microsoft.Office.SharedOnline.ChangeGate.OfficeVSO_10910853_OfficeJsNPMDownloadTrustedDomainList")?[4,e.XdmCommunicationManager.isHostNameValidWacDomainAsync(o,n.isHostOriginTrusted)]:[3,2])));case 1:return s=p.sent(),[3,5];case 2:return(c=e.SovereignHelper.isSovereignVersion())&&!0!==e.OUtil.getCustomOfficeInitializationSettings().trustAllCloudEnvironments||(s=e.XdmCommunicationManager.isHostNameValidWacDomain(o),n.isHostOriginTrusted&&(s=s||n.isHostOriginTrusted(o))),s||!c?[3,5]:(n._sovereignHelper||(n._sovereignHelper=new e.SovereignHelper),[4,(l=n._sovereignHelper).isConfigAvailable()]);case 3:return p.sent()?[4,l.isSovereignHostTrusted(o)]:[2];case 4:s=p.sent(),p.label=5;case 5:s&&(n._webAppState.clientEndPoint.hostTrustCheckStatus=3),p.label=6;case 6:if(n._webAppState.clientEndPoint.checkStatusLogged||null==n._hostInfo||void 0===n._hostInfo||(e.AppTelemetry.onCheckWACHost(n._webAppState.clientEndPoint.hostTrustCheckStatus,n._webAppState.id,n._hostInfo.hostType,n._hostInfo.hostPlatform,n._webAppState.clientEndPoint.targetUrl),n._webAppState.clientEndPoint.checkStatusLogged=!0),3===n._webAppState.clientEndPoint.hostTrustCheckStatus||e.LoadScriptHelper.disableHostCheck())t();else{if(u=e.OUtil.isChangeGateEnabled("Microsoft.Office.SharedOnline.ChangeGate.OfficeVSO_10910853_OfficeJsNPMDownloadTrustedDomainList")&&1===e.OUtil.getLibraryReleaseVehicle(),e.LoadScriptHelper.isSdx()||u)throw new Error("Not supported host");f=function(){var r=e.LoadScriptHelper.getHostBundleJsBasePath().match(/^https?:\/\/[^:/?#]*(?::([0-9]+))?/);if(r&&r[0]){var s=e.LoadScriptHelper.getHostBundleJsBasePath()+"AgaveErrorUX/index.html#",c={error:"NotTrustedWAC",locale:e.getSupportedLocale(n._hostInfo.hostLocale,e.ConstantNames.DefaultLocale),hostname:o,noHttps:!i,validate:!1},l=document.createElement("iframe");l.style.visibility="hidden",l.style.height="0",l.style.width="0";var u=function(i){if(i.source==l.contentWindow&&i.origin==r[0])try{!0===JSON.parse(i.data).hostUserTrusted?(n._webAppState.clientEndPoint.hostTrustCheckStatus=3,e.OUtil.removeEventListener(window,"message",u),document.body.removeChild(l)):(c.validate=!1,window.location.replace(s+encodeURIComponent(JSON.stringify(c)))),t()}catch(t){e.OUtil.ensureOfficeStringsJs().then((function(){document.body.textContent=Strings.OfficeOM.L_NotTrustedWAC}))}};e.OUtil.addEventListener(window,"message",u),c.validate=!0,l.setAttribute("src",s+encodeURIComponent(JSON.stringify(c))),l.onload=function(){var e={hostname:o,noHttps:!i};l.contentWindow.postMessage(JSON.stringify(e),r[0])},document.body.appendChild(l)}else e.OUtil.ensureOfficeStringsJs().then((function(){document.body.textContent=Strings.OfficeOM.L_NotTrustedWAC}));if(e.OUtil.checkFlight(2)&&!i)throw new Error(a)},document.body?f():(d=!1,document.addEventListener("DOMContentLoaded",(function(){d||(d=!0,f())})))}return[2]}}))}))},n.prototype.setAgaveHostCommunication=function(){try{var t=this,n=e.OUtil.parseXdmInfoWithGivenFragment(!1,e._OfficeAppFactory.getWindowLocationHash());if(n||(n=e.OUtil.parseXdmInfoFromWindowName(!1,e._OfficeAppFactory.getWindowName())),n){var r=e.OUtil.getInfoItems(n);null!=r&&r.length>=3&&(t._webAppState.conversationID=r[0],t._webAppState.id=r[1],t._webAppState.webAppUrl=r[2].indexOf(":")>=0?r[2]:decodeURIComponent(r[2]))}if(t._webAppState.wnd=null!=window.opener?window.opener:window.parent,this._hostInfo.isDialog&&null!=window.opener)return;t._webAppState.clientEndPoint=e.XdmCommunicationManager.connect(t._webAppState.conversationID,t._webAppState.wnd,t._webAppState.webAppUrl),t._webAppState.serviceEndPoint=e.XdmCommunicationManager.createServiceEndPoint(t._webAppState.id),t._webAppState.clientEndPoint.checkReceiverOriginAndRun=function(e){t.checkReceiverOriginAndRun(e)};var i=t._webAppState.conversationID+e.Constants.NotificationConversationIdSuffix;t._webAppState.serviceEndPoint.registerConversation(i,t._webAppState.webAppUrl);t._webAppState.serviceEndPoint.registerMethod("Office_notifyAgave",(function(n){var r;switch(r="string"==typeof n?n:n[0]){case e.AgaveHostAction.Select:t._webAppState.focused=!0;break;case e.AgaveHostAction.UnSelect:t._webAppState.focused=!1;break;case e.AgaveHostAction.TabIn:case e.AgaveHostAction.CtrlF6In:window.focus();var i=document.querySelectorAll(t._tabbableElements);e.OUtil.focusToFirstTabbable(i,!1)||(window.blur(),t._webAppState.focused=!1,t._webAppState.clientEndPoint.invoke("ContextActivationManager_notifyHost",null,[t._webAppState.id,e.AgaveHostAction.ExitNoFocusable]));break;case e.AgaveHostAction.TabInShift:window.focus();i=document.querySelectorAll(t._tabbableElements);e.OUtil.focusToFirstTabbable(i,!0)||(window.blur(),t._webAppState.focused=!1,t._webAppState.clientEndPoint.invoke("ContextActivationManager_notifyHost",null,[t._webAppState.id,e.AgaveHostAction.ExitNoFocusableShift]));break;case e.AgaveHostAction.SendMessage:if(Office.context.messaging.onMessage){var o=n[1];Office.context.messaging.onMessage(o)}break;case e.AgaveHostAction.TaskPaneHeaderButtonClicked:Office.context.ui.taskPaneAction.onHeaderButtonClick&&Office.context.ui.taskPaneAction.onHeaderButtonClick();break;default:e.Utility.trace("actionId "+r+" notifyAgave is wrong.")}}),0,!1),t.addOrRemoveEventListenersForWindow(!0)}catch(t){throw e.AppTelemetry&&e.AppTelemetry.logAppException("Exception thrown in setAgaveHostCommunication. Exception:["+t+"]"),t}},n.prototype.getAppContext=function(t,n,r){var i=this,o=this,a=function(t,a){if(OSFPerformance.getAppContextXdmEnd=OSFPerformance.now(),a._appName===e.AppName.ExcelWebApp&&Array.isArray(a._settings))for(var s=0,c=a._settings;s<c.length;s++){var l=c[s],u=l[0],f=l[1];i._serializedSettings[u]=f}else i._serializedSettings=a._settings||{};if(a._appName===e.AppName.ExcelWebApp&&Array.isArray(a._hostSettings))for(var d=0,p=a._hostSettings;d<p.length;d++){var m=p[d];u=m[0],f=m[1];i._serializedHostSettings[u]=f}else i._serializedHostSettings=a._hostSettings||{};if(a._appAndHostSettingsEqual&&(i._serializedHostSettings=__assign({},i._serializedSettings)),!o._hostInfo.isDialog||null==window.opener){var g=window.location.origin;o._webAppState.clientEndPoint.invoke("ContextActivationManager_notifyHost",null,[o._webAppState.id,e.AgaveHostAction.UpdateTargetUrl,g])}if(0===t&&null!=a._id&&null!=a._appName&&null!=a._appVersion&&null!=a._appUILocale&&null!=a._dataLocale&&null!=a._docUrl&&null!=a._clientMode&&null!=a._reason){o._appContext=a;var h=a._appInstanceId?a._appInstanceId:a._id,y=0;null!=a._appMinorVersion&&(y=a._appMinorVersion);var v=void 0;null!=a._requirementMatrix&&(v=a._requirementMatrix),a.eToken=a.eToken?a.eToken:"";var O=new e.OfficeAppContext(a._id,a._appName,a._appVersion,a._appUILocale,a._dataLocale,a._docUrl,a._clientMode,(function(){return i._serializedSettings}),a._reason,a._osfControlType,a._eToken,a._correlationId,h,!1,!0,y,v,a._hostCustomMessage,a._hostFullVersion,a._clientWindowHeight,a._clientWindowWidth,a._addinName,a._appDomains,a._dialogRequirementMatrix,a._featureGates,a._officeTheme,a._initialDisplayMode,a._isFromWacAutomation,a._wopiHostOriginForSingleSignOn,(function(){return i._serializedHostSettings}),!0,a._nestedAppAuthBridgeType,a._partitionKey,a._topFrameOrigin);O.set_taskpaneUrl(a._taskpaneUrl),n(O)}else{var S="Function ContextActivationManager_getAppContextAsync call failed. ErrorCode is "+t+", exception: "+a;e.AppTelemetry&&e.AppTelemetry.logAppException(S),r(S)}};try{var s=!0;this._hostInfo.isDialog&&null!=window.opener&&(s=!1);var c=e.OUtil.parseAppContextFromWindowName(s,e._OfficeAppFactory.getWindowName());c?a(0,c):(OSFPerformance.getAppContextXdmStart=OSFPerformance.now(),this._webAppState.clientEndPoint.invoke("ContextActivationManager_getAppContextAsync",a,this._webAppState.id))}catch(t){e.AppTelemetry&&e.AppTelemetry.logAppException("Exception thrown when trying to invoke getAppContextAsync. Exception:["+t+"]"),r(t)}},n.prototype.createClientHostController=function(){return this._clientHostController||(this._clientHostController=new e.WebClientHostController(this._webAppState)),this._clientHostController},n.prototype.createAsyncMethodExecutor=function(){return new e.WebAsyncMethodExecutor(this._clientHostController)},n.prototype.createClientSettingsManager=function(){return new e.WebClientSettingsManager},n.prototype.addOrRemoveEventListenersForWindow=function(t){var n=this,r=function(){n._webAppState.focused||(n._webAppState.focused=!0),n._webAppState.clientEndPoint.invoke("ContextActivationManager_notifyHost",null,[n._webAppState.id,e.AgaveHostAction.Select])},i=function(){e&&(n._webAppState.focused&&(n._webAppState.focused=!1),n._webAppState.clientEndPoint.invoke("ContextActivationManager_notifyHost",null,[n._webAppState.id,e.AgaveHostAction.UnSelect]))},o=function(t){if(t.preventDefault=t.preventDefault||function(){t.returnValue=!1},117==t.keyCode&&(t.ctrlKey||t.metaKey)){t.preventDefault();var r=e.AgaveHostAction.CtrlF6Exit;t.shiftKey&&(r=e.AgaveHostAction.CtrlF6ExitShift),n._webAppState.clientEndPoint.invoke("ContextActivationManager_notifyHost",null,[n._webAppState.id,r])}else if(9==t.keyCode){t.preventDefault();var i=document.querySelectorAll(n._tabbableElements);e.OUtil.focusToNextTabbable(i,t.target||t.srcElement,t.shiftKey)||(n._hostInfo.isDialog?e.OUtil.focusToFirstTabbable(i,t.shiftKey):t.shiftKey?n._webAppState.clientEndPoint.invoke("ContextActivationManager_notifyHost",null,[n._webAppState.id,e.AgaveHostAction.TabExitShift]):n._webAppState.clientEndPoint.invoke("ContextActivationManager_notifyHost",null,[n._webAppState.id,e.AgaveHostAction.TabExit]))}else if(27==t.keyCode)t.preventDefault(),n._webAppState.clientEndPoint.invoke("ContextActivationManager_notifyHost",null,[n._webAppState.id,e.AgaveHostAction.EscExit]);else if(113==t.keyCode)t.preventDefault(),n._webAppState.clientEndPoint.invoke("ContextActivationManager_notifyHost",null,[n._webAppState.id,e.AgaveHostAction.F2Exit]);else if((t.ctrlKey||t.metaKey||t.shiftKey||t.altKey)&&t.keyCode>=1&&t.keyCode<=255){var o={keyCode:t.keyCode,shiftKey:t.shiftKey,altKey:t.altKey,ctrlKey:t.ctrlKey,metaKey:t.metaKey};n._webAppState.clientEndPoint.invoke("ContextActivationManager_notifyHost",null,[n._webAppState.id,e.AgaveHostAction.KeyboardShortcuts,o])}},a=function(e){117==e.keyCode&&e.ctrlKey&&(e.preventDefault?e.preventDefault():e.returnValue=!1)};e.Utility._DebugXdm||(t?(e.OUtil.addEventListener(window,"focus",r),e.OUtil.addEventListener(window,"blur",i),e.OUtil.addEventListener(window,"keydown",o),e.OUtil.addEventListener(window,"keypress",a)):(e.OUtil.removeEventListener(window,"focus",r),e.OUtil.removeEventListener(window,"blur",i),e.OUtil.removeEventListener(window,"keydown",o),e.OUtil.removeEventListener(window,"keypress",a)))},n.prototype.getTabbableElements=function(){return this._tabbableElements},n.prototype.setupNestedAppAuthDependencies=function(){var e=this;window.__initializeNestedAppAuth=function(){return e._initializeNestedAppAuthPromise||(e._initializeNestedAppAuthPromise=__awaiter(e,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:return[4,Office.onReadyInternal()];case 1:return e.sent(),this._createNaaBridge?[4,this._createNaaBridge()]:[3,3];case 2:e.sent(),e.label=3;case 3:return[2]}}))}))),e._initializeNestedAppAuthPromise}},n}(e.InitializationHelper);e.WebInitializationHelper=t}(OSF||(OSF={})),function(e){var t=function(){function t(e,t){this._initializationHelper=e,this._scriptMessager=t}return t.prototype.read=function(e){this._initializationHelper.getAppContext(null,(function(t){if(e){var n=t.get_settingsFunc()();e(0,n)}}),(function(t){e&&e(5001,{})}))},t.prototype.write=function(t,n){var r={},i=[],o=[];for(var a in t)i.push(a),o.push(t[a]);r.keys=i,r.values=o;this._scriptMessager.invokeMethod(e.Webkit.MessageHandlerName,e.Webkit.MethodId.WriteSettings,r,(function(e){n&&n(e[0])}))},t}();e.WebkitClientSettingsManager=t}(OSF||(OSF={})),function(e){!function(t){t.MessageHandlerName="Agave",t.PopupMessageHandlerName="WefPopupHandler",function(e){e[e.Settings=0]="Settings",e[e.SolutionReferenceId=1]="SolutionReferenceId",e[e.AppType=2]="AppType",e[e.MajorVersion=3]="MajorVersion",e[e.MinorVersion=4]="MinorVersion",e[e.RevisionVersion=5]="RevisionVersion",e[e.APIVersionSequence=6]="APIVersionSequence",e[e.AppCapabilities=7]="AppCapabilities",e[e.APPUILocale=8]="APPUILocale",e[e.AppDataLocale=9]="AppDataLocale",e[e.BindingCount=10]="BindingCount",e[e.DocumentUrl=11]="DocumentUrl",e[e.ActivationMode=12]="ActivationMode",e[e.ControlIntegrationLevel=13]="ControlIntegrationLevel",e[e.SolutionToken=14]="SolutionToken",e[e.APISetVersion=15]="APISetVersion",e[e.CorrelationId=16]="CorrelationId",e[e.InstanceId=17]="InstanceId",e[e.TouchEnabled=18]="TouchEnabled",e[e.CommerceAllowed=19]="CommerceAllowed",e[e.RequirementMatrix=20]="RequirementMatrix",e[e.HostCustomMessage=21]="HostCustomMessage",e[e.HostFullVersion=22]="HostFullVersion",e[e.InitialDisplayMode=23]="InitialDisplayMode",e[e.FeatureGates=24]="FeatureGates",e[e.HostSettings=25]="HostSettings",e[e.OfficeThemeInfo=26]="OfficeThemeInfo"}(t.AppContextProperties||(t.AppContextProperties={})),function(e){e[e.Execute=1]="Execute",e[e.RegisterEvent=2]="RegisterEvent",e[e.UnregisterEvent=3]="UnregisterEvent",e[e.WriteSettings=4]="WriteSettings",e[e.GetContext=5]="GetContext",e[e.SendMessage=6]="SendMessage",e[e.MessageParent=7]="MessageParent",e[e.SendMessage2=8]="SendMessage2",e[e.MessageParent2=9]="MessageParent2",e[e.CloseSdxDialog=10]="CloseSdxDialog",e[e.ResizeSdxDialog=11]="ResizeSdxDialog"}(t.MethodId||(t.MethodId={}));var n=function(){function t(e){this.hostScriptProxy=e,this.useFullDialogAPI=!!window._enableFullDialogAPI,this.osfSupportsDialogOrigin=!!window._osfEnableDialogOrigin}return t.prototype.execute=function(t,n,r){var i={id:t,apiArgs:n};this.hostScriptProxy.invokeMethod(e.Webkit.MessageHandlerName,e.Webkit.MethodId.Execute,i,(function(t){if(r){var n=[];if(e.OUtil.isArray(t))for(var i=0;i<t.length;i++){var o=t[i];e.OUtil.isArray(o)&&(o=new e.WebkitSafeArray(o)),n.unshift(o)}return r.apply(null,n)}}))},t.prototype.registerEvent=function(t,n,r,i,o){this.hostScriptProxy.registerEvent(e.Webkit.MessageHandlerName,e.Webkit.MethodId.RegisterEvent,t,r,(function(t){var n=t,r=0;e.OUtil.isArray(t)&&t.length>=2&&(n=t[0],r=t[1]),i&&i(r,new e.WebkitSafeArray(n))}),(function(t){if(o)return o(new e.WebkitSafeArray(t))}))},t.prototype.unregisterEvent=function(t,n,r,i){this.hostScriptProxy.unregisterEvent(e.Webkit.MessageHandlerName,e.Webkit.MethodId.UnregisterEvent,t,r,(function(t){return i(new e.WebkitSafeArray(t))}))},t.prototype.messageParent=function(t){var n,r;if(this.osfSupportsDialogOrigin&&t[e.ParameterNames.TargetOrigin]?(n=this.useFullDialogAPI?JSON.stringify(t):t[e.ParameterNames.MessageToParent],r=e.Webkit.MethodId.MessageParent2):(n=t[e.ParameterNames.MessageToParent],r=e.Webkit.MethodId.MessageParent),this.useFullDialogAPI)this.hostScriptProxy.invokeMethod(e.Webkit.MessageHandlerName,r,n,null);else{var i={dialogMessage:{messageType:0,messageContent:n}},o=r==e.Webkit.MethodId.MessageParent2?t[e.ParameterNames.TargetOrigin]:window.location.origin;window.opener.postMessage(JSON.stringify(i),o)}},t.prototype.openDialog=function(n,r,i,o,a){if(this.useFullDialogAPI)this.registerEvent(n,r,i,o,a);else if(!t.popup||t.popup.closed){t.OpenDialogCallback=void 0;var s=JSON.parse(i),c=s.url;if(c){var l=c.split("#"),u="?";l[0].indexOf("?")>-1&&(u="&");var f="width="+screen.width*s.width/100+", height="+screen.height*s.height/100;l[0]=l[0].concat(u).concat("action=displayDialog");var d=l.join("#");t.popup=window.open(d,"",f),t.DialogEventListener=function(t){if(t.origin==window.location.origin)try{var r=JSON.parse(t.data);r.dialogMessage&&o(n,[0,r.dialogMessage.messageContent,t.origin])}catch(n){e.Utility.trace("messages received cannot be handlered. Message:"+t.data)}},t.OpenDialogCallback=function(e){0==e&&(window.addEventListener("message",t.DialogEventListener),t.interval=window.setInterval(p,1e3),t.NotifyError=function(e){o(n,[e])}),a(e)}}else a(12003)}else a(12007);function p(){try{(null==t.popup||t.popup.closed)&&(window.clearInterval(t.interval),window.removeEventListener("message",t.DialogEventListener),t.NotifyError=null,t.popup=null,o(n,[12006]))}catch(t){e.Utility.trace("Error happened when popup window closed.")}}},t.prototype.closeDialog=function(e,n,r,i){this.useFullDialogAPI?this.unregisterEvent(e,n,r,i):t.popup?(t.interval&&window.clearInterval(t.interval),t.popup.close(),t.popup=null,window.removeEventListener("message",t.DialogEventListener),t.NotifyError=null,i(0)):i(5001)},t.prototype.sendMessage=function(t){var n,r;this.osfSupportsDialogOrigin&&t[e.ParameterNames.TargetOrigin]?(n=JSON.stringify(t),r=e.Webkit.MethodId.SendMessage2):(n=t[e.ParameterNames.MessageContent],r=e.Webkit.MethodId.SendMessage,!isNaN(parseFloat(n))&&isFinite(n)&&(n=n.toString())),this.hostScriptProxy.invokeMethod(e.Webkit.MessageHandlerName,r,n,null)},t.prototype.closeSdxDialog=function(t){var n=[t],r=e.Webkit.MethodId.CloseSdxDialog;this.hostScriptProxy.invokeMethod(e.Webkit.MessageHandlerName,r,n,null)},t.prototype.resizeSdxDialog=function(t,n){var r=[t,n],i=e.Webkit.MethodId.ResizeSdxDialog;this.hostScriptProxy.invokeMethod(e.Webkit.MessageHandlerName,i,r,null)},t}();t.WebkitHostController=n}(e.Webkit||(e.Webkit={}))}(OSF||(OSF={})),function(e){var t=function(t){function n(e,n,r,i){var o=t.call(this,e,n,r,i)||this;return o._serializedSettings={},o._serializedHostSettings={},o.initializeWebkitMessaging(),o}return __extends(n,t),n.prototype.initializeWebkitMessaging=function(){e.ScriptMessaging=OSFWebkit.ScriptMessaging},n.prototype.getAppContext=function(t,n,r){var i,o=this;i=this._hostInfo.isDialog&&window.webkit.messageHandlers[e.Webkit.PopupMessageHandlerName]?e.Webkit.PopupMessageHandlerName:e.Webkit.MessageHandlerName,e.ScriptMessaging.GetScriptMessenger().invokeMethod(i,e.Webkit.MethodId.GetContext,[],(function(t){var r,i=e.Webkit.AppContextProperties,a=t[i.AppType],s=t[i.Settings];if(s&&2===s.length)for(var c=s[0],l=s[1],u=0;u<c.length;u++)o._serializedSettings[c[u]]=l[u];var f=t[i.HostSettings];if(f&&2===f.length)for(c=f[0],l=f[1],u=0;u<c.length;u++)o._serializedHostSettings[c[u]]=l[u];var d=t[i.SolutionReferenceId],p=t[i.MajorVersion],m=t[i.MinorVersion],g=t[i.AppCapabilities],h=t[i.APPUILocale],y=t[i.AppDataLocale],v=t[i.DocumentUrl],O=t[i.ActivationMode],S=t[i.ControlIntegrationLevel],b=t[i.SolutionToken];b=b?b.toString():"";var _,A=t[i.CorrelationId],C=t[i.InstanceId],P=t[i.TouchEnabled],E=t[i.CommerceAllowed],I=t[i.RequirementMatrix],w=t[i.HostCustomMessage],T=t[i.HostFullVersion],D=t[i.InitialDisplayMode],x=t[i.FeatureGates];if(x)try{_=JSON.parse(x)}catch(t){e.AppTelemetry&&e.AppTelemetry.logAppException("Exception trying to parse FeatureGates."+t)}var F=null;if(t[i.OfficeThemeInfo])try{F=JSON.parse(t[i.OfficeThemeInfo])}catch(t){e.AppTelemetry&&e.AppTelemetry.logAppException("Exception while parsing officeThemeInfo. Details: "+t)}var M={};if(F){var N={bodyBackgroundColor:{name:"bodyBackgroundColor",convertToHex:!0},bodyForegroundColor:{name:"bodyForegroundColor",convertToHex:!0},controlBackgroundColor:{name:"controlBackgroundColor",convertToHex:!0},controlForegroundColor:{name:"controlForegroundColor",convertToHex:!0},primaryFontColor:{name:"bodyForegroundColor",convertToHex:!0},primaryBackgroundColor:{name:"bodyBackgroundColor",convertToHex:!0},secondaryFontColor:{name:"controlForegroundColor",convertToHex:!0},secondaryBackgroundColor:{name:"controlBackgroundColor",convertToHex:!0},fluentThemeData:{name:"fluentThemeData",convertToHex:!1}};for(var R in F){var H=!1,k=R;N[R]&&(k=N[R].name,H=N[R].convertToHex),M[k]=H?e.OUtil.convertIntToCssHexColor(F[R]):F[R]}}r=new e.OfficeAppContext(d,a,p,h,y,v,g,(function(){return o._serializedSettings}),O,S,b,A,C,P,E,m,I,w,T,void 0,void 0,void 0,void 0,void 0,_,M,D,void 0,void 0,(function(){return o._serializedHostSettings}),!1,void 0,void 0,void 0),n(r)}))},n.prototype.createClientHostController=function(){return this._clientHostController||(this._clientHostController=new e.Webkit.WebkitHostController(e.ScriptMessaging.GetScriptMessenger())),this._clientHostController},n.prototype.createAsyncMethodExecutor=function(){return new e.SafeArrayAsyncMethodExecutor(this.createClientHostController())},n.prototype.createClientSettingsManager=function(){return new e.WebkitClientSettingsManager(this,e.ScriptMessaging.GetScriptMessenger())},n}(e.InitializationHelper);e.WebkitInitializationHelper=t}(OSF||(OSF={})),function(e){var t=function(){function t(e){this.data=e,this.safeArrayFlag=this.isSafeArray(e)}return t.prototype.dimensions=function(){var e=0;return this.safeArrayFlag?e=this.data[0][0]:this.isArray()&&(e=2),e},t.prototype.getItem=function(){var e=null;e=this.safeArrayFlag?this.toArray():this.data;for(var t=0;t<arguments.length;t++)e=e[arguments[t]];return e},t.prototype.lbound=function(e){return 0},t.prototype.ubound=function(t){var n=0;if(this.safeArrayFlag)n=this.data[0][t];else if(this.isArray()){if(1==t)return this.data.length;if(2==t){if(e.OUtil.isArray(this.data[0]))return this.data[0].length;if(null!=this.data[0])return 1}}return n},t.prototype.toArray=function(){if(0==this.isArray())return this.data;for(var e=[],n=this.safeArrayFlag?1:0;n<this.data.length;n++){var r=this.data[n];this.isSafeArray(r)?e.push(new t(r)):e.push(r)}return e},t.prototype.isArray=function(){return e.OUtil.isArray(this.data)},t.prototype.isSafeArray=function(t){var n=!1;if(e.OUtil.isArray(t)&&e.OUtil.isArray(t[0])){var r=t[0],i=r[0];if(r.length!=i+1)return!1;for(var o=1,a=1;a<r.length;a++){var s=r[a];if(0==isFinite(s))return!1;o*=s}n=++o==t.length}return n},t}();e.WebkitSafeArray=t}(OSF||(OSF={})),function(e){!function(e){var t=null;e.agaveHostCallback=function(e,n){t.agaveHostCallback(e,n)},e.agaveHostEventCallback=function(e,n){t.agaveHostEventCallback(e,n)},e.GetScriptMessenger=function(){return null==t&&(t=r.IsSupportedByHost()?new r:new i("OSF.ScriptMessaging.agaveHostCallback","OSF.ScriptMessaging.agaveHostEventCallback")),t};var n=function(e,t,n){this.id=e,this.targetId=t,this.handler=n},r=function(){function e(){this.eventHandlers=[]}return e.IsSupportedByHost=function(){return!!window._osfHostAPI},e.prototype.invokeMethod=function(e,t,n,r){window._osfHostAPI(e,this.constructMessagingArgs(t,n),(function(e){var t=r(e);return void 0===t||!0===t}))},e.prototype.registerEvent=function(e,t,n,r,i,o){var a={id:n,targetId:r},s=window._osfHostRegisterEvent(e,this.constructMessagingArgs(t,a),(function(e){return i(e),!1}),(function(e){return o(e),!0}));this.eventHandlers.push({targetId:r,dispId:n,callbackId:s.eventCallbackId})},e.prototype.unregisterEvent=function(e,t,n,r,i){var o={id:n,targetId:r};window._osfHostAPI(e,this.constructMessagingArgs(t,o),(function(e){return i(e),!0}));for(var a=this.eventHandlers.length-1;a>=0;a--){var s=this.eventHandlers[a];s.dispId===n&&s.targetId===r&&(this.eventHandlers.splice(a,1),window._osfHostUnregisterCallback(s.callbackId))}},e.prototype.agaveHostCallback=function(e,t){},e.prototype.agaveHostEventCallback=function(e,t){},e.prototype.constructMessagingArgs=function(e,t){return{params:t,methodId:e}},e}(),i=function(){function e(t,n){this.callingIndex=0,this.callbackList={},this.eventHandlerList={},this.asyncMethodCallbackFunctionName=t,this.eventCallbackFunctionName=n,this.conversationId=e.getCurrentTimeMS().toString()}return e.prototype.invokeMethod=function(e,t,n,r){this.postWebkitMessage({},e,t,n,r)},e.prototype.registerEvent=function(e,t,r,i,o,a){var s={eventCallbackFunction:this.eventCallbackFunctionName},c={id:r,targetId:i},l=this.postWebkitMessage(s,e,t,c,a);this.eventHandlerList[l]=new n(r,i,o)},e.prototype.unregisterEvent=function(e,t,n,r,i){var o={id:n,targetId:r};for(var a in this.eventHandlerList)if(this.eventHandlerList.hasOwnProperty(a)){var s=this.eventHandlerList[a];s.id==n&&s.targetId==r&&delete this.eventHandlerList[a]}this.invokeMethod(e,t,o,i)},e.prototype.agaveHostCallback=function(e,t){var n=this.callbackList[e];if(n){var r=n(t);void 0!==r&&!0!==r||delete this.callbackList[e]}},e.prototype.agaveHostEventCallback=function(e,t){var n=this.eventHandlerList[e];n&&n.handler(t)},e.prototype.postWebkitMessage=function(t,n,r,i,o){t.methodId=r,t.params=i;var a="";o&&(a=this.generateCorrelationId(),this.callbackList[a]=o,t.callbackId=a,t.callbackFunction=this.asyncMethodCallbackFunctionName);var s=function(){window.webkit.messageHandlers[n].postMessage(JSON.stringify(t))},c=e.getCurrentTimeMS();return null==this.lastMessageTimestamp||c-this.lastMessageTimestamp>=e.MESSAGE_TIME_DELTA?(s(),this.lastMessageTimestamp=c):(this.lastMessageTimestamp+=e.MESSAGE_TIME_DELTA,setTimeout((function(){s()}),this.lastMessageTimestamp-c)),a},e.prototype.generateCorrelationId=function(){return++this.callingIndex,this.conversationId+this.callingIndex},e.getCurrentTimeMS=function(){return(new Date).getTime()},e.MESSAGE_TIME_DELTA=10,e}()}(e.ScriptMessaging||(e.ScriptMessaging={}))}(OSFWebkit||(OSFWebkit={})),function(e){var t=function(){function t(e,t){this._initializationHelper=e,this._scriptMessager=t}return t.prototype.read=function(e){this._initializationHelper.getAppContext(null,(function(t){if(e){var n=t.get_settingsFunc()();e(0,n)}}),(function(t){e&&e(5001,{})}))},t.prototype.write=function(t,n){var r={},i=[],o=[];for(var a in t)i.push(a),o.push(t[a]);r.keys=i,r.values=o;this._scriptMessager.invokeMethod(e.WebView.MessageHandlerName,e.WebView.MethodId.WriteSettings,r,(function(e){n&&n(e[0])}))},t}();e.WebViewClientSettingsManager=t}(OSF||(OSF={})),function(e){!function(t){t.MessageHandlerName="Agave",t.PopupMessageHandlerName="WefPopupHandler",function(e){e[e.Settings=0]="Settings",e[e.SolutionReferenceId=1]="SolutionReferenceId",e[e.AppType=2]="AppType",e[e.MajorVersion=3]="MajorVersion",e[e.MinorVersion=4]="MinorVersion",e[e.RevisionVersion=5]="RevisionVersion",e[e.APIVersionSequence=6]="APIVersionSequence",e[e.AppCapabilities=7]="AppCapabilities",e[e.APPUILocale=8]="APPUILocale",e[e.AppDataLocale=9]="AppDataLocale",e[e.BindingCount=10]="BindingCount",e[e.DocumentUrl=11]="DocumentUrl",e[e.ActivationMode=12]="ActivationMode",e[e.ControlIntegrationLevel=13]="ControlIntegrationLevel",e[e.SolutionToken=14]="SolutionToken",e[e.APISetVersion=15]="APISetVersion",e[e.CorrelationId=16]="CorrelationId",e[e.InstanceId=17]="InstanceId",e[e.TouchEnabled=18]="TouchEnabled",e[e.CommerceAllowed=19]="CommerceAllowed",e[e.RequirementMatrix=20]="RequirementMatrix",e[e.OfficeThemeInfo=21]="OfficeThemeInfo"}(t.AppContextProperties||(t.AppContextProperties={})),function(e){e[e.Execute=1]="Execute",e[e.RegisterEvent=2]="RegisterEvent",e[e.UnregisterEvent=3]="UnregisterEvent",e[e.WriteSettings=4]="WriteSettings",e[e.GetContext=5]="GetContext",e[e.OnKeydown=6]="OnKeydown",e[e.AddinInitialized=7]="AddinInitialized",e[e.OpenWindow=8]="OpenWindow",e[e.MessageParent=9]="MessageParent",e[e.SendMessage=10]="SendMessage"}(t.MethodId||(t.MethodId={}));var n=function(){function t(e){this.hostScriptProxy=e}return t.prototype.execute=function(t,n,r){var i=n;null==i&&(i=[]);var o={id:t,apiArgs:i};this.hostScriptProxy.invokeMethod(e.WebView.MessageHandlerName,e.WebView.MethodId.Execute,o,(function(t){var n=t;if(e.OUtil.isArray(t)&&t.length>=2){t[0];n=t[1]}if(r)return r(new e.WebkitSafeArray(n))}))},t.prototype.registerEvent=function(t,n,r,i,o){this.hostScriptProxy.registerEvent(e.WebView.MessageHandlerName,e.WebView.MethodId.RegisterEvent,t,r,(function(t){var n=t,r=0;e.OUtil.isArray(t)&&t.length>=2&&(r=t[0],n=t[1]),i&&i(r,new e.WebkitSafeArray(n))}),(function(t){if(o)return o(new e.WebkitSafeArray(t))}))},t.prototype.unregisterEvent=function(t,n,r,i){this.hostScriptProxy.unregisterEvent(e.WebView.MessageHandlerName,e.WebView.MethodId.UnregisterEvent,t,r,(function(t){return i(new e.WebkitSafeArray(t))}))},t.prototype.messageParent=function(t){var n={dialogMessage:{messageType:0,messageContent:t[e.ParameterNames.MessageToParent]}};window.opener.postMessage(JSON.stringify(n),window.location.origin)},t.prototype.openDialog=function(n,r,i,o,a){var s=JSON.parse(i),c=s.url;if(c){var l=c.split("#"),u="?";c.indexOf("?")>-1&&(u="&");var f="width="+screen.width*s.width/100+", height="+screen.height*s.height/100;l[0]=l[0].concat(u).concat("action=displayDialog");var d,p=l.join("#");t.popup=window.open(p,"",f),window.addEventListener("message",(function(r){if(r.source==t.popup)try{var i=JSON.parse(r.data);i.dialogMessage&&o(n,[0,i.dialogMessage.messageContent])}catch(t){e.Utility.trace("messages received cannot be handled. Message:"+r.data)}})),d=window.setInterval((function(){try{(null==t.popup||t.popup.closed)&&(window.clearInterval(d),o(n,[12006]))}catch(t){e.Utility.trace("Error happened when popup window closed.")}}),1e3),a(0)}},t.prototype.closeDialog=function(e,n,r,i){t.popup?(t.popup.close(),t.popup=null,i(0)):i(5001)},t.prototype.sendMessage=function(t){var n=t[e.ParameterNames.MessageContent];!isNaN(parseFloat(n))&&isFinite(n)&&(n=n.toString()),this.hostScriptProxy.invokeMethod(e.WebView.MessageHandlerName,e.WebView.MethodId.SendMessage,n,null)},t.prototype.closeSdxDialog=function(t){throw e.Utility.createNotImplementedException()},t.prototype.resizeSdxDialog=function(t,n){throw e.Utility.createNotImplementedException()},t}();t.WebViewHostController=n}(e.WebView||(e.WebView={}))}(OSF||(OSF={})),function(e){var t=function(t){function n(e,n,r,i){var o=t.call(this,e,n,r,i)||this;return o._serializedSettings={},o.initializeWebViewMessaging(),o}return __extends(n,t),n.prototype.initializeWebViewMessaging=function(){e.ScriptMessaging=e.WebView.ScriptMessaging},n.prototype.getAppContext=function(t,n,r){var i,o=this;i=this._hostInfo.isDialog?e.WebView.PopupMessageHandlerName:e.WebView.MessageHandlerName,e.ScriptMessaging.GetScriptMessenger().invokeMethod(i,e.WebView.MethodId.GetContext,[],(function(t){var r,i=e.Webkit.AppContextProperties,a=t[i.AppType],s=t[i.Settings];if(s&&2===s.length)for(var c=s[0],l=s[1],u=0;u<c.length;u++)o._serializedSettings[c[u]]=l[u];var f=t[i.SolutionReferenceId],d=t[i.MajorVersion],p=t[i.MinorVersion],m=t[i.AppCapabilities],g=t[i.APPUILocale],h=t[i.AppDataLocale],y=t[i.DocumentUrl],v=t[i.ActivationMode],O=t[i.ControlIntegrationLevel],S=t[i.SolutionToken];S=S?S.toString():"";var b,_=t[i.CorrelationId],A=t[i.InstanceId],C=t[i.TouchEnabled],P=t[i.CommerceAllowed],E=t[i.RequirementMatrix],I=t[i.HostCustomMessage],w=t[i.HostFullVersion],T=t[i.InitialDisplayMode],D=t[i.FeatureGates];if(D)try{b=JSON.parse(D)}catch(t){e.AppTelemetry&&e.AppTelemetry.logAppException("Exception trying to parse FeatureGates."+t)}r=new e.OfficeAppContext(f,a,d,g,h,y,m,(function(){return o._serializedSettings}),v,O,S,_,A,C,P,p,E,I,w,void 0,void 0,void 0,void 0,void 0,b,void 0,T,void 0,void 0,void 0,!1,void 0,void 0,void 0),n(r)}))},n.prototype.createClientHostController=function(){return this._clientHostController||(this._clientHostController=new e.WebView.WebViewHostController(e.ScriptMessaging.GetScriptMessenger())),this._clientHostController},n.prototype.createAsyncMethodExecutor=function(){return new e.SafeArrayAsyncMethodExecutor(this.createClientHostController())},n.prototype.createClientSettingsManager=function(){return new e.WebViewClientSettingsManager(this,e.ScriptMessaging.GetScriptMessenger())},n}(e.InitializationHelper);e.WebViewInitializationHelper=t}(OSF||(OSF={})),function(e){var t;!function(e){!function(e){e[e.MethodCallback=0]="MethodCallback",e[e.EventCallback=1]="EventCallback"}(e.CallbackType||(e.CallbackType={}));var t=function(e,t,n){this.callbackType=e,this.callbackId=t,this.params=n};e.CallbackData=t}(t||(t={})),function(n){var r=function(){function n(){}return n.getInstance=function(){return null==n.uniqueInstance&&(n.uniqueInstance=new n),n.uniqueInstance},n.prototype.postMessage=function(e,t){agaveHost.postMessage(t)},n.prototype.ReceiveMessage=function(n){switch(n.callbackType){case t.CallbackType.MethodCallback:e.WebView.ScriptMessaging.agaveHostCallback(n.callbackId,n.params);break;case t.CallbackType.EventCallback:e.WebView.ScriptMessaging.agaveHostEventCallback(n.callbackId,n.params)}},n}();n.Poster=r}(e.Android||(e.Android={})),function(n){var r=function(){function n(){window.addEventListener("message",this.OnReceiveMessage.bind(this))}return n.prototype.postMessage=function(e,t){window.parent.postMessage(t,"*")},n.prototype.OnReceiveMessage=function(n){if(n.source==window.parent&&window.parent==window.top&&n.origin.startsWith("ms-appx-web://")){var r;try{r=JSON.parse(n.data)}catch(e){return}switch(r.callbackType){case t.CallbackType.MethodCallback:e.WebView.ScriptMessaging.agaveHostCallback(r.callbackId,JSON.parse(r.params));break;case t.CallbackType.EventCallback:e.WebView.ScriptMessaging.agaveHostEventCallback(r.callbackId,JSON.parse(r.params))}}},n}();n.Poster=r}(e.WinRT||(e.WinRT={}))}(OSF||(OSF={})),function(e){!function(t){!function(t){var n=null;t.agaveHostCallback=function(e,t){n.agaveHostCallback(e,t)},t.agaveHostEventCallback=function(e,t){n.agaveHostEventCallback(e,t)},t.GetScriptMessenger=function(){if(null==n){var t=e._OfficeAppFactory.getHostInfo().hostPlatform;if(t===e.HostInfoPlatform.android)n=new i("OSF.ScriptMessaging.agaveHostCallback","OSF.ScriptMessaging.agaveHostEventCallback",e.Android.Poster.getInstance());else{if(t!==e.HostInfoPlatform.winrt)throw e.Utility.createNotImplementedException();n=new i("agaveHostCallback","agaveHostEventCallback",new e.WinRT.Poster)}}return n};var r=function(e,t,n){this.id=e,this.targetId=t,this.handler=n},i=function(){function e(t,n,r){this.callingIndex=0,this.callbackList={},this.eventHandlerList={},this.asyncMethodCallbackFunctionName=t,this.eventCallbackFunctionName=n,this.poster=r,this.conversationId=e.getCurrentTimeMS().toString()}return e.prototype.invokeMethod=function(e,t,n,r){this.postMessage({},e,t,n,r)},e.prototype.registerEvent=function(e,t,n,i,o,a){var s={eventCallbackFunction:this.eventCallbackFunctionName},c={id:n,targetId:i},l=this.postMessage(s,e,t,c,a);this.eventHandlerList[l]=new r(n,i,o)},e.prototype.unregisterEvent=function(e,t,n,r,i){var o={id:n,targetId:r};for(var a in this.eventHandlerList)if(this.eventHandlerList.hasOwnProperty(a)){var s=this.eventHandlerList[a];s.id==n&&s.targetId==r&&delete this.eventHandlerList[a]}this.invokeMethod(e,t,o,i)},e.prototype.agaveHostCallback=function(e,t){var n=this.callbackList[e];if(n){var r=n(t);void 0!==r&&!0!==r||delete this.callbackList[e]}},e.prototype.agaveHostEventCallback=function(e,t){var n=this.eventHandlerList[e];n&&n.handler(t)},e.prototype.postMessage=function(e,t,n,r,i){var o=this.generateCorrelationId();return this.callbackList[o]=i,e.methodId=n,e.params=r,e.callbackId=o,e.callbackFunction=this.asyncMethodCallbackFunctionName,this.poster.postMessage(t,JSON.stringify(e)),o},e.prototype.generateCorrelationId=function(){return++this.callingIndex,this.conversationId+this.callingIndex},e.getCurrentTimeMS=function(){return(new Date).getTime()},e.MESSAGE_TIME_DELTA=10,e}()}(t.ScriptMessaging||(t.ScriptMessaging={}))}(e.WebView||(e.WebView={}))}(OSF||(OSF={})),function(e){var t=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return __extends(n,t),n.prototype.messageParent=function(t){if(e.Utility.externalNativeFunctionExists(typeof window.external.MessageParent2))"undefined"!=typeof OsfOMToken&&OsfOMToken?window.external.MessageParent2(JSON.stringify(t),OsfOMToken):window.external.MessageParent2(JSON.stringify(t));else{var n=t[e.ParameterNames.MessageToParent];window.external.MessageParent(n)}},n.prototype.openDialog=function(e,t,n,r,i){this.registerEvent(e,t,n,r,i)},n.prototype.closeDialog=function(e,t,n,r){this.unregisterEvent(e,t,n,r)},n.prototype.sendMessage=function(t){if(e.Utility.externalNativeFunctionExists(typeof window.external.MessageChild2))"undefined"!=typeof OsfOMToken&&OsfOMToken?window.external.MessageChild2(JSON.stringify(t),OsfOMToken):window.external.MessageChild2(JSON.stringify(t));else{var n=t[e.ParameterNames.MessageContent];window.external.MessageChild(n)}},n.prototype.closeSdxDialog=function(t){e.Utility.externalNativeFunctionExists(typeof window.external.closeSdxDialog)&&window.external.closeSdxDialog(t)},n.prototype.resizeSdxDialog=function(t,n){e.Utility.externalNativeFunctionExists(typeof window.external.resizeSdxDialog)&&window.external.resizeSdxDialog(t,n)},n}(e.RichClientHostController);e.Win32RichClientHostController=t}(OSF||(OSF={})),function(e){var t=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return __extends(n,t),n.prototype.openDialog=function(t,r,i,o,a){if(!n.popup||n.popup.closed){window.dialogAPIErrorCode=void 0;var s=JSON.parse(i),c=s.url;if(c){var l=c.split("#"),u="?";l[0].indexOf("?")>-1&&(u="&");var f="width="+screen.width*s.width/100+", height="+screen.height*s.height/100;l[0]=l[0].concat(u).concat("action=displayDialog");var d=l.join("#");if(n.popup=window.open(d,"",f),n.DialogEventListener=function(r){if(r.source==n.popup)try{var i=JSON.parse(r.data);i.dialogMessage&&o(t,[0,i.dialogMessage.messageContent])}catch(t){e.Utility.trace("messages received cannot be handlered. Message:"+r.data)}},null!=n.popup&&null==window.dialogAPIErrorCode)window.addEventListener("message",n.DialogEventListener),n.interval=window.setInterval((function(){try{(null==n.popup||n.popup.closed)&&(window.clearInterval(n.interval),window.removeEventListener("message",n.DialogEventListener),n.NotifyError=null,o(t,[12006]))}catch(t){e.Utility.trace("Error happened when popup window closed.")}}),500),n.NotifyError=function(e){o(t,[e])},a(0);else{var p=5001;window.dialogAPIErrorCode&&(p=window.dialogAPIErrorCode),a(p)}}else a(12003)}else a(12007)},n.prototype.messageParent=function(t){var n={dialogMessage:{messageType:0,messageContent:t[e.ParameterNames.MessageToParent]}};window.opener.postMessage(JSON.stringify(n),window.location.origin)},n.prototype.closeDialog=function(e,t,r,i){n.popup?(n.interval&&window.clearInterval(n.interval),n.popup.close(),n.popup=null,window.removeEventListener("message",n.DialogEventListener),n.NotifyError=null,i(0)):i(5001)},n}(e.Webkit.WebkitHostController);e.MacRichClientHostController=t}(OSF||(OSF={})),function(e){var t;!function(e){!function(e){e.Init=function(){return function(){"use strict";function e(e){return"function"==typeof e}var t,n=Array.isArray?Array.isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)},r=0,i=function(e,n){d[r]=e,d[r+1]=n,2===(r+=2)&&(t?t(p):c())};var o=("undefined"!=typeof window?window:void 0)||{},a=(o.MutationObserver||o.WebKitMutationObserver,"undefined"!=typeof process&&"[object process]"==={}.toString.call(process)),s="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel;var c,l,u,f,d=new Array(1e3);function p(){for(var e=0;e<r;e+=2){(0,d[e])(d[e+1]),d[e]=void 0,d[e+1]=void 0}r=0}function m(){}a?(u=process.nextTick,f=process.versions.node.match(/^(?:(\d+)\.)?(?:(\d+)\.)?(\*|\d+)$/),Array.isArray(f)&&"0"===f[1]&&"10"===f[2]&&(u=setImmediate),c=function(){u(p)}):s?((l=new MessageChannel).port1.onmessage=p,c=function(){l.port2.postMessage(0)}):c=function(){setTimeout(p,1)};var g=void 0,h=new C;function y(t,n){if(n.constructor===t.constructor)!function(e,t){1===t._state?S(e,t._result):2===t._state?b(e,t._result):_(t,void 0,(function(t){v(e,t)}),(function(t){b(e,t)}))}(t,n);else{var r=function(e){try{return e.then}catch(e){return h.error=e,h}}(n);r===h?b(t,h.error):void 0===r?S(t,n):e(r)?function(e,t,n){i((function(e){var r=!1,i=function(e,t,n,r){try{e.call(t,n,r)}catch(e){return e}}(n,t,(function(n){r||(r=!0,t!==n?v(e,n):S(e,n))}),(function(t){r||(r=!0,b(e,t))}),e._label);!r&&i&&(r=!0,b(e,i))}),e)}(t,n,r):S(t,n)}}function v(e,t){var n;e===t?b(e,new TypeError("You cannot resolve a promise with itself")):"function"==typeof(n=t)||"object"==typeof n&&null!==n?y(e,t):S(e,t)}function O(e){e._onerror&&e._onerror(e._result),A(e)}function S(e,t){e._state===g&&(e._result=t,e._state=1,0!==e._subscribers.length&&i(A,e))}function b(e,t){e._state===g&&(e._state=2,e._result=t,i(O,e))}function _(e,t,n,r){var o=e._subscribers,a=o.length;e._onerror=null,o[a]=t,o[a+1]=n,o[a+2]=r,0===a&&e._state&&i(A,e)}function A(e){var t=e._subscribers,n=e._state;if(0!==t.length){for(var r,i,o=e._result,a=0;a<t.length;a+=3)r=t[a],i=t[a+n],r?E(n,r,i,o):i(o);e._subscribers.length=0}}function C(){this.error=null}var P=new C;function E(t,n,r,i){var o,a,s,c,l=e(r);if(l){if((o=function(e,t){try{return e(t)}catch(e){return P.error=e,P}}(r,i))===P?(c=!0,a=o.error,o=null):s=!0,n===o)return void b(n,new TypeError("A promises callback cannot return that same promise."))}else o=i,s=!0;n._state!==g||(l&&s?v(n,o):c?b(n,a):1===t?S(n,o):2===t&&b(n,o))}function I(e,t){var n=this;n._instanceConstructor=e,n.promise=new e(m),n._validateInput(t)?(n._input=t,n.length=t.length,n._remaining=t.length,n._init(),0===n.length?S(n.promise,n._result):(n.length=n.length||0,n._enumerate(),0===n._remaining&&S(n.promise,n._result))):b(n.promise,n._validationError())}I.prototype._validateInput=function(e){return n(e)},I.prototype._validationError=function(){return new Error("Array Methods must be provided an Array")},I.prototype._init=function(){this._result=new Array(this.length)};var w=I;I.prototype._enumerate=function(){for(var e=this,t=e.length,n=e.promise,r=e._input,i=0;n._state===g&&i<t;i++)e._eachEntry(r[i],i)},I.prototype._eachEntry=function(e,t){var n,r=this,i=r._instanceConstructor;"object"==typeof(n=e)&&null!==n?e.constructor===i&&e._state!==g?(e._onerror=null,r._settledAt(e._state,t,e._result)):r._willSettleAt(i.resolve(e),t):(r._remaining--,r._result[t]=e)},I.prototype._settledAt=function(e,t,n){var r=this,i=r.promise;i._state===g&&(r._remaining--,2===e?b(i,n):r._result[t]=n),0===r._remaining&&S(i,r._result)},I.prototype._willSettleAt=function(e,t){var n=this;_(e,void 0,(function(e){n._settledAt(1,t,e)}),(function(e){n._settledAt(2,t,e)}))};var T=function(e){return new w(this,e).promise};var D=function(e){var t=new this(m);if(!n(e))return b(t,new TypeError("You must pass an array to race.")),t;var r=e.length;function i(e){v(t,e)}function o(e){b(t,e)}for(var a=0;t._state===g&&a<r;a++)_(this.resolve(e[a]),void 0,i,o);return t};var x=function(e){if(e&&"object"==typeof e&&e.constructor===this)return e;var t=new this(m);return v(t,e),t};var F=function(e){var t=new this(m);return b(t,e),t},M=0;var N=R;function R(t){this._id=M++,this._state=void 0,this._result=void 0,this._subscribers=[],m!==t&&(e(t)||function(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}(),this instanceof R||function(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}(),function(e,t){try{t((function(t){v(e,t)}),(function(t){b(e,t)}))}catch(t){b(e,t)}}(this,t))}return R.all=T,R.race=D,R.resolve=x,R.reject=F,R._setScheduler=function(e){t=e},R._setAsap=function(e){i=e},R._asap=i,R.prototype={constructor:R,then:function(e,t){var n=this,r=n._state;if(1===r&&!e||2===r&&!t)return this;var o=new this.constructor(m),a=n._result;if(r){var s=arguments[r-1];i((function(){E(r,o,s,a)}))}else _(n,o,e,t);return o},catch:function(e){return this.then(null,e)}},N}.call(this)}}(e.PromiseImpl||(e.PromiseImpl={}))}(e._Internal||(e._Internal={})),function(e){e.OfficePromise=function(){if("undefined"==typeof window&&"function"==typeof Promise)return Promise;if("undefined"!=typeof window){if(window.Promise)return window.Promise;var t=e.PromiseImpl.Init();return window.Promise=t,t}}()}(t=e._Internal||(e._Internal={})),e.OfficePromise=t.OfficePromise,e.Promise=e.OfficePromise}(Office||(Office={})),function(e){e.getFields=function(e,t){var n=[];return void 0!==t.id&&n.push(oteljs.makeStringDataField(e+".Id",t.id)),void 0!==t.version&&n.push(oteljs.makeStringDataField(e+".Version",t.version)),void 0!==t.instanceId&&n.push(oteljs.makeStringDataField(e+".InstanceId",t.instanceId)),void 0!==t.name&&n.push(oteljs.makeStringDataField(e+".Name",t.name)),void 0!==t.marketplaceType&&n.push(oteljs.makeStringDataField(e+".MarketplaceType",t.marketplaceType)),void 0!==t.sessionId&&n.push(oteljs.makeStringDataField(e+".SessionId",t.sessionId)),void 0!==t.browserToken&&n.push(oteljs.makeStringDataField(e+".BrowserToken",t.browserToken)),void 0!==t.osfRuntimeVersion&&n.push(oteljs.makeStringDataField(e+".OsfRuntimeVersion",t.osfRuntimeVersion)),void 0!==t.officeJsVersion&&n.push(oteljs.makeStringDataField(e+".OfficeJsVersion",t.officeJsVersion)),void 0!==t.hostJsVersion&&n.push(oteljs.makeStringDataField(e+".HostJsVersion",t.hostJsVersion)),void 0!==t.assetId&&n.push(oteljs.makeStringDataField(e+".AssetId",t.assetId)),void 0!==t.providerName&&n.push(oteljs.makeStringDataField(e+".ProviderName",t.providerName)),void 0!==t.type&&n.push(oteljs.makeStringDataField(e+".Type",t.type)),void 0!==t.officeJSSource&&n.push(oteljs.makeInt64DataField(e+".OfficeJSSource",t.officeJSSource)),void 0!==t.isSecureDefaultsEnabled&&n.push(oteljs.makeBooleanDataField(e+".IsSecureDefaultsEnabled",t.isSecureDefaultsEnabled)),void 0!==t.hasAppSetIsSdx&&n.push(oteljs.makeBooleanDataField(e+".HasAppSetIsSdx",t.hasAppSetIsSdx)),n}}(SDX||(SDX={})),function(e){!function(t){var n,r=e.OUtil.Guid.generateNewGuid(),i=new RegExp("^https?://store\\.office(ppe|-int)?\\.com/","i"),o=!1,a="PRIVATE";t.enableTelemetry=!0;var s=function(){};t.AppInfo=s;var c=function(){function t(){this.clientIDKey="Office API client",this.logIdSetKey="Office App Log Id Set"}return t.prototype.getClientId=function(){var t=this.getValue(this.clientIDKey);return(!t||t.length<=0||t.length>40)&&(t=e.OUtil.Guid.generateNewGuid(),this.setValue(this.clientIDKey,t)),t},t.prototype.getValue=function(t){var n=e.OUtil.getLocalStorage(),r="";return n&&(r=n.getItem(t)),r},t.prototype.setValue=function(t,n){var r=e.OUtil.getLocalStorage();r&&r.setItem(t,n)},t}();function l(e){return e&&(e=e.replace(/[{}]/g,"").toLowerCase()),e||""}function u(e){try{return JSON.parse(e)}catch(t){return e}}function f(){n&&(o||OTel.OTelLogger.onTelemetryLoaded((function(){var t=[],r=n.isMos?1:0;t=t.concat([oteljs.makeStringDataField("Browser",n.browser),oteljs.makeInt64DataField("AppSizeWidth",window.innerWidth),oteljs.makeInt64DataField("AppSizeHeight",window.innerHeight),oteljs.makeInt64DataField("IsMOS",r)]),e.OUtil.isChangeGateEnabled("Microsoft.Office.SharedOnline.ChangeGate.OfficeVSO_10045620_CopilotAgentTelSettings")&&n.launchSource&&n.launchReason&&(t.push(oteljs.makeStringDataField("LaunchSource",n.launchSource)),t.push(oteljs.makeStringDataField("LaunchReason",n.launchReason))),Microsoft.Office.WebExtension.sendTelemetryEvent({eventName:"Office.Extensibility.OfficeJs.AppActivatedX",dataFields:t,eventFlags:{dataCategories:2,diagnosticLevel:110,samplingPolicy:191}})})))}function d(e,t){}function p(){var t=0!=(e._OfficeAppFactory.getHostInfo().flags&e.HostInfoFlags.PublicAddin);return t||!!n&&g(e._OfficeAppFactory.getHostInfo().hostPlatform,n.hostVersion)}function m(e,t){return p()||t!==e?t:a}function g(t,n){var r=!1,i=/^(\d+)\.(\d+)\.(\d+)\.(\d+)$/.exec(n);if(i){var o=parseInt(i[1]),a=parseInt(i[2]),s=parseInt(i[3]);t==e.HostInfoPlatform.win32?(o<16||16==o&&s<14225)&&(r=!0):t==e.HostInfoPlatform.mac&&(o<16||16==o&&(a<52||52==a&&s<808))&&(r=!0)}return r}function h(){return 0!=(e._OfficeAppFactory.getHostInfo().flags&e.HostInfoFlags.IsMos)}t.initialize=function(f){if(t.enableTelemetry&&!n){n=new s,f.get_hostFullVersion()?n.hostVersion=f.get_hostFullVersion():n.hostVersion=f.get_appVersion(),n.appId=p()?f.get_id():a,n.marketplaceType=f._marketplaceType,n.host=""+f.get_appName(),n.browser=window.navigator.userAgent,n.correlationId=l(f.get_correlationId()),n.clientId=(new c).getClientId(),n.appInstanceId=f.get_appInstanceId(),n.appInstanceId&&(n.appInstanceId=l(n.appInstanceId),n.appInstanceId=m(f.get_id(),n.appInstanceId)),n.message=f.get_hostCustomMessage(),n.officeJSVersion=e.ConstantNames.FileVersion,n.hostJSVersion="NA",f._wacHostEnvironment&&(n.wacHostEnvironment=f._wacHostEnvironment);var d=f.get_isFromWacAutomation();null!=d&&(n.isFromWacAutomation=d.toString().toLowerCase()),n.officeJSSource=e.OUtil.getLibraryReleaseVehicle(),n.isSecureDefaultsEnabled="undefined"!=typeof isOsfSecurityDefaultsEnabled&&!0===isOsfSecurityDefaultsEnabled,n.hasAppSetIsSdx=e.LoadScriptHelper.isSdx();var g=f.get_docUrl();n.docUrl=i.test(g)?g:"";var y=location.href;if(y&&(n.isPreload=-1!==y.indexOf("preload=1"),y=y.split("?")[0].split("#")[0]),n.isMos=h(),e.OUtil.isChangeGateEnabled("Microsoft.Office.SharedOnline.ChangeGate.OfficeVSO_10045620_CopilotAgentTelSettings")){var v=f.get_settingsFunc()();v&&v.LaunchSource&&v.LaunchReason&&(n.launchSource=u(v.LaunchSource),n.launchReason=u(v.LaunchReason))}!function(t,n){n.assetId="",n.userId="";try{if(!e.Utility.isNullOrEmpty(t)){var r=decodeURIComponent(t),i=new DOMParser,o=void 0,a=e.LoadScriptHelper.getTrustedTypesOptIn();if((null!=a?a:e.OUtil.isSecureDefaultsEnabled())&&window.trustedTypes&&window.trustedTypes.createPolicy)o=window.trustedTypes.createPolicy("officejs-domparser",{createHTML:function(e){return e}}).createHTML(r);else o=r;var s=i.parseFromString(o,"text/xml"),c=s.getElementsByTagName("t")[0].attributes.getNamedItem("cid"),l=s.getElementsByTagName("t")[0].attributes.getNamedItem("oid");c&&c.nodeValue?n.userId=c.nodeValue:l&&l.nodeValue&&(n.userId=l.nodeValue),n.assetId=s.getElementsByTagName("t")[0].attributes.getNamedItem("aid").nodeValue}}catch(e){}}(f.get_eToken(),n),n.sessionId=r,OTel.OTelLogger.initialize(n),n.isPreload?(o=!0,function(){try{Microsoft.Office.WebExtension.onReadyInternal().then((function(){var t=Office,n=OfficeCore;t.addin&&t.addin.onVisibilityModeChanged&&t.addin.onVisibilityModeChanged((function(n){n.visibilityMode===t.VisibilityMode.taskpane&&e.AppTelemetry.CallOnAppActivatedIfPending()})),t.addin&&t.addin._getState&&t.addin._getState().then((function(t){n.AppRuntimeState&&t===n.AppRuntimeState.visible&&e.AppTelemetry.CallOnAppActivatedIfPending()}))}))}catch(t){e.AppTelemetry&&e.AppTelemetry.logAppException("Exception happens at registerVisibilityEventOnPreload"+t)}}()):t.onAppActivated()}},t.onAppActivated=f,t.onScriptDone=function(e,t,n,r){},t.onCallDone=function(e,t,n,r,i){},t.onMethodDone=function(e,t,n,r){},t.onPropertyDone=function(t,n){e.AppTelemetry.onCallDone("property",-1,t,n,0)},t.onCheckWACHost=function(e,t,n,r,i){},t.onEventDone=function(t,n){e.AppTelemetry.onCallDone("event",t,null,0,n)},t.onRegisterDone=function(t,n,r,i){e.AppTelemetry.onCallDone(t?"registerevent":"unregisterevent",n,null,r,i)},t.onAppClosed=function(e,t){},t.setOsfControlAppCorrelationId=function(e){l(e)},t.doAppInitializationLogging=d,t.logAppCommonMessage=function(e){},t.logAppException=function(e){},t.CallOnAppActivatedIfPending=function(){o&&(o=!1,f())},t.canSendAddinId=p,t.getCompliantAppInstanceId=m,t._isComplianceExceptedHost=g,t.isMos=h}(e.AppTelemetry||(e.AppTelemetry={}))}(OSF||(OSF={})),function(e){var t=function(){function t(){}return t.loaded=function(){return!(void 0===t.logger)},t.ensureValue=function(e,t){return e||t},t.create=function(n){var r,i={id:n.appId,marketplaceType:n.marketplaceType,assetId:n.assetId,officeJsVersion:n.officeJSVersion,hostJsVersion:n.hostJSVersion,browserToken:n.clientId,instanceId:n.appInstanceId,sessionId:n.sessionId,officeJSSource:n.officeJSSource,isSecureDefaultsEnabled:n.isSecureDefaultsEnabled,hasAppSetIsSdx:n.hasAppSetIsSdx},o=SDX.getFields("SDX",i),a=OSF._OfficeAppFactory.getHostInfo().hostPlatform;if("web"===a)r=new e.SdxWacSink;else if(Office.context.requirements.isSetSupported("Telemetry","1.2"))r=new e.RichApiSink,this.richApiSink=r;else{if(!oteljs.AgaveSink)return console.error("Cannot create telemetry sink successfully"),null;var s={"App.Name":OSF._OfficeAppFactory.getHostInfo().hostType,"App.Platform":a,"App.Version":n.hostVersion,"Session.Id":t.ensureValue(n.correlationId,"00000000-0000-0000-0000-000000000000")};r=oteljs.AgaveSink.createInstance(s)}var c=new oteljs.SimpleTelemetryLogger(void 0,o);return c.addSink(r),c.setTenantToken("Office.Extensibility.OfficeJs","db334b301e7b474db5e0f02f07c51a47-a1b5bc36-1bbe-482f-a64a-c2d9cb606706-7439",1755),oteljs.onNotification().addListener((function(e){OSF.Utility.debugLog(e.message())})),c},t.checkAndResolvePromises=function(){t.loaded()&&(t.promises.forEach((function(e){e()})),t.promises=[])},t.initialize=function(e){t.Enabled?Office.onReadyInternal().then((function(){t.loaded()||(OSF.Utility.debugLog("Creating OTelLogger"),t.logger=t.create(e),t.checkAndResolvePromises())})):t.promises=[]},t.sendTelemetryEvent=function(e){t.onTelemetryLoaded((function(){try{t.logger.sendTelemetryEvent(e)}catch(e){console.error("Cannot send telemetry event: "+JSON.stringify(e))}}))},t.sendNonStandardEvent=function(e,n){t.onTelemetryLoaded((function(){try{t.logger.sendNonStandardEvent(e,n)}catch(e){console.error("Cannot send telemetry event: "+JSON.stringify(e))}}))},t.flushTelemetryQueue=function(){var e=this;return new Office.Promise((function(n){t.onTelemetryLoaded((function(){e.richApiSink?e.richApiSink.flushTelemetryQueue().then((function(){n()})):n()}))}))},t.onTelemetryLoaded=function(e){t.Enabled&&(t.loaded()?e():t.promises.push(e))},t.promises=[],t.Enabled=!0,t}();e.OTelLogger=t}(OTel||(OTel={})),function(e){var t=262144,n='{"version":1,"events":[',r="Microsoft.Office.SharedOnline.ChangeGate.OfficeVSO_11435062_TelemetryBatching",i="Office.Extensibility.OfficeJs.TelemetryStartupPerf",o=function(){function o(){var e=this;this._requestIsPending=!0,this._telemetryQueue=[],this._batchingDisabledForSession=!1,this._telemetryStartupPerfWindowEndMs=0,this._telemetryStartupPerfActiveMs=0,this._telemetryStartupPerfEventCount=0,this._telemetryStartupPerfDrainCount=0,this._telemetryStartupPerfMaxQueueDepth=0,this._telemetryStartupPerfEmitted=!1,this._telemetryStartupPerfFallbackOccurred=!1,this._telemetryStartupPerfUseDateNow=!1;var t=OSFPerformance.now();this._telemetryStartupPerfUseDateNow=t<=0,this._telemetryStartupPerfWindowEndMs=(this._telemetryStartupPerfUseDateNow?Date.now():t)+15e3,setTimeout((function(){return e.emitTelemetryStartupPerf()}),15e3),this.pause(1e3).then((function(){var t=e._telemetryQueue;e._telemetryQueue=[],e._requestIsPending=!1,e.processTelemetryEvents(t)}))}return o.prototype.sendTelemetryEvent=function(e){this._telemetryQueue.push([e,1]),this.recordTelemetryStartupPerfQueueDepth(e),this._requestIsPending||this.processWorkBacklog()},o.prototype.sendNonStandardEvent=function(e,t){this._telemetryQueue.push([e,t]),this.recordTelemetryStartupPerfQueueDepth(e),this._requestIsPending||this.processWorkBacklog()},o.prototype.flushTelemetryQueue=function(){var e=this;return new Office.Promise((function(t){var n=e._telemetryQueue;e._telemetryQueue=[],e.processTelemetryEvents(n).then((function(){t()}))}))},o.prototype.processWorkBacklog=function(){var e=this;this._requestIsPending=!0;var t=this._telemetryQueue;this._telemetryQueue=[],this.processTelemetryEvents(t).then(this.waitAndProcessMore.bind(this)).catch((function(t){oteljs.logError(1,"RichApiSink Error",t),e.waitAndProcessMore.bind(e)()}))},o.prototype.waitAndProcessMore=function(){var e=this;this.pause(1e3).then((function(){e._telemetryQueue.length>0&&setTimeout((function(){return e.processWorkBacklog()}),0),e._requestIsPending=!1})).catch((function(){}))},o.prototype.processTelemetryEvents=function(e){var t=this,n=this._processingPromise||this.createResolvedPromise();return this._processingPromise=n.then((function(){return t.processTelemetryEventsMeasured(e)})).catch((function(e){oteljs.logError(1,"RichApiSink Error",e)})),this._processingPromise},o.prototype.processTelemetryEventsMeasured=function(e){var t,n=this,r=this.startTelemetryStartupPerfDrain(e);try{t=this.processTelemetryEventsInternal(e)}catch(e){throw this.completeTelemetryStartupPerfDrain(r),e}return void 0===r?t:t.then((function(){return n.completeTelemetryStartupPerfDrain(r)}),(function(e){throw n.completeTelemetryStartupPerfDrain(r),e}))},o.prototype.processTelemetryEventsInternal=function(e){if(this.shouldProcessTelemetryEventsBatched())try{return this.processTelemetryEventsBatched(e)}catch(e){this._batchingDisabledForSession=!0,this.markTelemetryStartupPerfFallback()}return this.processTelemetryEventsUnbatched(e)},o.prototype.shouldProcessTelemetryEventsBatched=function(){return!(!OSF.OUtil.isChangeGateEnabled(r)||this._batchingDisabledForSession)&&this.isBatchingCapabilityAvailable()},o.prototype.isBatchingCapabilityAvailable=function(){try{var e=OfficeCore.TelemetryService;return!!(Office&&Office.context&&Office.context.requirements&&Office.context.requirements.isSetSupported("Telemetry","1.5")&&e&&e.prototype&&"function"==typeof e.prototype.sendTelemetryEventBatch)}catch(e){return!1}},o.prototype.processTelemetryEventsUnbatched=function(e){var t=this;try{var n=new OfficeCore.RequestContext;return e.forEach((function(e){var r=e[0],i=e[1];r.telemetryProperties&&t.queueTelemetryEventUnbatched(n,r,i)})),n.sync().catch((function(){oteljs.logNotification(2,1,(function(){return"RichApi telemetry call failed."}))}))}catch(e){return oteljs.logNotification(2,1,(function(){return"RichApi telemetry call failed."})),this.createResolvedPromise()}},o.prototype.queueTelemetryEventUnbatched=function(e,t,n){var r=[];this.addDataFields(r,t.dataFields);var i=t.eventContract?t.eventContract.name:"";t.eventContract&&this.addDataFields(r,t.eventContract.dataFields),1===n?e.telemetry.sendTelemetryEvent(t.telemetryProperties,t.eventName,i,oteljs.getEffectiveEventFlags(t),r):e.telemetry.sendNonStandardEvent(t.telemetryProperties,t.eventName,i,oteljs.getEffectiveEventFlags(t),r,n)},o.prototype.processTelemetryEventsBatched=function(e){var r=this,i=[],o=[],a=[],s=0,c=function(){0!==a.length&&(i.push({payload:n+a.join(",")+"]}",events:o}),o=[],a=[],s=0)};e.forEach((function(e){var n=e[0],l=e[1];if(n.telemetryProperties){var u=JSON.stringify(r.createBatchEvent(n,l));if(r.getBatchPayloadLength(1,u.length)>t)return r.markTelemetryStartupPerfFallback(),c(),void i.push({events:[e]});r.shouldStartNewBatch(a.length,s,u.length)&&c(),o.push(e),a.push(u),s+=u.length}})),c();var l=this.createResolvedPromise();return i.forEach((function(e){l=l.then((function(){if(void 0===e.payload||r._batchingDisabledForSession)return r.processTelemetryEventsUnbatched(e.events);try{return r.sendJsonTelemetryBatchChunk(e.payload,e.events)}catch(t){return r._batchingDisabledForSession=!0,r.markTelemetryStartupPerfFallback(),r.processTelemetryEventsUnbatched(e.events)}}))})),l},o.prototype.shouldStartNewBatch=function(e,n,r){return 0!==e&&(e>=1e3||this.getBatchPayloadLength(e+1,n+r)>t)},o.prototype.getBatchPayloadLength=function(e,t){var r=Math.max(0,e-1);return n.length+t+r+"]}".length},o.prototype.sendJsonTelemetryBatchChunk=function(e,t){var n=this;try{var r=new OfficeCore.RequestContext;return r.telemetry.sendTelemetryEventBatch(e),r.sync().catch((function(){return n._batchingDisabledForSession=!0,n.markTelemetryStartupPerfFallback(),oteljs.logNotification(2,1,(function(){return"RichApi telemetry batch call failed; falling back to per-event telemetry."})),n.processTelemetryEventsUnbatched(t)}))}catch(e){return this._batchingDisabledForSession=!0,this.markTelemetryStartupPerfFallback(),oteljs.logNotification(2,1,(function(){return"RichApi telemetry batch call failed; falling back to per-event telemetry."})),this.processTelemetryEventsUnbatched(t)}},o.prototype.startTelemetryStartupPerfDrain=function(e){if(!this._telemetryStartupPerfEmitted&&e&&0!==e.length){var t=this.getTimestampMilliseconds();if(!(t>=this._telemetryStartupPerfWindowEndMs)){var n=0;if(e.forEach((function(e){var t=e[0];t&&t.eventName!==i&&t.telemetryProperties&&n++})),0!==n)return this._telemetryStartupPerfActiveDrainStartMs=t,this._telemetryStartupPerfEventCount+=n,this._telemetryStartupPerfDrainCount++,t}}},o.prototype.completeTelemetryStartupPerfDrain=function(e){if(void 0!==e){var t=this.getTimestampMilliseconds();if(!this._telemetryStartupPerfEmitted){var n=Math.min(t,this._telemetryStartupPerfWindowEndMs);this._telemetryStartupPerfActiveMs+=Math.max(0,n-e)}this._telemetryStartupPerfActiveDrainStartMs=void 0,!this._telemetryStartupPerfEmitted&&t>=this._telemetryStartupPerfWindowEndMs&&this.emitTelemetryStartupPerf()}},o.prototype.emitTelemetryStartupPerf=function(){this._telemetryStartupPerfEmitted||void 0===this._telemetryStartupPerfActiveDrainStartMs&&(this._telemetryStartupPerfEmitted=!0,e.OTelLogger.sendTelemetryEvent({eventName:i,dataFields:[oteljs.makeDoubleDataField("StartupTelemetryDrainActiveMs",this._telemetryStartupPerfActiveMs),oteljs.makeStringDataField("AssignedTreatment",OSF.OUtil.isChangeGateEnabled(r)?"JsonStringBatch":"PerEvent"),oteljs.makeBooleanDataField("BatchingCapabilityAvailable",this.isBatchingCapabilityAvailable()),oteljs.makeBooleanDataField("FallbackOccurred",this._telemetryStartupPerfFallbackOccurred),oteljs.makeInt64DataField("MeasuredEventCount",this._telemetryStartupPerfEventCount),oteljs.makeInt64DataField("MeasuredDrainCount",this._telemetryStartupPerfDrainCount),oteljs.makeInt64DataField("MaxQueueDepth",this._telemetryStartupPerfMaxQueueDepth)],eventFlags:{dataCategories:6,diagnosticLevel:110,samplingPolicy:1}}))},o.prototype.recordTelemetryStartupPerfQueueDepth=function(e){this._telemetryStartupPerfEmitted||!e||e.eventName===i||this.getTimestampMilliseconds()>=this._telemetryStartupPerfWindowEndMs||(this._telemetryStartupPerfMaxQueueDepth=Math.max(this._telemetryStartupPerfMaxQueueDepth,this._telemetryQueue.length))},o.prototype.markTelemetryStartupPerfFallback=function(){!this._telemetryStartupPerfEmitted&&(void 0!==this._telemetryStartupPerfActiveDrainStartMs||this.getTimestampMilliseconds()<this._telemetryStartupPerfWindowEndMs)&&(this._telemetryStartupPerfFallbackOccurred=!0)},o.prototype.getTimestampMilliseconds=function(){return this._telemetryStartupPerfUseDateNow?Date.now():OSFPerformance.now()},o.prototype.createBatchEvent=function(e,t){var n=e.telemetryProperties,r=oteljs.getEffectiveEventFlags(e);return{eventName:e.eventName||"",eventType:this.numberOrDefault(t,0),telemetryProperties:{nexusTenantToken:this.numberOrDefault(n.nexusTenantToken,0),ariaTenantToken:n.ariaTenantToken||"",customerContentVersion:this.numberOrDefault(n.customerContentVersion,0),customerContentType:this.numberOrDefault(n.customerContentType,0),dnmInterval:this.numberOrDefault(n.dnmInterval,1)},eventFlags:{samplingPolicy:this.numberOrDefault(r.samplingPolicy,0),costPriority:this.numberOrDefault(r.costPriority,0),persistencePriority:this.numberOrDefault(r.persistencePriority,0),dataCategories:this.numberOrDefault(r.dataCategories,0),diagnosticLevel:this.numberOrDefault(r.diagnosticLevel,0)},dataFields:this.createBatchDataFields(e.dataFields),eventContract:{name:e.eventContract?e.eventContract.name:"",dataFields:this.createBatchDataFields(e.eventContract?e.eventContract.dataFields:void 0)}}},o.prototype.createBatchDataFields=function(e){var t=this,n=[];return e&&e.forEach((function(e){void 0!==e.value&&n.push(t.createBatchDataField(e))})),n},o.prototype.createBatchDataField=function(e){var t=e.classification?e.classification:4;return{name:e.name||"",dataType:this.dataFieldTypeToBatchNumber(this.getNativeCompatibleDataFieldType(e.dataType)),value:this.normalizeBatchDataFieldValue(e.value),dataClassification:t}},o.prototype.normalizeBatchDataFieldValue=function(e){return"number"==typeof e?isFinite(e)?e:String(e):"string"==typeof e||"boolean"==typeof e?e:String(e)},o.prototype.dataFieldTypeToBatchNumber=function(e){if("number"==typeof e)return e;switch(e){case"String":return 0;case"Boolean":return 1;case"Int64":return 2;case"Double":return 3;case"Guid":return 4;default:return-1}},o.prototype.numberOrDefault=function(e,t){return"number"==typeof e&&isFinite(e)?e:t},o.prototype.getNativeCompatibleDataFieldType=function(e){return 4!==e&&"Guid"!==e||!OSF.OUtil.isChangeGateEnabled("Microsoft.Office.SharedOnline.ChangeGate.OfficeJsRichApiGuidFieldsAsString")?e:0},o.prototype.addDataFields=function(e,t){var n=this;t&&t.forEach((function(t){e.push({name:t.name,value:t.value,classification:t.classification?t.classification:4,type:n.getNativeCompatibleDataFieldType(t.dataType)})}))},o.prototype.pause=function(e){return new Office.Promise((function(t){return setTimeout(t,e)}))},o.prototype.createResolvedPromise=function(){return new Office.Promise((function(e){return e()}))},o}();e.RichApiSink=o}(OTel||(OTel={})),function(e){var t=function(){function e(){}return e.prototype.sendTelemetryEvent=function(e,t){try{if(e.dataFields&&e.dataFields.filter((function(e){var t=e.classification;return t&&4!==t&&1!==t})).length>0)return;var n=OSF._OfficeAppFactory.getId(),r=OSF.AgaveHostAction.SendTelemetryEvent;OSF.getClientEndPoint().invoke("ContextActivationManager_notifyHost",null,[n,r,e])}catch(e){oteljs.logError(1,"AgaveWacSink",e)}},e.prototype.sendNonStandardEvent=function(e,t){try{if(1===t)throw new Error("Please call sendTelemetryEvent for events of type "+t);if(e.dataFields&&e.dataFields.filter((function(e){var t=e.classification;return t&&4!==t&&1!==t&&32!==t&&2048!==t})).length>0)return;var n=OSF._OfficeAppFactory.getId(),r=OSF.AgaveHostAction.SendNonStandardEvent;OSF.getClientEndPoint().invoke("ContextActivationManager_notifyHost",null,[n,r,e])}catch(e){oteljs.logError(1,"AgaveWacSink",e)}},e}();e.SdxWacSink=t}(OTel||(OTel={})),function(e){var t,n=[];function r(e,t,n){OTel.OTelLogger.onTelemetryLoaded((function(){Microsoft.Office.WebExtension.sendTelemetryEvent({eventName:"Office.Extensibility.OfficeJs.AddinSpecialPermissionRequest",dataFields:[oteljs.makeStringDataField("invocationId",e),oteljs.makeStringDataField("methodPath",t),oteljs.makeStringDataField("params",n)],eventFlags:{dataCategories:2,diagnosticLevel:110}})}))}function i(e,t,n){OTel.OTelLogger.onTelemetryLoaded((function(){Microsoft.Office.WebExtension.sendTelemetryEvent({eventName:"Office.Extensibility.OfficeJs.AddinSpecialPermissionResponse",dataFields:[oteljs.makeStringDataField("invocationId",e),oteljs.makeBooleanDataField("isSuccessful",t),oteljs.makeStringDataField("error",n?JSON.stringify({name:n.name,code:n.code,message:n.message}):void 0)],eventFlags:{dataCategories:2,diagnosticLevel:110}})}))}try{for(var o=0,a=function(e){var t=Navigator.prototype[e];t&&(Navigator.prototype[e]=function(n,a,s){if(3===arguments.length&&Function.prototype.isPrototypeOf(a)&&Function.prototype.isPrototypeOf(s)){var c=(o++).toString();return r(c,"Navigator.prototype."+e,JSON.stringify([{audio:!!n.audio,video:!!n.video}])),t.apply(this,[n,function(){return i(c,!0),a.apply(this,arguments)},function(){return i(c,!1,arguments[0]),s.apply(this,arguments)}])}return t.apply(this,arguments)},n.push("Navigator.prototype."+e))},s=0,c=["getUserMedia","webkitGetUserMedia","mozGetUserMedia"];s<c.length;s++){a(c[s])}var l=MediaDevices.prototype.getUserMedia;l&&(MediaDevices.prototype.getUserMedia=function(e){var t=(o++).toString();return 1===arguments.length&&void 0!==e?(r(t,"MediaDevices.prototype.getUserMedia",JSON.stringify([{audio:!!e.audio,video:!!e.video}])),l.apply(this,arguments).then((function(){return i(t,!0),arguments[0]}),(function(){throw i(t,!1,arguments[0]),arguments[0]}))):l.apply(this,arguments)},n.push("MediaDevices.prototype.getUserMedia"));for(var u=function(e){var t=Geolocation.prototype[e];t&&(Geolocation.prototype[e]=function(n,a,s){for(var c=[],l=3;l<arguments.length;l++)c[l-3]=arguments[l];var u=(o++).toString(),f=!1;r(u,"Geolocation.prototype."+e,JSON.stringify([]));var d=Function.prototype.isPrototypeOf(n)?function(){return f||(i(u,!0),f=!0),n.apply(this,arguments)}:n,p=Function.prototype.isPrototypeOf(a)?function(){return f||(i(u,!1,arguments[0]),f=!0),a.apply(this,arguments)}:a;return t.apply(this,[d,p,s].concat(c))},n.push("Geolocation.prototype."+e))},f=0,d=["getCurrentPosition","watchPosition"];f<d.length;f++){u(d[f])}}catch(e){t=e.toString()}OTel.OTelLogger.onTelemetryLoaded((function(){Microsoft.Office.WebExtension.sendTelemetryEvent({eventName:"Office.Extensibility.OfficeJs.AddinSpecialPermissionHookInstall",dataFields:[oteljs.makeStringDataField("hooksInstalled",JSON.stringify(n)),oteljs.makeStringDataField("error",t)],eventFlags:{dataCategories:2,diagnosticLevel:110}})}))}(Office||(Office={})),function(e){!function(e){!function(e){e.FeatureGates={},e.EventType=OSF.EventType,e.sendTelemetryEvent=function(e){OTel.OTelLogger.sendTelemetryEvent(e)},e.sendNonStandardEvent=function(e,t){OTel.OTelLogger.sendNonStandardEvent(e,t)},e.flushTelemetryQueue=function(){return OTel.OTelLogger.flushTelemetryQueue()},e.telemetrySink=OTel.OTelLogger}(e.WebExtension||(e.WebExtension={}))}(e.Office||(e.Office={}))}(Microsoft||(Microsoft={})),function(e){e.sendTelemetryEvent=function(e){Microsoft.Office.WebExtension.sendTelemetryEvent(e)},e.sendNonStandardEvent=function(e,t){Microsoft.Office.WebExtension.sendNonStandardEvent(e,t)},e.flushTelemetryQueue=function(){return Microsoft.Office.WebExtension.flushTelemetryQueue()},e.telemetrySink=Microsoft.Office.WebExtension.telemetrySink,e.isTrustedHost=function(){return __awaiter(this,void 0,void 0,(function(){var t,n,r,i,o;return __generator(this,(function(a){switch(a.label){case 0:return a.trys.push([0,10,,11]),OSF._OfficeAppFactory.getHostInfo().hostPlatform===OSF.HostInfoPlatform.web?[3,2]:[4,e.onReady()];case 1:return a.sent(),[2,!0];case 2:return null!=(t=OSF._OfficeAppFactory.getWebAppState().clientEndPoint)&&t.fHostTrusted?[2,!0]:null==document.referrer?[3,6]:(n=OSF.OUtil.parseUrl(document.referrer,!1),r="https:"==n.protocol,i=!1,OSF.OUtil.isChangeGateEnabled("Microsoft.Office.SharedOnline.ChangeGate.OfficeVSO_10910853_OfficeJsNPMDownloadTrustedDomainList")?[4,OSF.XdmCommunicationManager.isHostNameValidWacDomainAsync(n.hostname,null)]:[3,4]);case 3:return i=a.sent(),[3,5];case 4:i=OSF.XdmCommunicationManager.isHostNameValidWacDomain(n.hostname),a.label=5;case 5:if(r&&i&&!new RegExp("^"+document.domain.replace(new RegExp("\\.","g"),"\\.")+"$").test(n.hostname))return[2,!0];a.label=6;case 6:return null==t?[3,8]:[4,OSF.Utility.promisify((function(e){t.invoke("ContextActivationManager_getAppContextAsync",e,OSF._OfficeAppFactory.getWebAppState().id)}),1e4)];case 7:return a.sent(),[2,!0];case 8:return[2,!1];case 9:return[3,11];case 10:return o=a.sent(),OSF.AppTelemetry&&OSF.AppTelemetry.logAppException("Exception happens at Office.isTrustedHost."+o),[2,!1];case 11:return[2]}}))}))},Microsoft.Office.WebExtension.onReadyInternal=e.onReadyInternal}(Office||(Office={}));var OfficeExtension;__extends=this&&this.__extends||function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();!function(e){var t;!function(e){e.graph="graph",e.wfe="wfe"}(t=e.RemoteEndpointType||(e.RemoteEndpointType={})),function(e){e[e.None=0]="None",e[e.Create=1]="Create",e[e.Edit=2]="Edit"}(e.MarkOfAi||(e.MarkOfAi={}));var n=function(){function e(){}return e.prototype._resolveRequestUrlAndHeaderInfo=function(){return u._createPromiseFromResult(null)},e.prototype._createRequestExecutorOrNull=function(){return null},e.prototype.getEventRegistration=function(e){return null},e}();e.SessionBase=n;var r=function(){function e(){}return e.setCustomSendRequestFunc=function(t){e.s_customSendRequestFunc=t},e.xhrSendRequestFunc=function(e){return u.createPromise((function(t,n){var r=new XMLHttpRequest;if(r.open(e.method,e.url),r.onload=function(){var e={statusCode:r.status,headers:u._parseHttpResponseHeaders(r.getAllResponseHeaders()),body:r.responseText};t(e)},r.onerror=function(){n(new i.RuntimeError({code:a.connectionFailure,httpStatusCode:r.status,message:u._getResourceString(s.connectionFailureWithStatus,r.statusText)}))},e.headers)for(var o in e.headers)r.setRequestHeader(o,e.headers[o]);r.send(u._getRequestBodyText(e))}))},e.fetchSendRequestFunc=function(e){var t=u._getRequestBodyText(e);return""===t&&(t=void 0),fetch(e.url,{method:e.method,headers:e.headers,body:t}).then((function(e){return e.text().then((function(t){var n=e.status,r={};return e.headers.forEach((function(e,t){r[t]=e})),{statusCode:n,headers:r,body:t}}))}))},e.sendRequest=function(t){e.validateAndNormalizeRequest(t);var n=e.s_customSendRequestFunc;return n||(n="undefined"!=typeof fetch?e.fetchSendRequestFunc:e.xhrSendRequestFunc),n(t)},e.setCustomSendLocalDocumentRequestFunc=function(t){e.s_customSendLocalDocumentRequestFunc=t},e.sendLocalDocumentRequest=function(t){return e.validateAndNormalizeRequest(t),(e.s_customSendLocalDocumentRequestFunc||e.officeJsSendLocalDocumentRequestFunc)(t)},e.officeJsSendLocalDocumentRequestFunc=function(e){e=u._validateLocalDocumentRequest(e);var t=u._buildRequestMessageSafeArray(e);return u.createPromise((function(e,n){OSF.DDA.RichApi.executeRichApiRequestAsync(t,(function(t){var n;n="succeeded"==t.status?{statusCode:l.getResponseStatusCode(t),headers:l.getResponseHeaders(t),body:l.getResponseBody(t)}:l.buildHttpResponseFromOfficeJsError(t.error.code,t.error.message),u.log("Response:"),u.log(JSON.stringify(n)),e(n)}))}))},e.validateAndNormalizeRequest=function(e){if(u.isNullOrUndefined(e))throw i.RuntimeError._createInvalidArgError({argumentName:"request"});u.isNullOrEmptyString(e.method)&&(e.method="GET"),e.method=e.method.toUpperCase();var t=!1;if("object"==typeof e.headers&&e.headers[c.testRequestNameHeader]&&(t=!0),!t){var n=f._getCurrentTestNameWithSequenceId();n&&(e.headers||(e.headers={}),e.headers[c.testRequestNameHeader]=n)}},e.logRequest=function(t){if(u._logEnabled){if(u.log("---HTTP Request---"),u.log(t.method+" "+t.url),t.headers)for(var n in t.headers)u.log(n+": "+t.headers[n]);e._logBodyEnabled&&u.log(u._getRequestBodyText(t))}},e.logResponse=function(t){if(u._logEnabled){if(u.log("---HTTP Response---"),u.log(""+t.statusCode),t.headers)for(var n in t.headers)u.log(n+": "+t.headers[n]);e._logBodyEnabled&&u.log(t.body)}},e._logBodyEnabled=!1,e}();e.HttpUtility=r;var i,o=function(){function e(e){var t=this;this.m_bridge=e,this.m_promiseResolver={},this.m_handlers=[],this.m_bridge.onMessageFromHost=function(e){var n=JSON.parse(e);if(3==n.type){var r=n.message;if(r&&r.entries)for(var i=0;i<r.entries.length;i++){var o=r.entries[i];if(Array.isArray(o)){var a={messageCategory:o[0],messageType:o[1],targetId:o[2],message:o[3],id:o[4]};r.entries[i]=a}}}t.dispatchMessage(n)}}return e.init=function(t){if("object"==typeof t&&t){var n=new e(t);e.s_instance=n,r.setCustomSendLocalDocumentRequestFunc((function(t){t=u._validateLocalDocumentRequest(t);var r=0;u.isReadonlyRestRequest(t.method)||(r=1);var i=t.url.indexOf("?");if(i>=0){var o=t.url.substr(i+1),a=u._parseRequestFlagsAndCustomDataFromQueryStringIfAny(o);a.flags>=0&&(r=a.flags)}"string"==typeof t.body&&(t.body=JSON.parse(t.body));var s={id:e.nextId(),type:1,flags:r,message:t};return n.sendMessageToHostAndExpectResponse(s).then((function(e){return e.message}))}));for(var i=0;i<e.s_onInitedHandlers.length;i++)e.s_onInitedHandlers[i](n)}},Object.defineProperty(e,"instance",{get:function(){return e.s_instance},enumerable:!0,configurable:!0}),e.prototype.sendMessageToHost=function(e){this.m_bridge.sendMessageToHost(JSON.stringify(e))},e.prototype.sendMessageToHostAndExpectResponse=function(e){var t=this,n=u.createPromise((function(n,r){t.m_promiseResolver[e.id]=n}));return this.m_bridge.sendMessageToHost(JSON.stringify(e)),n},e.prototype.addHostMessageHandler=function(e){this.m_handlers.push(e)},e.prototype.removeHostMessageHandler=function(e){var t=this.m_handlers.indexOf(e);t>=0&&this.m_handlers.splice(t,1)},e.onInited=function(t){e.s_onInitedHandlers.push(t),e.s_instance&&t(e.s_instance)},e.prototype.dispatchMessage=function(e){if("number"==typeof e.id){var t=this.m_promiseResolver[e.id];if(t)return t(e),void delete this.m_promiseResolver[e.id]}for(var n=0;n<this.m_handlers.length;n++)this.m_handlers[n](e)},e.nextId=function(){return e.s_nextId++},e.s_onInitedHandlers=[],e.s_nextId=1,e}();e.HostBridge=o,"object"==typeof _richApiNativeBridge&&_richApiNativeBridge&&o.init(_richApiNativeBridge),function(e){var t=function(t){function n(e){var r=t.call(this,"string"==typeof e?e:e.message)||this;if(Object.setPrototypeOf(r,n.prototype),r.name="RichApi.Error","string"==typeof e?r.message=e:(r.code=e.code,r.message=e.message,r.traceMessages=e.traceMessages||[],r.innerError=e.innerError||null,r.debugInfo=r._createDebugInfo(e.debugInfo||{}),r.httpStatusCode=e.httpStatusCode,r.data=e.data),u.isNullOrUndefined(r.httpStatusCode)||200===r.httpStatusCode){var i={};i[a.accessDenied]=401,i[a.connectionFailure]=500,i[a.generalException]=500,i[a.invalidArgument]=400,i[a.invalidObjectPath]=400,i[a.invalidOrTimedOutSession]=408,i[a.invalidRequestContext]=400,i[a.timeout]=408,i[a.valueNotLoaded]=400,r.httpStatusCode=i[r.code]}return u.isNullOrUndefined(r.httpStatusCode)&&(r.httpStatusCode=500),r}return __extends(n,t),n.prototype.toString=function(){return this.code+": "+this.message},n.prototype._createDebugInfo=function(t){var n={code:this.code,message:this.message,toString:function(){return JSON.stringify(this)}};for(var r in t)n[r]=t[r];return this.innerError&&(this.innerError instanceof e.RuntimeError?n.innerError=this.innerError.debugInfo:n.innerError=this.innerError),n},n._createInvalidArgError=function(t){return new e.RuntimeError({code:a.invalidArgument,httpStatusCode:400,message:u.isNullOrEmptyString(t.argumentName)?u._getResourceString(s.invalidArgumentGeneric):u._getResourceString(s.invalidArgument,t.argumentName),debugInfo:t.errorLocation?{errorLocation:t.errorLocation}:{},innerError:t.innerError})},n}(Error);e.RuntimeError=t}(i=e._Internal||(e._Internal={})),e.Error=i.RuntimeError;var a=function(){function e(){}return e.apiNotFound="ApiNotFound",e.accessDenied="AccessDenied",e.generalException="GeneralException",e.activityLimitReached="ActivityLimitReached",e.invalidArgument="InvalidArgument",e.connectionFailure="ConnectionFailure",e.timeout="Timeout",e.invalidOrTimedOutSession="InvalidOrTimedOutSession",e.invalidObjectPath="InvalidObjectPath",e.invalidRequestContext="InvalidRequestContext",e.valueNotLoaded="ValueNotLoaded",e.requestPayloadSizeLimitExceeded="RequestPayloadSizeLimitExceeded",e.responsePayloadSizeLimitExceeded="ResponsePayloadSizeLimitExceeded",e.writeNotSupportedWhenModalDialogOpen="WriteNotSupportedWhenModalDialogOpen",e.undoNotSupported="UndoNotSupported",e}();e.CoreErrorCodes=a;var s=function(){function e(){}return e.apiNotFoundDetails="ApiNotFoundDetails",e.connectionFailureWithStatus="ConnectionFailureWithStatus",e.connectionFailureWithDetails="ConnectionFailureWithDetails",e.invalidArgument="InvalidArgument",e.invalidArgumentGeneric="InvalidArgumentGeneric",e.timeout="Timeout",e.invalidOrTimedOutSessionMessage="InvalidOrTimedOutSessionMessage",e.invalidSheetName="InvalidSheetName",e.invalidObjectPath="InvalidObjectPath",e.invalidRequestContext="InvalidRequestContext",e.valueNotLoaded="ValueNotLoaded",e}();e.CoreResourceStrings=s;var c=function(){function e(){}return e.flags="flags",e.sourceLibHeader="SdkVersion",e.processQuery="ProcessQuery",e.localDocument="http://document.localhost/",e.localDocumentApiPrefix="http://document.localhost/_api/",e.customData="customdata",e.testRequestNameHeader="x-test-request-name",e.maxAdditionalDataLength=4096,e}();e.CoreConstants=c;var l=function(){function t(){}return t.buildMessageArrayForIRequestExecutor=function(e,n,r,i,o,a){var s=JSON.stringify(r.Body);u.log("Request:"),u.log(s);var l={};return u._copyHeaders(r.Headers,l),l[c.sourceLibHeader]=i,t.buildRequestMessageSafeArray(e,n,"POST",c.processQuery,l,s,o,a)},t.buildResponseOnSuccess=function(e,t){var n={HttpStatusCode:200,ErrorCode:"",ErrorMessage:"",Headers:null,Body:null};return n.Body=JSON.parse(e),n.Headers=t,n},t.buildResponseOnError=function(e,n){var r={HttpStatusCode:500,ErrorCode:"",ErrorMessage:"",Headers:null,Body:null};return r.ErrorCode=a.generalException,r.ErrorMessage=n,e==t.OfficeJsErrorCode_ooeNoCapability?(r.ErrorCode=a.accessDenied,r.HttpStatusCode=401):e==t.OfficeJsErrorCode_ooeActivityLimitReached?(r.ErrorCode=a.activityLimitReached,r.HttpStatusCode=429):e==t.OfficeJsErrorCode_ooeInvalidOrTimedOutSession?(r.ErrorCode=a.invalidOrTimedOutSession,r.HttpStatusCode=408,r.ErrorMessage=u._getResourceString(s.invalidOrTimedOutSessionMessage)):e==t.OfficeJsErrorCode_ooeRequestPayloadSizeLimitExceeded?(r.ErrorCode=a.requestPayloadSizeLimitExceeded,r.HttpStatusCode=400):e==t.OfficeJsErrorCode_ooeResponsePayloadSizeLimitExceeded?(r.ErrorCode=a.responsePayloadSizeLimitExceeded,r.HttpStatusCode=400):e==t.OfficeJsErrorCode_ooeWriteNotSupportedWhenModalDialogOpen?(r.ErrorCode=a.writeNotSupportedWhenModalDialogOpen,r.HttpStatusCode=400):e==t.OfficeJsErrorCode_ooeInvalidSheetName?(r.ErrorCode=a.invalidRequestContext,r.HttpStatusCode=400,r.ErrorMessage=u._getResourceString(s.invalidSheetName)):e==t.OfficeJsErrorCode_ooeUndoNotSupported&&(r.ErrorCode=a.undoNotSupported,r.HttpStatusCode=400),r},t.buildHttpResponseFromOfficeJsError=function(e,n){var r=500,i={error:{}};return i.error.code=a.generalException,i.error.message=n,e===t.OfficeJsErrorCode_ooeNoCapability?(r=403,i.error.code=a.accessDenied):e===t.OfficeJsErrorCode_ooeActivityLimitReached&&(r=429,i.error.code=a.activityLimitReached),{statusCode:r,headers:{},body:JSON.stringify(i)}},t.buildRequestMessageSafeArray=function(e,t,n,r,i,o,a,s){var c=[];if(i)for(var l in i)c.push(l),c.push(i[l]);return[e,n,r,c,o,0,t,"","","","","","","",a||0,s||""]},t._buildAdditionalData=function(t){if(!t)return"";var n;try{n=JSON.stringify({options:t})}catch(t){throw i.RuntimeError._createInvalidArgError({argumentName:"requestOptions",innerError:t instanceof e.Error?t:void 0})}if(!n||n.length>c.maxAdditionalDataLength)throw i.RuntimeError._createInvalidArgError({argumentName:"requestOptions"});return n},t.getResponseBody=function(e){return t.getResponseBodyFromSafeArray(e.value.data)},t.getResponseHeaders=function(e){return t.getResponseHeadersFromSafeArray(e.value.data)},t.getResponseBodyFromSafeArray=function(e){var t=e[2];return"string"==typeof t?t:t.join("")},t.getResponseHeadersFromSafeArray=function(e){var t=e[1];if(!t)return null;for(var n={},r=0;r<t.length-1;r+=2)n[t[r]]=t[r+1];return n},t.getResponseStatusCode=function(e){return t.getResponseStatusCodeFromSafeArray(e.value.data)},t.getResponseStatusCodeFromSafeArray=function(e){return e[0]},t.OfficeJsErrorCode_ooeInvalidOrTimedOutSession=5012,t.OfficeJsErrorCode_ooeActivityLimitReached=5102,t.OfficeJsErrorCode_ooeNoCapability=7e3,t.OfficeJsErrorCode_ooeRequestPayloadSizeLimitExceeded=5103,t.OfficeJsErrorCode_ooeResponsePayloadSizeLimitExceeded=5104,t.OfficeJsErrorCode_ooeWriteNotSupportedWhenModalDialogOpen=5016,t.OfficeJsErrorCode_ooeInvalidSheetName=1014,t.OfficeJsErrorCode_ooeUndoNotSupported=5017,t}();e.RichApiMessageUtility=l,function(e){e.getPromiseType=function(){if("undefined"!=typeof Promise)return Promise;if(void 0!==Office&&Office.Promise)return Office.Promise;if(void 0!==OfficeExtension&&OfficeExtension.Promise)return OfficeExtension.Promise;throw new e.Error("No Promise implementation found")}}(i=e._Internal||(e._Internal={}));var u=function(){function e(){}return e.log=function(t){e._logEnabled&&"undefined"!=typeof console&&console.log&&console.log(t)},e.checkArgumentNull=function(t,n){if(e.isNullOrUndefined(t))throw i.RuntimeError._createInvalidArgError({argumentName:n})},e.isNullOrUndefined=function(e){return null===e||void 0===e},e.isUndefined=function(e){return void 0===e},e.isNullOrEmptyString=function(e){return null===e||(void 0===e||0==e.length)},e.isPlainJsonObject=function(t){if(e.isNullOrUndefined(t))return!1;if("object"!=typeof t)return!1;if("[object Object]"!==Object.prototype.toString.apply(t))return!1;if(t.constructor&&!Object.prototype.hasOwnProperty.call(t,"constructor")&&!Object.prototype.hasOwnProperty.call(t.constructor.prototype,"hasOwnProperty"))return!1;for(var n in t)if(!Object.prototype.hasOwnProperty.call(t,n))return!1;return!0},e.trim=function(e){return e.replace(new RegExp("^\\s+|\\s+$","g"),"")},e.caseInsensitiveCompareString=function(t,n){return e.isNullOrUndefined(t)?e.isNullOrUndefined(n):!e.isNullOrUndefined(n)&&t.toUpperCase()==n.toUpperCase()},e.isReadonlyRestRequest=function(t){return e.caseInsensitiveCompareString(t,"GET")},e._getResourceString=function(t,n){var r;if("undefined"!=typeof window&&window.Strings&&window.Strings.OfficeOM){var i="L_"+t,o=window.Strings.OfficeOM[i];o&&(r=o)}if(r||(r=e.s_resourceStringValues[t]),r||(r=t),!e.isNullOrUndefined(n))if(Array.isArray(n)){var a=n;r=e._formatString(r,a)}else r=r.replace("{0}",n);return r},e._formatString=function(e,t){return e.replace(/\{\d\}/g,(function(e){var n=parseInt(e.substr(1,e.length-2));if(n<t.length)return t[n];throw i.RuntimeError._createInvalidArgError({argumentName:"format"})}))},Object.defineProperty(e,"Promise",{get:function(){return i.getPromiseType()},enumerable:!0,configurable:!0}),e.createPromise=function(t){return new e.Promise(t)},e._createPromiseFromResult=function(t){return e.createPromise((function(e,n){e(t)}))},e._createPromiseFromException=function(t){return e.createPromise((function(e,n){n(t)}))},e._createTimeoutPromise=function(t){return e.createPromise((function(e,n){setTimeout((function(){e(null)}),t)}))},e._createInvalidArgError=function(e){return i.RuntimeError._createInvalidArgError(e)},e._isLocalDocumentUrl=function(t){return e._getLocalDocumentUrlPrefixLength(t)>0},e._getLocalDocumentUrlPrefixLength=function(e){for(var t=["http://document.localhost","https://document.localhost","//document.localhost"],n=e.toLowerCase().trim(),r=0;r<t.length;r++){if(n===t[r])return t[r].length;if(n.substr(0,t[r].length+1)===t[r]+"/")return t[r].length+1}return 0},e._validateLocalDocumentRequest=function(t){var n=e._getLocalDocumentUrlPrefixLength(t.url);if(n<=0)throw i.RuntimeError._createInvalidArgError({argumentName:"request"});var r=t.url.substr(n),o=r.toLowerCase();return"_api"===o?r="":"_api/"===o.substr(0,"_api/".length)&&(r=r.substr("_api/".length)),{method:t.method,url:r,headers:t.headers,body:t.body}},e._parseRequestFlagsAndCustomDataFromQueryStringIfAny=function(e){for(var t={flags:-1,customData:""},n=e.split("&"),r=0;r<n.length;r++){var i=n[r].split("=");if(i[0].toLowerCase()===c.flags){var o=parseInt(i[1]);o&=65535,t.flags=o}else i[0].toLowerCase()===c.customData&&(t.customData=decodeURIComponent(i[1]))}return t},e._getRequestBodyText=function(e){var t="";return"string"==typeof e.body?t=e.body:e.body&&"object"==typeof e.body&&(t=JSON.stringify(e.body)),t},e._parseResponseBody=function(t){if("string"==typeof t.body){var n=e.trim(t.body);return JSON.parse(n)}return t.body},e._buildRequestMessageSafeArray=function(t){var n=0;e.isReadonlyRestRequest(t.method)||(n=1);var r="";if(t.url.substr(0,c.processQuery.length).toLowerCase()===c.processQuery.toLowerCase()){var i=t.url.indexOf("?");if(i>0){var o=t.url.substr(i+1),a=e._parseRequestFlagsAndCustomDataFromQueryStringIfAny(o);a.flags>=0&&(n=a.flags),r=a.customData}}return l.buildRequestMessageSafeArray(r,n,t.method,t.url,t.headers,e._getRequestBodyText(t))},e._parseHttpResponseHeaders=function(t){var n={};if(!e.isNullOrEmptyString(t))for(var r=new RegExp("\r?\n"),i=t.split(r),o=0;o<i.length;o++){var a=i[o];if(null!=a){var s=a.indexOf(":");if(s>0){var c=a.substr(0,s),l=a.substr(s+1);c=e.trim(c),l=e.trim(l),n[c.toUpperCase()]=l}}}return n},e._parseErrorResponse=function(t){var n=e._parseErrorResponseBody(t),r=t.statusCode.toString();if(e.isNullOrUndefined(n)||"object"!=typeof n||!n.error)return e._createDefaultErrorResponse(r);var i=n.error,o=i.innerError;return o&&o.code?e._createErrorResponse(o.code,r,o.message):i.code?e._createErrorResponse(i.code,r,i.message):e._createDefaultErrorResponse(r)},e._parseErrorResponseBody=function(t){if(e.isPlainJsonObject(t.body))return t.body;if(!e.isNullOrEmptyString(t.body)){var n=e.trim(t.body);try{return JSON.parse(n)}catch(t){e.log("Error when parse "+n)}}},e._createDefaultErrorResponse=function(t){return{errorCode:a.connectionFailure,errorMessage:e._getResourceString(s.connectionFailureWithStatus,t)}},e._createErrorResponse=function(t,n,r){return{errorCode:t,errorMessage:e._getResourceString(s.connectionFailureWithDetails,[n,t,r])}},e._copyHeaders=function(e,t){if(e&&t)for(var n in e)t[n]=e[n]},e.addResourceStringValues=function(t){for(var n in t)e.s_resourceStringValues[n]=t[n]},e._logEnabled=!1,e.s_resourceStringValues={ApiNotFoundDetails:"The method or property {0} is part of the {1} requirement set, which is not available in your version of {2}.",ConnectionFailureWithStatus:"The request failed with status code of {0}.",ConnectionFailureWithDetails:"The request failed with status code of {0}, error code {1} and the following error message: {2}",InvalidArgument:"The argument '{0}' doesn't work for this situation, is missing, or isn't in the right format.",InvalidObjectPath:'The object path \'{0}\' isn\'t working for what you\'re trying to do. If you\'re using the object across multiple "context.sync" calls and outside the sequential execution of a ".run" batch, please use the "context.trackedObjects.add()" and "context.trackedObjects.remove()" methods to manage the object\'s lifetime.',InvalidRequestContext:"Cannot use the object across different request contexts.",Timeout:"The operation has timed out.",ValueNotLoaded:'The value of the result object has not been loaded yet. Before reading the value property, call "context.sync()" on the associated request context.'},e}();e.CoreUtility=u;var f=function(){function e(){}return e.setMock=function(t){e.s_isMock=t},e.isMock=function(){return e.s_isMock},e._setCurrentTestName=function(t){e.s_currentTestName=t,e.s_currentTestSequenceId=0},e._getCurrentTestNameWithSequenceId=function(){return e.s_currentTestName?(e.s_currentTestSequenceId++,e.s_currentTestName+"."+e.s_currentTestSequenceId):null},e}();e.TestUtility=f,e._internalConfig={showDisposeInfoInDebugInfo:!1,showInternalApiInDebugInfo:!1,enableEarlyDispose:!0,alwaysPolyfillClientObjectUpdateMethod:!1,alwaysPolyfillClientObjectRetrieveMethod:!1,enableConcurrentFlag:!0,enableUndoableFlag:!0,appendTypeNameToObjectPathInfo:!1,enablePreviewExecution:!1,enableIndexedKeepReferenceRemoval:!0,enableEmptyPreviousObjectsArray:!0,enableExcelWebDeletedSheetRetry:!0,forceExcelWebDeletedSheetRetryOn:!1},e._emptyPreviousObjectsArrayGateName="Microsoft.Office.OEP.EnableEmptyPreviousObjectsArray";var d=!0,p=!1;function m(){return!!e._internalConfig.enableEmptyPreviousObjectsArray&&(p||function(){try{var t="undefined"!=typeof self?self:"undefined"!=typeof window?window:null,n=t&&t.OfficeRuntime&&t.OfficeRuntime.experimentation;if(!n)return;"function"==typeof n.getChangeGate?d=!1!==n.getChangeGate(e._emptyPreviousObjectsArrayGateName):"function"==typeof n.getBooleanFeatureGate&&(d=!1!==n.getBooleanFeatureGate(e._emptyPreviousObjectsArrayGateName,!0)),p=!0}catch(e){}}(),d)}function g(){return!!e._internalConfig.enableExcelWebDeletedSheetRetry&&(!!e._internalConfig.forceExcelWebDeletedSheetRetryOn||function(e,t){if(Object.prototype.hasOwnProperty.call(h,e))return h[e];try{var n="undefined"!=typeof self?self:"undefined"!=typeof window?window:null,r=n&&n.OfficeRuntime&&n.OfficeRuntime.experimentation;if(r&&"function"==typeof r.getBooleanFeatureGate){var i=!0===r.getBooleanFeatureGate(e,t);return h[e]=i,i}}catch(e){}return t}("Microsoft.Office.OEP.ExcelWebRetryOnDeletedSheet",!1))}e._isEmptyPreviousObjectsArrayEnabled=m,e._isExcelWebDeletedSheetRetryEnabled=g;var h={};e.config={extendedErrorLogging:!1};var y=function(){function t(){}return t.createSetPropertyAction=function(t,n,r,i,o){w.validateObjectPath(n);var a={Id:t._nextId(),ActionType:4,Name:r,ObjectPathId:n._objectPath.objectPathInfo.Id,ArgumentInfo:{}},s=[i],c=w.setMethodArguments(t,a.ArgumentInfo,s);w.validateReferencedObjectPaths(c);var l=new O(a,0,o);if(l.referencedObjectPath=n._objectPath,l.referencedArgumentObjectPaths=c,e._internalConfig.enablePreviewExecution&&0!=(16&o)){var u={Id:t._nextId(),ActionType:4,Name:r,ObjectId:"",ObjectType:"",Arguments:[i]};n._addPreviewExecutionAction(u)}return n._addAction(l)},t.createQueryAction=function(e,t,n,r){w.validateObjectPath(t);var i={Id:e._nextId(),ActionType:2,Name:"",ObjectPathId:t._objectPath.objectPathInfo.Id,QueryInfo:n},o=new O(i,1,4);return o.referencedObjectPath=t._objectPath,t._addAction(o,r)},t.createQueryAsJsonAction=function(e,t,n,r){w.validateObjectPath(t);var i={Id:e._nextId(),ActionType:7,Name:"",ObjectPathId:t._objectPath.objectPathInfo.Id,QueryInfo:n},o=new O(i,1,4);return o.referencedObjectPath=t._objectPath,t._addAction(o,r)},t.createUpdateAction=function(e,t,n){w.validateObjectPath(t);var r={Id:e._nextId(),ActionType:9,Name:"",ObjectPathId:t._objectPath.objectPathInfo.Id,ObjectState:n},i=new O(r,0,0);return i.referencedObjectPath=t._objectPath,t._addAction(i)},t}();e.CommonActionFactory=y;var v=function(){function t(e,t){this.m_contextBase=e,this.m_objectPath=t}return Object.defineProperty(t.prototype,"_objectPath",{get:function(){return this.m_objectPath},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"_context",{get:function(){return this.m_contextBase},enumerable:!0,configurable:!0}),t.prototype._addAction=function(e,t){var n=this;return void 0===t&&(t=null),u.createPromise((function(r,i){n._context._addServiceApiAction(e,t,r,i)}))},t.prototype._addPreviewExecutionAction=function(e){},t.prototype._retrieve=function(t,n){var r=e._internalConfig.alwaysPolyfillClientObjectRetrieveMethod;r||(r=!w.isSetSupported("RichApiRuntime","1.1"));var i=b._parseQueryOption(t);return r?y.createQueryAction(this._context,this,i,n):y.createQueryAsJsonAction(this._context,this,i,n)},t.prototype._recursivelyUpdate=function(t){var n=e._internalConfig.alwaysPolyfillClientObjectUpdateMethod;n||(n=!w.isSetSupported("RichApiRuntime","1.2"));try{var r=this[I.scalarPropertyNames];r||(r=[]);var o=this[I.scalarPropertyUpdateable];if(!o){o=[];for(var c=0;c<r.length;c++)o.push(!1)}var l=this[I.navigationPropertyNames];l||(l=[]);var f={},d={},p=0;for(var m in t){var g=r.indexOf(m);if(g>=0){if(!o[g])throw new i.RuntimeError({code:a.invalidArgument,httpStatusCode:400,message:u._getResourceString(T.attemptingToSetReadOnlyProperty,m),debugInfo:{errorLocation:m}});f[m]=t[m],++p}else{if(!(l.indexOf(m)>=0))throw new i.RuntimeError({code:a.invalidArgument,httpStatusCode:400,message:u._getResourceString(T.propertyDoesNotExist,m),debugInfo:{errorLocation:m}});d[m]=t[m]}}if(p>0)if(n)for(c=0;c<r.length;c++){var h=f[m=r[c]];w.isUndefined(h)||y.createSetPropertyAction(this._context,this,m,h)}else y.createUpdateAction(this._context,this,f);for(var m in d){var v=this[m],O=d[m];v._recursivelyUpdate(O)}}catch(e){throw new i.RuntimeError({code:a.invalidArgument,httpStatusCode:400,message:u._getResourceString(s.invalidArgument,"properties"),debugInfo:{errorLocation:this._className+".update"},innerError:e})}},t}();e.ClientObjectBase=v;var O=function(){function e(e,t,n){this.m_actionInfo=e,this.m_operationType=t,this.m_flags=n}return Object.defineProperty(e.prototype,"actionInfo",{get:function(){return this.m_actionInfo},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"operationType",{get:function(){return this.m_operationType},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"flags",{get:function(){return this.m_flags},enumerable:!0,configurable:!0}),e}();e.Action=O;var S=function(){function t(e,t,n,r,i,o){this.m_objectPathInfo=e,this.m_parentObjectPath=t,this.m_isCollection=n,this.m_isInvalidAfterRequest=r,this.m_isValid=!0,this.m_operationType=i,this.m_flags=o}return Object.defineProperty(t.prototype,"id",{get:function(){var e=this.m_objectPathInfo.ArgumentInfo;if(e){var t=e.Arguments;if(t)return t[0]}},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"parent",{get:function(){var e=this.m_parentObjectPath;if(e)return e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"parentId",{get:function(){return this.parent?this.parent.id:void 0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"objectPathInfo",{get:function(){return this.m_objectPathInfo},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"operationType",{get:function(){return this.m_operationType},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"flags",{get:function(){return this.m_flags},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isCollection",{get:function(){return this.m_isCollection},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isInvalidAfterRequest",{get:function(){return this.m_isInvalidAfterRequest},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"parentObjectPath",{get:function(){return this.m_parentObjectPath},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"argumentObjectPaths",{get:function(){return this.m_argumentObjectPaths},set:function(e){this.m_argumentObjectPaths=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isValid",{get:function(){return this.m_isValid},set:function(e){this.m_isValid=e,!e&&6===this.m_objectPathInfo.ObjectPathType&&this.m_savedObjectPathInfo&&(t.copyObjectPathInfo(this.m_savedObjectPathInfo.pathInfo,this.m_objectPathInfo),this.m_parentObjectPath=this.m_savedObjectPathInfo.parent,this.m_isValid=!0,this.m_savedObjectPathInfo=null)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"originalObjectPathInfo",{get:function(){return this.m_originalObjectPathInfo},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"getByIdMethodName",{get:function(){return this.m_getByIdMethodName},set:function(e){this.m_getByIdMethodName=e},enumerable:!0,configurable:!0}),t.prototype._updateAsNullObject=function(){this.resetForUpdateUsingObjectData(),this.m_objectPathInfo.ObjectPathType=7,this.m_objectPathInfo.Name="",this.m_parentObjectPath=null},t.prototype.saveOriginalObjectPathInfo=function(){e.config.extendedErrorLogging&&!this.m_originalObjectPathInfo&&(this.m_originalObjectPathInfo={},t.copyObjectPathInfo(this.m_objectPathInfo,this.m_originalObjectPathInfo))},t.prototype.updateUsingObjectData=function(e,n){var r=e[I.referenceId];if(!u.isNullOrEmptyString(r)){if(!this.m_savedObjectPathInfo&&!this.isInvalidAfterRequest&&t.isRestorableObjectPath(this.m_objectPathInfo.ObjectPathType)){var i={};t.copyObjectPathInfo(this.m_objectPathInfo,i),this.m_savedObjectPathInfo={pathInfo:i,parent:this.m_parentObjectPath}}return this.saveOriginalObjectPathInfo(),this.resetForUpdateUsingObjectData(),this.m_objectPathInfo.ObjectPathType=6,this.m_objectPathInfo.Name=r,delete this.m_objectPathInfo.ParentObjectPathId,void(this.m_parentObjectPath=null)}if(n){var o=n[I.collectionPropertyPath];if(!u.isNullOrEmptyString(o)&&n.context){var a=w.tryGetObjectIdFromLoadOrRetrieveResult(e);if(!u.isNullOrUndefined(a)){for(var s=o.split("."),c=n.context[s[0]],l=1;l<s.length;l++)c=c[s[l]];return this.saveOriginalObjectPathInfo(),this.resetForUpdateUsingObjectData(),this.m_parentObjectPath=c._objectPath,this.m_objectPathInfo.ParentObjectPathId=this.m_parentObjectPath.objectPathInfo.Id,this.m_objectPathInfo.ObjectPathType=5,this.m_objectPathInfo.Name="",void(this.m_objectPathInfo.ArgumentInfo.Arguments=[a])}}}var f=this.parentObjectPath&&this.parentObjectPath.isCollection,d=this.getByIdMethodName;if(f||!u.isNullOrEmptyString(d)){a=w.tryGetObjectIdFromLoadOrRetrieveResult(e);if(!u.isNullOrUndefined(a))return this.saveOriginalObjectPathInfo(),this.resetForUpdateUsingObjectData(),u.isNullOrEmptyString(d)?(this.m_objectPathInfo.ObjectPathType=5,this.m_objectPathInfo.Name=""):(this.m_objectPathInfo.ObjectPathType=3,this.m_objectPathInfo.Name=d),void(this.m_objectPathInfo.ArgumentInfo.Arguments=[a])}},t.prototype.resetForUpdateUsingObjectData=function(){this.m_isInvalidAfterRequest=!1,this.m_isValid=!0,this.m_operationType=1,this.m_flags=4,this.m_objectPathInfo.ArgumentInfo={},this.m_argumentObjectPaths=null,this.m_getByIdMethodName=null},t.isRestorableObjectPath=function(e){return 1===e||5===e||3===e||4===e},t.copyObjectPathInfo=function(e,t){t.Id=e.Id,t.ArgumentInfo=e.ArgumentInfo,t.Name=e.Name,t.ObjectPathType=e.ObjectPathType,t.ParentObjectPathId=e.ParentObjectPathId},t}();e.ObjectPath=S;var b=function(){function e(){this._additionalData={},this.m_nextId=0}return Object.defineProperty(e.prototype,"additionalData",{get:function(){return this._additionalData},enumerable:!0,configurable:!0}),e.prototype._nextId=function(){return++this.m_nextId},e.prototype._addServiceApiAction=function(e,t,n,r){this.m_serviceApiQueue||(this.m_serviceApiQueue=new P(this)),this.m_serviceApiQueue.add(e,t,n,r)},e._parseQueryOption=function(t){var n={};if("string"==typeof t){var r=t;n.Select=w._parseSelectExpand(r)}else if(Array.isArray(t))n.Select=w._parseSelectExpand(t);else if("object"==typeof t){var o=t;if(e.isLoadOption(o)){if("string"==typeof o.select)n.Select=w._parseSelectExpand(o.select);else if(Array.isArray(o.select))n.Select=w._parseSelectExpand(o.select);else if(!w.isNullOrUndefined(o.select))throw i.RuntimeError._createInvalidArgError({argumentName:"option.select"});if("string"==typeof o.expand)n.Expand=w._parseSelectExpand(o.expand);else if(Array.isArray(o.expand))n.Expand=w._parseSelectExpand(o.expand);else if(!w.isNullOrUndefined(o.expand))throw i.RuntimeError._createInvalidArgError({argumentName:"option.expand"});if("number"==typeof o.top)n.Top=o.top;else if(!w.isNullOrUndefined(o.top))throw i.RuntimeError._createInvalidArgError({argumentName:"option.top"});if("number"==typeof o.skip)n.Skip=o.skip;else if(!w.isNullOrUndefined(o.skip))throw i.RuntimeError._createInvalidArgError({argumentName:"option.skip"})}else n=e.parseStrictLoadOption(t)}else if(!w.isNullOrUndefined(t))throw i.RuntimeError._createInvalidArgError({argumentName:"option"});return n},e.isLoadOption=function(e){if(!w.isUndefined(e.select)&&("string"==typeof e.select||Array.isArray(e.select)))return!0;if(!w.isUndefined(e.expand)&&("string"==typeof e.expand||Array.isArray(e.expand)))return!0;if(!w.isUndefined(e.top)&&"number"==typeof e.top)return!0;if(!w.isUndefined(e.skip)&&"number"==typeof e.skip)return!0;for(var t in e)return!1;return!0},e.parseStrictLoadOption=function(t){var n={Select:[]};return e.parseStrictLoadOptionHelper(n,"","option",t),n},e.combineQueryPath=function(e,t,n){return 0===e.length?t:e+n+t},e.parseStrictLoadOptionHelper=function(t,n,r,o){for(var a in o){var s=o[a];if("$all"===a){if("boolean"!=typeof s)throw i.RuntimeError._createInvalidArgError({argumentName:e.combineQueryPath(r,a,".")});s&&t.Select.push(e.combineQueryPath(n,"*","/"))}else if("$top"===a){if("number"!=typeof s||n.length>0)throw i.RuntimeError._createInvalidArgError({argumentName:e.combineQueryPath(r,a,".")});t.Top=s}else if("$skip"===a){if("number"!=typeof s||n.length>0)throw i.RuntimeError._createInvalidArgError({argumentName:e.combineQueryPath(r,a,".")});t.Skip=s}else if("boolean"==typeof s)s&&t.Select.push(e.combineQueryPath(n,a,"/"));else{if("object"!=typeof s)throw i.RuntimeError._createInvalidArgError({argumentName:e.combineQueryPath(r,a,".")});e.parseStrictLoadOptionHelper(t,e.combineQueryPath(n,a,"/"),e.combineQueryPath(r,a,"."),s)}}},e}();e.ClientRequestContextBase=b;var _=function(){function e(e){this.m_objectPath=e}return e.prototype._handleResult=function(e){u.isNullOrUndefined(e)?this.m_objectPath._updateAsNullObject():this.m_objectPath.updateUsingObjectData(e,null)},e}(),A=function(){function t(e){this.m_contextBase=e,this.m_actions=[],this.m_actionResultHandler={},this.m_referencedObjectPaths={},this.m_instantiatedObjectPaths={},this.m_keepReferenceActionIndicesByObjectPathId={},this.m_preSyncPromises=[],this.m_previewExecutionActions=[]}return t.prototype.addAction=function(t){if(this.m_actions.push(t),1==t.actionInfo.ActionType)this.m_instantiatedObjectPaths[t.actionInfo.ObjectPathId]=t;else if(e._internalConfig.enableIndexedKeepReferenceRemoval&&3==t.actionInfo.ActionType&&t.actionInfo.Name===I.keepReference){var n=t.actionInfo.ObjectPathId,r=this.m_actions.length-1;this.m_keepReferenceActionIndicesByObjectPathId[n]||(this.m_keepReferenceActionIndicesByObjectPathId[n]=[]),this.m_keepReferenceActionIndicesByObjectPathId[n].push(r)}},t.prototype.addPreviewExecutionAction=function(e){this.m_previewExecutionActions.push(e)},Object.defineProperty(t.prototype,"hasActions",{get:function(){return e._internalConfig.enableIndexedKeepReferenceRemoval?this.m_actions.some((function(e){return void 0!==e})):this.m_actions.length>0},enumerable:!0,configurable:!0}),t.prototype._getLastAction=function(){if(!e._internalConfig.enableIndexedKeepReferenceRemoval)return this.m_actions[this.m_actions.length-1];for(var t=this.m_actions.length-1;t>=0;t--){var n=this.m_actions[t];if(void 0!==n)return n}},t.prototype.ensureInstantiateObjectPath=function(e){if(e){if(this.m_instantiatedObjectPaths[e.objectPathInfo.Id])return;if(this.ensureInstantiateObjectPath(e.parentObjectPath),this.ensureInstantiateObjectPaths(e.argumentObjectPaths),!this.m_instantiatedObjectPaths[e.objectPathInfo.Id]){var t={Id:this.m_contextBase._nextId(),ActionType:1,Name:"",ObjectPathId:e.objectPathInfo.Id},n=new O(t,1,4);n.referencedObjectPath=e,this.addReferencedObjectPath(e),this.addAction(n);var r=new _(e);this.addActionResultHandler(n,r)}}},t.prototype.ensureInstantiateObjectPaths=function(e){if(e)for(var t=0;t<e.length;t++)this.ensureInstantiateObjectPath(e[t])},t.prototype.addReferencedObjectPath=function(e){if(e&&!this.m_referencedObjectPaths[e.objectPathInfo.Id]){if(!e.isValid)throw new i.RuntimeError({code:a.invalidObjectPath,httpStatusCode:400,message:u._getResourceString(s.invalidObjectPath,w.getObjectPathExpression(e)),debugInfo:{errorLocation:w.getObjectPathExpression(e)}});for(;e;)this.m_referencedObjectPaths[e.objectPathInfo.Id]=e,3==e.objectPathInfo.ObjectPathType&&this.addReferencedObjectPaths(e.argumentObjectPaths),e=e.parentObjectPath}},t.prototype.addReferencedObjectPaths=function(e){if(e)for(var t=0;t<e.length;t++)this.addReferencedObjectPath(e[t])},t.prototype.addActionResultHandler=function(e,t){this.m_actionResultHandler[e.actionInfo.Id]=t},t.prototype.aggregrateRequestFlags=function(e,t,n){return 0===t&&(e|=1,0==(2&n)&&(e&=-17),0==(8&n)&&(e&=-257),e&=-5),1&n&&(e|=2),0==(4&n)&&(e&=-5),e},t.prototype.finallyNormalizeFlags=function(t){return 0==(1&t)&&(t&=-17,t&=-257),e._internalConfig.enableConcurrentFlag||(t&=-5),e._internalConfig.enableUndoableFlag||(t&=-17),w.isSetSupported("RichApiRuntimeFlag","1.1")||(t&=-5,t&=-17),w.isSetSupported("RichApiRuntimeFlag","1.2")||(t&=-257),"number"==typeof this.m_flagsForTesting&&(t=this.m_flagsForTesting),t},t.prototype.buildRequestMessageBodyAndRequestFlags=function(){e._internalConfig.enableEarlyDispose&&t._calculateLastUsedObjectPathIds(this.m_actions);var n=276,r={};for(var i in this.m_referencedObjectPaths)n=this.aggregrateRequestFlags(n,this.m_referencedObjectPaths[i].operationType,this.m_referencedObjectPaths[i].flags),r[i]=this.m_referencedObjectPaths[i].objectPathInfo;for(var o=[],a=!1,s=0;s<this.m_actions.length;s++){var c=this.m_actions[s];if(!e._internalConfig.enableIndexedKeepReferenceRemoval||c){var l=c;3===l.actionInfo.ActionType&&l.actionInfo.Name===I.keepReference&&(a=!0),n=this.aggregrateRequestFlags(n,l.operationType,l.flags),o.push(l.actionInfo)}}n=this.finallyNormalizeFlags(n);var u={AutoKeepReference:this.m_contextBase._autoCleanup&&a,Actions:o,ObjectPaths:r,AdditionalData:this.m_contextBase._additionalData};return this.m_previewExecutionActions.length>0&&(u.PreviewExecutionActions=this.m_previewExecutionActions,n|=4096),{body:u,flags:n}},t.prototype.processResponse=function(e){if(e)for(var t=0;t<e.length;t++){var n=e[t],r=this.m_actionResultHandler[n.ActionId];r&&r._handleResult(n.Value)}},t.prototype.invalidatePendingInvalidObjectPaths=function(){for(var e in this.m_referencedObjectPaths)this.m_referencedObjectPaths[e].isInvalidAfterRequest&&(this.m_referencedObjectPaths[e].isValid=!1)},t.prototype._addPreSyncPromise=function(e){this.m_preSyncPromises.push(e)},Object.defineProperty(t.prototype,"_preSyncPromises",{get:function(){return this.m_preSyncPromises},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"_actions",{get:function(){return e._internalConfig.enableIndexedKeepReferenceRemoval?this.m_actions.filter((function(e){return void 0!==e})):this.m_actions},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"_objectPaths",{get:function(){return this.m_referencedObjectPaths},enumerable:!0,configurable:!0}),t.prototype._removeKeepReferenceAction=function(t){if(e._internalConfig.enableIndexedKeepReferenceRemoval){var n=this.m_keepReferenceActionIndicesByObjectPathId[t];if(!n||0===n.length)return;var r=n.pop();return this.m_actions[r]=void 0,void(0===n.length&&delete this.m_keepReferenceActionIndicesByObjectPathId[t])}for(var i=this.m_actions.length-1;i>=0;i--){var o=this.m_actions[i];if(o&&o.actionInfo.ObjectPathId===t&&3===o.actionInfo.ActionType&&o.actionInfo.Name===I.keepReference){this.m_actions.splice(i,1);break}}},t._updateLastUsedActionIdOfObjectPathId=function(e,n,r){for(;n;){if(e[n.objectPathInfo.Id])return;e[n.objectPathInfo.Id]=r;var i=n.argumentObjectPaths;if(i)for(var o=i.length,a=0;a<o;a++)t._updateLastUsedActionIdOfObjectPathId(e,i[a],r);n=n.parentObjectPath}},t._calculateLastUsedObjectPathIds=function(n){for(var r={},i=n.length,o=i-1;o>=0;--o){var a=n[o];if(!e._internalConfig.enableIndexedKeepReferenceRemoval||a){var s=(m=a).actionInfo.Id;m.referencedObjectPath&&t._updateLastUsedActionIdOfObjectPathId(r,m.referencedObjectPath,s);var c=m.referencedArgumentObjectPaths;if(c)for(var l=c.length,u=0;u<l;u++)t._updateLastUsedActionIdOfObjectPathId(r,c[u],s)}}var f={};for(var d in r){var p=f[s=r[d]];p||(p=[],f[s]=p),p.push(parseInt(d))}for(o=0;o<i;o++){a=n[o];if(!e._internalConfig.enableIndexedKeepReferenceRemoval||a){var m,g=f[(m=a).actionInfo.Id];g&&g.length>0?m.actionInfo.L=g:m.actionInfo.L&&delete m.actionInfo.L}}},t}();e.ClientRequestBase=A;var C=function(){function e(e){this.m_type=e}return Object.defineProperty(e.prototype,"value",{get:function(){if(!this.m_isLoaded)throw new i.RuntimeError({code:a.valueNotLoaded,httpStatusCode:400,message:u._getResourceString(s.valueNotLoaded),debugInfo:{errorLocation:"clientResult.value"}});return this.m_value},enumerable:!0,configurable:!0}),e.prototype._handleResult=function(e){this.m_isLoaded=!0,"object"==typeof e&&e&&e._IsNull||(1===this.m_type?this.m_value=w.adjustToDateTime(e):this.m_value=e)},e}();e.ClientResult=C;var P=function(){function e(e){this.m_context=e,this.m_actions=[]}return e.prototype.add=function(e,t,n,r){var i=this;this.m_actions.push({action:e,resultHandler:t,resolve:n,reject:r}),1===this.m_actions.length&&setTimeout((function(){return i.processActions()}),0)},e.prototype.processActions=function(){var e=this;if(0!==this.m_actions.length){var t=this.m_actions;this.m_actions=[];for(var n=new A(this.m_context),r=0;r<t.length;r++){var i=t[r];n.ensureInstantiateObjectPath(i.action.referencedObjectPath),n.ensureInstantiateObjectPaths(i.action.referencedArgumentObjectPaths),n.addAction(i.action),n.addReferencedObjectPath(i.action.referencedObjectPath),n.addReferencedObjectPaths(i.action.referencedArgumentObjectPaths)}var o=n.buildRequestMessageBodyAndRequestFlags(),a=o.body,s=o.flags,l={Url:c.localDocumentApiPrefix,Headers:null,Body:a};u.log("Request:"),u.log(JSON.stringify(a)),(new E).executeAsync(this.m_context._customData,s,l).then((function(r){e.processResponse(n,t,r)})).catch((function(e){for(var n=0;n<t.length;n++){t[n].reject(e)}}))}},e.prototype.processResponse=function(e,t,n){var r=this.getErrorFromResponse(n),i=null;n.Body.Results?i=n.Body.Results:n.Body.ProcessedResults&&n.Body.ProcessedResults.Results&&(i=n.Body.ProcessedResults.Results),i||(i=[]),this.processActionResults(e,t,i,r)},e.prototype.getErrorFromResponse=function(e){return u.isNullOrEmptyString(e.ErrorCode)?e.Body&&e.Body.Error?new i.RuntimeError({code:e.Body.Error.Code,httpStatusCode:e.Body.Error.HttpStatusCode,message:e.Body.Error.Message}):null:new i.RuntimeError({code:e.ErrorCode,httpStatusCode:e.HttpStatusCode,message:e.ErrorMessage})},e.prototype.processActionResults=function(e,t,n,r){e.processResponse(n);for(var i=0;i<t.length;i++){for(var o=t[i],a=o.action.actionInfo.Id,s=!1,c=0;c<n.length;c++)if(a==n[c].ActionId){var l=n[c].Value;o.resultHandler&&(o.resultHandler._handleResult(l),l=o.resultHandler.value),o.resolve&&o.resolve(l),s=!0;break}!s&&o.reject&&(r?o.reject(r):o.reject("No response for the action."))}},e}(),E=function(){function e(){}return e.prototype.getRequestUrl=function(e,n,r){void 0===r&&(r=t.graph.toString());var i=c.flags+"="+n.toString();switch(r){case t.graph.toString():"/"!=e.charAt(e.length-1)&&(e+="/"),e=(e+=c.processQuery)+"?"+i;break;case t.wfe.toString():e=(e=e+"&"+i)+"&wdRestPart=_api/"+c.processQuery}return e},e.prototype.executeAsync=function(n,i,o){var a=o.Headers?o.Headers[I.remoteEndpointTypeHeaderKey]:t.graph.toString(),s={method:"POST",url:this.getRequestUrl(o.Url,i,a),headers:{},body:o.Body};if(s.headers[c.sourceLibHeader]=e.SourceLibHeaderValue,s.headers["CONTENT-TYPE"]="application/json",o.Headers)for(var l in o.Headers)s.headers[l]=o.Headers[l];return(u._isLocalDocumentUrl(s.url)?r.sendLocalDocumentRequest:r.sendRequest)(s).then((function(e){var t;if(200===e.statusCode)t={HttpStatusCode:e.statusCode,ErrorCode:null,ErrorMessage:null,Headers:e.headers,Body:u._parseResponseBody(e)};else{u.log("Error Response:"+e.body);var n=u._parseErrorResponse(e);t={HttpStatusCode:e.statusCode,ErrorCode:n.errorCode,ErrorMessage:n.errorMessage,Headers:e.headers,Body:null,RawErrorResponseBody:u._parseErrorResponseBody(e)}}return t}))},e.SourceLibHeaderValue="officejs-rest",e}();e.HttpRequestExecutor=E;var I=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),t.collectionPropertyPath="_collectionPropertyPath",t.id="Id",t.idLowerCase="id",t.idPrivate="_Id",t.keepReference="_KeepReference",t.objectPathIdPrivate="_ObjectPathId",t.referenceId="_ReferenceId",t.items="_Items",t.itemsLowerCase="items",t.scalarPropertyNames="_scalarPropertyNames",t.scalarPropertyOriginalNames="_scalarPropertyOriginalNames",t.navigationPropertyNames="_navigationPropertyNames",t.scalarPropertyUpdateable="_scalarPropertyUpdateable",t.previewExecutionObjectId="_previewExecutionObjectId",t.remoteEndpointTypeHeaderKey="X-EndpointType",t}(c);e.CommonConstants=I;var w=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),t.validateObjectPath=function(e){for(var n=e._objectPath;n;){if(!n.isValid)throw new i.RuntimeError({code:a.invalidObjectPath,httpStatusCode:400,message:u._getResourceString(s.invalidObjectPath,t.getObjectPathExpression(n)),debugInfo:{errorLocation:t.getObjectPathExpression(n)}});n=n.parentObjectPath}},t.validateReferencedObjectPaths=function(e){if(e)for(var n=0;n<e.length;n++)for(var r=e[n];r;){if(!r.isValid)throw new i.RuntimeError({code:a.invalidObjectPath,httpStatusCode:400,message:u._getResourceString(s.invalidObjectPath,t.getObjectPathExpression(r))});r=r.parentObjectPath}},t._toCamelLowerCase=function(e){if(u.isNullOrEmptyString(e))return e;for(var t=0;t<e.length&&e.charCodeAt(t)>=65&&e.charCodeAt(t)<=90;)t++;return t<e.length?e.substr(0,t).toLowerCase()+e.substr(t):e.toLowerCase()},t.adjustToDateTime=function(e){if(u.isNullOrUndefined(e))return null;if("string"==typeof e)return new Date(e);if(Array.isArray(e)){for(var n=e,r=0;r<n.length;r++)n[r]=t.adjustToDateTime(n[r]);return n}throw u._createInvalidArgError({argumentName:"date"})},t.tryGetObjectIdFromLoadOrRetrieveResult=function(e){var t=e[I.id];return u.isNullOrUndefined(t)&&(t=e[I.idLowerCase]),u.isNullOrUndefined(t)&&(t=e[I.idPrivate]),t},t.getObjectPathExpression=function(e){for(var n="";e;){switch(e.objectPathInfo.ObjectPathType){case 1:n=n;break;case 2:n="new()"+(n.length>0?".":"")+n;break;case 3:n=t.normalizeName(e.objectPathInfo.Name)+"()"+(n.length>0?".":"")+n;break;case 4:n=t.normalizeName(e.objectPathInfo.Name)+(n.length>0?".":"")+n;break;case 5:n="getItem()"+(n.length>0?".":"")+n;break;case 6:n="_reference()"+(n.length>0?".":"")+n}e=e.parentObjectPath}return n},t.setMethodArguments=function(e,n,r){if(u.isNullOrUndefined(r))return null;var i=new Array,o=new Array,a=t.collectObjectPathInfos(e,r,i,o);return n.Arguments=r,a&&(n.ReferencedObjectPathIds=o),i},t.validateContext=function(e,t){if(e&&t&&t._context!==e)throw new i.RuntimeError({code:a.invalidRequestContext,httpStatusCode:400,message:u._getResourceString(s.invalidRequestContext)})},t.isSetSupported=function(e,n){return"function"==typeof t.isSetSupportedOverride?t.isSetSupportedOverride(e,n):!("undefined"!=typeof window&&window.Office&&window.Office.context&&window.Office.context.requirements)||window.Office.context.requirements.isSetSupported(e,n)},t.throwIfApiNotSupported=function(e,n,r,o){if(t._doApiNotSupportedCheck&&!t.isSetSupported(n,r)){var c=u._getResourceString(s.apiNotFoundDetails,[e,n+" "+r,o]);throw new i.RuntimeError({code:a.apiNotFound,httpStatusCode:404,message:c,debugInfo:{errorLocation:e}})}},t.calculateApiFlags=function(e,n,r){var i="undefined"!=typeof window&&window&&window.location&&window.location.href&&-1!==window.location.href.indexOf("eed0a086-3498-4f91-a377-1e0265ecc0cc");return("function"==typeof t.isSetSupportedOverride?t.isSetSupportedOverride(n,r):!i&&t.isSetSupported(n,r))||(e&=-3),e},t._parseSelectExpand=function(e){var t,n=[];if(Array.isArray(e))t=e;else{if(u.isNullOrEmptyString(e))return n;t=e.split(",")}for(var r=0;r<t.length;r++){var o=t[r];if("string"!=typeof o)throw i.RuntimeError._createInvalidArgError({argumentName:"select"});(o=a(o.trim())).length>0&&n.push(o)}return n;function a(e){var t=e.toLowerCase();if("items"===t||"items/"===t)return"*";return("items/"===t.substr(0,6)||"items."===t.substr(0,6))&&(e=e.substr(6)),e.replace(new RegExp("[/.]items[/.]","gi"),"/")}},t.changePropertyNameToCamelLowerCase=function(e){if(Array.isArray(e)){for(var n=[],r=0;r<e.length;r++)n.push(this.changePropertyNameToCamelLowerCase(e[r]));return n}if("object"==typeof e&&null!==e){n={};for(var i in e){var o=e[i];if(i===I.items){(n={})[I.itemsLowerCase]=this.changePropertyNameToCamelLowerCase(o);break}n[t._toCamelLowerCase(i)]=this.changePropertyNameToCamelLowerCase(o)}return n}return e},t.purifyJson=function(e){if(Array.isArray(e)){for(var t=[],n=0;n<e.length;n++)t.push(this.purifyJson(e[n]));return t}if("object"==typeof e&&null!==e){t={};for(var r in e)if(95!==r.charCodeAt(0)){var i=e[r];"object"==typeof i&&null!==i&&Array.isArray(i.items)&&(i=i.items),t[r]=this.purifyJson(i)}return t}return e},t.collectObjectPathInfos=function(e,n,r,i){for(var o=!1,a=0;a<n.length;a++)if(n[a]instanceof v){var s=n[a];t.validateContext(e,s),n[a]=s._objectPath.objectPathInfo.Id,i.push(s._objectPath.objectPathInfo.Id),r.push(s._objectPath),o=!0}else if(Array.isArray(n[a])){var c=new Array;t.collectObjectPathInfos(e,n[a],r,c)?(i.push(c),o=!0):i.push(0)}else u.isPlainJsonObject(n[a])?(i.push(0),t.replaceClientObjectPropertiesWithObjectPathIds(n[a],r)):i.push(0);return o},t.replaceClientObjectPropertiesWithObjectPathIds=function(e,n){var r,i;for(var o in e){var a=e[o];if(a instanceof v)n.push(a._objectPath),e[o]=((r={})[I.objectPathIdPrivate]=a._objectPath.objectPathInfo.Id,r);else if(Array.isArray(a))for(var s=0;s<a.length;s++)if(a[s]instanceof v){var c=a[s];n.push(c._objectPath),a[s]=((i={})[I.objectPathIdPrivate]=c._objectPath.objectPathInfo.Id,i)}else u.isPlainJsonObject(a[s])&&t.replaceClientObjectPropertiesWithObjectPathIds(a[s],n);else u.isPlainJsonObject(a)&&t.replaceClientObjectPropertiesWithObjectPathIds(a,n)}},t.normalizeName=function(e){return e.substr(0,1).toLowerCase()+e.substr(1)},t._doApiNotSupportedCheck=!1,t}(u);e.CommonUtility=w;var T=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),t.propertyDoesNotExist="PropertyDoesNotExist",t.attemptingToSetReadOnlyProperty="AttemptingToSetReadOnlyProperty",t}(s);e.CommonResourceStrings=T;var D=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),t.propertyNotLoaded="PropertyNotLoaded",t.runMustReturnPromise="RunMustReturnPromise",t.cannotRegisterEvent="CannotRegisterEvent",t.invalidOrTimedOutSession="InvalidOrTimedOutSession",t.cannotUpdateReadOnlyProperty="CannotUpdateReadOnlyProperty",t}(a);e.ErrorCodes=D;var x=function(){function e(e){this.m_callback=e}return e.prototype._handleResult=function(e){this.m_callback&&this.m_callback()},e}(),F=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return __extends(n,t),n.createMethodAction=function(t,n,r,i,o,a){$.validateObjectPath(n);var s={Id:t._nextId(),ActionType:3,Name:r,ObjectPathId:n._objectPath.objectPathInfo.Id,ArgumentInfo:{}},c=$.setMethodArguments(t,s.ArgumentInfo,o);$.validateReferencedObjectPaths(c);var l=$._fixupApiFlags(a),u=new O(s,i,l);if(u.referencedObjectPath=n._objectPath,u.referencedArgumentObjectPaths=c,n._addAction(u),e._internalConfig.enablePreviewExecution&&0!=(16&l)){var f={Id:t._nextId(),ActionType:3,Name:r,Arguments:o,ObjectId:"",ObjectType:""};n._addPreviewExecutionAction(f)}return u},n.createRecursiveQueryAction=function(e,t,n){$.validateObjectPath(t);var r={Id:e._nextId(),ActionType:6,Name:"",ObjectPathId:t._objectPath.objectPathInfo.Id,RecursiveQueryInfo:n},i=new O(r,1,4);return i.referencedObjectPath=t._objectPath,t._addAction(i),i},n.createEnsureUnchangedAction=function(e,t,n){$.validateObjectPath(t);var r={Id:e._nextId(),ActionType:8,Name:"",ObjectPathId:t._objectPath.objectPathInfo.Id,ObjectState:n},i=new O(r,1,4);return i.referencedObjectPath=t._objectPath,t._addAction(i),i},n.createInstantiateAction=function(e,t){$.validateObjectPath(t),e._pendingRequest.ensureInstantiateObjectPath(t._objectPath.parentObjectPath),e._pendingRequest.ensureInstantiateObjectPaths(t._objectPath.argumentObjectPaths);var n={Id:e._nextId(),ActionType:1,Name:"",ObjectPathId:t._objectPath.objectPathInfo.Id},r=new O(n,1,4);return r.referencedObjectPath=t._objectPath,t._addAction(r,new G(t),!0),r},n.createTraceAction=function(e,t,n){var r={Id:e._nextId(),ActionType:5,Name:"Trace",ObjectPathId:0},i=new O(r,1,4);return e._pendingRequest.addAction(i),n&&e._pendingRequest.addTrace(r.Id,t),i},n.createTraceMarkerForCallback=function(e,t){var r=n.createTraceAction(e,null,!1);e._pendingRequest.addActionResultHandler(r,new x(t))},n}(y);e.ActionFactory=F;var M=function(t){function n(n,r){var i=t.call(this,n,r)||this;return $.checkArgumentNull(n,"context"),i.m_context=n,i._objectPath&&(!n._processingResult&&n._pendingRequest&&(F.createInstantiateAction(n,i),n._autoCleanup&&i._KeepReference&&n.trackedObjects._autoAdd(i)),e._internalConfig.appendTypeNameToObjectPathInfo&&i._objectPath.objectPathInfo&&i._className&&(i._objectPath.objectPathInfo.T=i._className)),i}return __extends(n,t),Object.defineProperty(n.prototype,"context",{get:function(){return this.m_context},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"isNull",{get:function(){return(void 0!==this.m_isNull||!f.isMock())&&($.throwIfNotLoaded("isNull",this._isNull,null,this._isNull),this._isNull)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"isNullObject",{get:function(){return(void 0!==this.m_isNull||!f.isMock())&&($.throwIfNotLoaded("isNullObject",this._isNull,null,this._isNull),this._isNull)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"_isNull",{get:function(){return this.m_isNull},set:function(e){this.m_isNull=e,e&&this._objectPath&&this._objectPath._updateAsNullObject()},enumerable:!0,configurable:!0}),n.prototype._addAction=function(e,t,n){return void 0===t&&(t=null),n||(this.context._pendingRequest.ensureInstantiateObjectPath(this._objectPath),this.context._pendingRequest.ensureInstantiateObjectPaths(e.referencedArgumentObjectPaths)),this.context._pendingRequest.addAction(e),this.context._pendingRequest.addReferencedObjectPath(this._objectPath),this.context._pendingRequest.addReferencedObjectPaths(e.referencedArgumentObjectPaths),this.context._pendingRequest.addActionResultHandler(e,t),u._createPromiseFromResult(null)},n.prototype._addPreviewExecutionAction=function(e){if(!$.isUndefined(this._className)){e.ObjectType=this._className;var t=$._getPropertyValueWithoutCheckLoaded(this,j.idLowerCase);$.isUndefined(t)&&(t=$._getPropertyValueWithoutCheckLoaded(this,j.idPrivate)),$.isUndefined(t)&&(t=$._getPropertyValueWithoutCheckLoaded(this,j.previewExecutionObjectId)),e.ObjectId=t,this.context._pendingRequest.addPreviewExecutionAction(e)}},n.prototype._handleResult=function(e){this._isNull=$.isNullOrUndefined(e),this.context.trackedObjects._autoTrackIfNecessaryWhenHandleObjectResultValue(this,e)},n.prototype._handleIdResult=function(e){this._isNull=$.isNullOrUndefined(e),$.fixObjectPathIfNecessary(this,e),this.context.trackedObjects._autoTrackIfNecessaryWhenHandleObjectResultValue(this,e)},n.prototype._handleRetrieveResult=function(e,t){this._handleIdResult(e)},n.prototype._recursivelySet=function(e,t,r,o,c){var l=e instanceof n,f=e;if(l){if(Object.getPrototypeOf(this)!==Object.getPrototypeOf(e))throw i.RuntimeError._createInvalidArgError({argumentName:"properties",errorLocation:this._className+".set"});e=JSON.parse(JSON.stringify(e))}try{for(var d,p=0;p<r.length;p++)d=r[p],e.hasOwnProperty(d)&&void 0!==e[d]&&(this[d]=e[d]);for(p=0;p<o.length;p++)if(d=o[p],e.hasOwnProperty(d)&&void 0!==e[d]){var m=l?f[d]:e[d];this[d].set(m,t)}var g=!l;t&&!$.isNullOrUndefined(g)&&(g=t.throwOnReadOnly);for(p=0;p<c.length;p++)if(d=c[p],e.hasOwnProperty(d)&&void 0!==e[d]&&g)throw new i.RuntimeError({code:a.invalidArgument,httpStatusCode:400,message:u._getResourceString(X.cannotApplyPropertyThroughSetMethod,d),debugInfo:{errorLocation:d}});for(d in e)if(r.indexOf(d)<0&&o.indexOf(d)<0){var h=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(this),d);if(!h)throw new i.RuntimeError({code:a.invalidArgument,httpStatusCode:400,message:u._getResourceString(T.propertyDoesNotExist,d),debugInfo:{errorLocation:d}});if(g&&!h.set)throw new i.RuntimeError({code:a.invalidArgument,httpStatusCode:400,message:u._getResourceString(T.attemptingToSetReadOnlyProperty,d),debugInfo:{errorLocation:d}})}}catch(e){throw new i.RuntimeError({code:a.invalidArgument,httpStatusCode:400,message:u._getResourceString(s.invalidArgument,"properties"),debugInfo:{errorLocation:this._className+".set"},innerError:e})}},n}(v);e.ClientObject=M;var N=function(){function e(e){this.m_session=e}return e.prototype.executeAsync=function(e,t,n){var r={url:c.processQuery,method:"POST",headers:n.Headers,body:n.Body},i="";n.Headers&&(i=n.Headers[j.officeControlId]);var a={id:o.nextId(),type:1,flags:t,controlId:i,message:r,customData:e};return u.log(JSON.stringify(a)),this.m_session.sendMessageToHost(a).then((function(e){u.log("Received response: "+JSON.stringify(e));var t,n=e.message;if(200===n.statusCode)t={HttpStatusCode:n.statusCode,ErrorCode:null,ErrorMessage:null,Headers:n.headers,Body:u._parseResponseBody(n)};else{u.log("Error Response:"+n.body);var r=u._parseErrorResponse(n);t={HttpStatusCode:n.statusCode,ErrorCode:r.errorCode,ErrorMessage:r.errorMessage,Headers:n.headers,Body:null}}return t}))},e}(),R=function(e){function t(t){var n=e.call(this)||this;return n.m_bridge=t,n.m_bridge.addHostMessageHandler((function(e){if(3===e.type){var t=e.controlId;if(u.isNullOrEmptyString(t))q.getGenericEventRegistration(t)._handleRichApiMessage(e.message);else{var n=q.peekGenericEventRegistrationOrNull(t);n&&n._handleRichApiMessage(e.message),(n=q.peekGenericEventRegistrationOrNull(""))&&n._handleRichApiMessage(e.message)}}})),n}return __extends(t,e),t.getInstanceIfHostBridgeInited=function(){return o.instance?((u.isNullOrUndefined(t.s_instance)||t.s_instance.m_bridge!==o.instance)&&(t.s_instance=new t(o.instance)),t.s_instance):null},t.prototype._resolveRequestUrlAndHeaderInfo=function(){return u._createPromiseFromResult(null)},t.prototype._createRequestExecutorOrNull=function(){return u.log("NativeBridgeSession::CreateRequestExecutor"),new N(this)},t.prototype.getEventRegistration=function(e){return q.getGenericEventRegistration(e)},t.prototype.sendMessageToHost=function(e){return this.m_bridge.sendMessageToHostAndExpectResponse(e)},t}(n);e.HostBridgeSession=R;var H=function(t){function r(e){var o=t.call(this)||this;if(o.m_customRequestHeaders={},o.m_additionalData="",o.m_batchMode=0,o._onRunFinishedNotifiers=[],n._overrideSession)o.m_requestUrlAndHeaderInfoResolver=n._overrideSession;else if(($.isNullOrUndefined(e)||"string"==typeof e&&0===e.length)&&((e=r.defaultRequestUrlAndHeaders)||(e={url:c.localDocument,headers:{}})),"string"==typeof e)o.m_requestUrlAndHeaderInfo={url:e,headers:{}};else if(r.isRequestUrlAndHeaderInfoResolver(e))o.m_requestUrlAndHeaderInfoResolver=e;else{if(!r.isRequestUrlAndHeaderInfo(e))throw i.RuntimeError._createInvalidArgError({argumentName:"url"});var a=e;o.m_requestUrlAndHeaderInfo={url:a.url,headers:{}},u._copyHeaders(a.headers,o.m_requestUrlAndHeaderInfo.headers)}return!o.m_requestUrlAndHeaderInfoResolver&&o.m_requestUrlAndHeaderInfo&&u._isLocalDocumentUrl(o.m_requestUrlAndHeaderInfo.url)&&R.getInstanceIfHostBridgeInited()&&(o.m_requestUrlAndHeaderInfo=null,o.m_requestUrlAndHeaderInfoResolver=R.getInstanceIfHostBridgeInited()),o.m_requestUrlAndHeaderInfoResolver instanceof n&&(o.m_session=o.m_requestUrlAndHeaderInfoResolver),o._processingResult=!1,o._customData=j.iterativeExecutor,o.sync=o.sync.bind(o),o}return __extends(r,t),Object.defineProperty(r.prototype,"session",{get:function(){return this.m_session},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"eventRegistration",{get:function(){return this.m_session?this.m_session.getEventRegistration(this._controlId):i.officeJsEventRegistration},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"_url",{get:function(){return this.m_requestUrlAndHeaderInfo?this.m_requestUrlAndHeaderInfo.url:null},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"_pendingRequest",{get:function(){return null==this.m_pendingRequest&&(this.m_pendingRequest=new U(this)),this.m_pendingRequest},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"_controlId",{get:function(){var e=this.m_customRequestHeaders[j.officeControlId];return u.isNullOrUndefined(e)&&(e=""),e},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"debugInfo",{get:function(){return{pendingStatements:new Q(this._rootObjectPropertyName,this._pendingRequest._objectPaths,this._pendingRequest._actions,e._internalConfig.showDisposeInfoInDebugInfo).process()}},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"trackedObjects",{get:function(){return this.m_trackedObjects||(this.m_trackedObjects=new K(this)),this.m_trackedObjects},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"requestHeaders",{get:function(){return this.m_customRequestHeaders},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"requestOptions",{set:function(e){this.m_additionalData=l._buildAdditionalData(e)},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"batchMode",{get:function(){return this.m_batchMode},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"getAdditionalHeaders",{set:function(e){this.m_getAdditionalHeaders=e},enumerable:!0,configurable:!0}),r.prototype.ensureInProgressBatchIfBatchMode=function(){if(1===this.m_batchMode&&!this.m_explicitBatchInProgress)throw $.createRuntimeError(a.generalException,u._getResourceString(X.notInsideBatch),null)},r.prototype.load=function(e,t){$.validateContext(this,e);var n=r._parseQueryOption(t);y.createQueryAction(this,e,n,e)},r.prototype.loadRecursive=function(e,t,n){if(!$.isPlainJsonObject(t))throw i.RuntimeError._createInvalidArgError({argumentName:"options"});var o={};for(var a in t)o[a]=r._parseQueryOption(t[a]);var s=F.createRecursiveQueryAction(this,e,{Queries:o,MaxDepth:n});this._pendingRequest.addActionResultHandler(s,e)},r.prototype.trace=function(e){F.createTraceAction(this,e,!0)},r.prototype._processOfficeJsErrorResponse=function(e,t){},r.prototype.ensureRequestUrlAndHeaderInfo=function(){var e=this;return $._createPromiseFromResult(null).then((function(){if(!e.m_requestUrlAndHeaderInfo)return e.m_requestUrlAndHeaderInfoResolver._resolveRequestUrlAndHeaderInfo().then((function(t){if(e.m_requestUrlAndHeaderInfo=t,e.m_requestUrlAndHeaderInfo||(e.m_requestUrlAndHeaderInfo={url:c.localDocument,headers:{}}),$.isNullOrEmptyString(e.m_requestUrlAndHeaderInfo.url)&&(e.m_requestUrlAndHeaderInfo.url=c.localDocument),e.m_requestUrlAndHeaderInfo.headers||(e.m_requestUrlAndHeaderInfo.headers={}),"function"==typeof e.m_requestUrlAndHeaderInfoResolver._createRequestExecutorOrNull){var n=e.m_requestUrlAndHeaderInfoResolver._createRequestExecutorOrNull();n&&(e._requestExecutor=n)}}))}))},r.prototype.syncPrivateMain=function(){var e=this;return this.ensureRequestUrlAndHeaderInfo().then((function(){var t=e._pendingRequest;return e.m_pendingRequest=null,e.processPreSyncPromises(t).then((function(){return e.syncPrivate(t)}))}))},r.prototype.syncPrivate=function(t){var n=this;if(f.isMock())return u._createPromiseFromResult(null);if(!t.hasActions)return this.processPendingEventHandlers(t);var r=t.buildRequestMessageBodyAndRequestFlags(),o=r.body,a=r.flags;this._requestFlagModifier&&(a|=this._requestFlagModifier),this._requestExecutor||(u._isLocalDocumentUrl(this.m_requestUrlAndHeaderInfo.url)?this._requestExecutor=new z(this):this._requestExecutor=new E);var s=this._requestExecutor,l={};u._copyHeaders(this.m_requestUrlAndHeaderInfo.headers,l),u._copyHeaders(this.m_customRequestHeaders,l),delete this.m_customRequestHeaders[j.officeScriptEventId],this.m_getAdditionalHeaders&&u._copyHeaders(this.m_getAdditionalHeaders(),l);var d=f._getCurrentTestNameWithSequenceId();d&&(l[c.testRequestNameHeader]=d);var p={Url:this.m_requestUrlAndHeaderInfo.url,Headers:l,Body:o};t.invalidatePendingInvalidObjectPaths();var m=null,g=null;return this._lastSyncStart="undefined"==typeof performance?Date.now():performance.now(),this._lastRequestFlags=a,s.executeAsync(this._customData,a,p,this._invocationId,this.m_additionalData).then((function(r){return n._lastSyncEnd="undefined"==typeof performance?Date.now():performance.now(),e.config.executePerfLogFunc&&e.config.executePerfLogFunc({syncStart:n._lastSyncStart,syncEnd:n._lastSyncEnd}),m=n.processRequestExecutorResponseMessage(t,r),n.processPendingEventHandlers(t).catch((function(e){u.log("Error in processPendingEventHandlers"),u.log(JSON.stringify(e)),g=e}))})).then((function(){if(m)throw u.log("Throw error from response: "+JSON.stringify(m)),m;if(g){u.log("Throw error from ProcessEventHandler: "+JSON.stringify(g));var e=null;if(g instanceof i.RuntimeError)(e=g).traceMessages=t._responseTraceMessages;else{var n=null;n="string"==typeof g?g:g.message,$.isNullOrEmptyString(n)&&(n=u._getResourceString(X.cannotRegisterEvent)),e=new i.RuntimeError({code:D.cannotRegisterEvent,httpStatusCode:400,message:n,traceMessages:t._responseTraceMessages})}throw e}}))},r.prototype.processRequestExecutorResponseMessage=function(t,n){n.Body&&n.Body.TraceIds&&t._setResponseTraceIds(n.Body.TraceIds);var r=t._responseTraceMessages,o=null;if(n.Body){if(n.Body.Error&&n.Body.Error.ActionIndex>=0){var a=new Q(this._rootObjectPropertyName,t._objectPaths,t._actions,!1,!0),s=a.processForDebugStatementInfo(n.Body.Error.ActionIndex);o={statement:s.statement,surroundingStatements:s.surroundingStatements,fullStatements:["Please enable config.extendedErrorLogging to see full statements."]},e.config.extendedErrorLogging&&(a=new Q(this._rootObjectPropertyName,t._objectPaths,t._actions,!1,!1),o.fullStatements=a.process())}var c=null;if(n.Body.Results?c=n.Body.Results:n.Body.ProcessedResults&&n.Body.ProcessedResults.Results&&(c=n.Body.ProcessedResults.Results),c){this._processingResult=!0;try{t.processResponse(c)}finally{this._processingResult=!1}}}if(!$.isNullOrEmptyString(n.ErrorCode))return new i.RuntimeError({code:n.ErrorCode,httpStatusCode:n.HttpStatusCode,message:n.ErrorMessage,traceMessages:r,data:{responseBody:n.RawErrorResponseBody}});if(n.Body&&n.Body.Error){var l={errorLocation:n.Body.Error.Location};return o&&(l.statement=o.statement,l.surroundingStatements=o.surroundingStatements,l.fullStatements=o.fullStatements),new i.RuntimeError({code:n.Body.Error.Code,httpStatusCode:n.Body.Error.HttpStatusCode,message:n.Body.Error.Message,traceMessages:r,debugInfo:l})}return null},r.prototype.processPendingEventHandlers=function(e){for(var t=$._createPromiseFromResult(null),n=0;n<e._pendingProcessEventHandlers.length;n++){var r=e._pendingProcessEventHandlers[n];t=t.then(this.createProcessOneEventHandlersFunc(r,e))}return t},r.prototype.createProcessOneEventHandlersFunc=function(e,t){return function(){return e._processRegistration(t)}},r.prototype.processPreSyncPromises=function(e){for(var t=$._createPromiseFromResult(null),n=0;n<e._preSyncPromises.length;n++){var r=e._preSyncPromises[n];t=t.then(this.createProcessOneProSyncFunc(r))}return t},r.prototype.createProcessOneProSyncFunc=function(e){return function(){return e}},r.prototype.sync=function(e){return f.isMock()?u._createPromiseFromResult(e):this.syncPrivateMain().then((function(){return e}))},r.prototype.batch=function(e){var t=this;if(1!==this.m_batchMode)return u._createPromiseFromException($.createRuntimeError(a.generalException,null,null));if(this.m_explicitBatchInProgress)return u._createPromiseFromException($.createRuntimeError(a.generalException,u._getResourceString(X.pendingBatchInProgress),null));if($.isNullOrUndefined(e))return $._createPromiseFromResult(null);this.m_explicitBatchInProgress=!0;var n,r,i,o=this.m_pendingRequest;this.m_pendingRequest=new U(this);try{n=e(this._rootObject,this)}catch(e){return this.m_explicitBatchInProgress=!1,this.m_pendingRequest=o,u._createPromiseFromException(e)}return"object"==typeof n&&n&&"function"==typeof n.then?i=$._createPromiseFromResult(null).then((function(){return n})).then((function(e){return t.m_explicitBatchInProgress=!1,r=t.m_pendingRequest,t.m_pendingRequest=o,e})).catch((function(e){return t.m_explicitBatchInProgress=!1,r=t.m_pendingRequest,t.m_pendingRequest=o,u._createPromiseFromException(e)})):(this.m_explicitBatchInProgress=!1,r=this.m_pendingRequest,this.m_pendingRequest=o,i=$._createPromiseFromResult(n)),i.then((function(e){return t.ensureRequestUrlAndHeaderInfo().then((function(){return t.syncPrivate(r)})).then((function(){return e}))}))},r._run=function(e,t,n,i,o,a){return void 0===n&&(n=3),void 0===i&&(i=5e3),r._runCommon("run",null,e,0,t,n,i,null,null,o,a)},r.isValidRequestInfo=function(e){return"string"==typeof e||r.isRequestUrlAndHeaderInfo(e)||r.isRequestUrlAndHeaderInfoResolver(e)},r.isRequestUrlAndHeaderInfo=function(e){return"object"==typeof e&&null!==e&&Object.getPrototypeOf(e)===Object.getPrototypeOf({})&&!$.isNullOrUndefined(e.url)},r.isRequestUrlAndHeaderInfoResolver=function(e){return"object"==typeof e&&null!==e&&"function"==typeof e._resolveRequestUrlAndHeaderInfo},r._runBatch=function(e,t,n,i,o,a,s,c,l){return void 0===a&&(a=3),void 0===s&&(s=5e3),r._runBatchCommon(0,e,t,n,a,s,i,o,c,l)},r._runExplicitBatch=function(e,t,n,i,o,a,s,c,l){return void 0===a&&(a=3),void 0===s&&(s=5e3),r._runBatchCommon(1,e,t,n,a,s,i,o,c,l)},r._runBatchCommon=function(e,t,n,i,o,a,s,c,l,u){var f,d;void 0===o&&(o=3),void 0===a&&(a=5e3);var p=null,g=null,h=null,y=0,v=null;if(n.length>0)if(r.isValidRequestInfo(n[0]))p=n[0],y=1;else if($.isPlainJsonObject(n[0])){if(null!=(p=(v=n[0]).session)&&!r.isValidRequestInfo(p))return r.createErrorPromise(t);g=v.getAdditionalHeaders,h=v.previousObjects,y=1}if(n.length==y+1)d=n[y+0];else{if(null!=v||n.length!=y+2)return r.createErrorPromise(t);h=n[y+0],d=n[y+1]}if(null!=h)if(h instanceof M)f=function(){return h.context};else if(h instanceof r)f=function(){return h};else{if(!Array.isArray(h))return r.createErrorPromise(t);var O=h;if(0==O.length){if(!m())return r.createErrorPromise(t);f=i}else{for(var S=0;S<O.length;S++){if(!(O[S]instanceof M))return r.createErrorPromise(t);if(O[S].context!=O[0].context)return r.createErrorPromise(t,X.invalidRequestContext)}f=function(){return O[0].context}}}else f=i;var b=null;s&&(b=function(e){return s(v||{},e)});var _=null;return c&&(_=function(e){return c(v||{},e)}),r._runCommon(t,p,f,e,d,o,a,b,_,l,u,g)},r.createErrorPromise=function(e,t){return void 0===t&&(t=s.invalidArgument),u._createPromiseFromException($.createRuntimeError(t,u._getResourceString(t),e))},r._runCommon=function(t,i,o,a,s,c,l,f,d,p,m,g){n._overrideSession&&(i=n._overrideSession);var h,y,v,O=u.createPromise((function(e,t){e()})),S=!1;return O.then((function(){if((h=o(i)).getAdditionalHeaders=g,h._autoCleanup)return new e.Promise((function(e,t){h._onRunFinishedNotifiers.push((function(){h._autoCleanup=!0,e()}))}));h._autoCleanup=!0})).then((function(){return"function"!=typeof s?r.createErrorPromise(t):(v=h.m_batchMode,h.m_batchMode=a,f&&f(h),e=s(1==a?h.batch.bind(h):h),($.isNullOrUndefined(e)||"function"!=typeof e.then)&&$.throwError(X.runMustReturnPromise),e);var e})).then((function(e){return 1===a?e:h.sync(e)})).then((function(e){S=!0,y=e})).catch((function(e){y=e})).then((function(){var e=h.trackedObjects._retrieveAndClearAutoCleanupList();for(var t in h._autoCleanup=!1,h.m_batchMode=v,e)e[t]._objectPath.isValid=!1;var n=0;if($._synchronousCleanup||r.isRequestUrlAndHeaderInfoResolver(i))return o();function o(){n++;var t=h.m_pendingRequest,r=h.m_batchMode,i=new U(h);h.m_pendingRequest=i,h.m_batchMode=0;try{for(var a in e)h.trackedObjects.remove(e[a]);d&&d(h)}finally{h.m_batchMode=r,h.m_pendingRequest=t}return h.syncPrivate(i).then((function(){p&&p(n)})).catch((function(){m&&m(n),n<c&&setTimeout((function(){o()}),l)}))}o()})).then((function(){h._onRunFinishedNotifiers&&h._onRunFinishedNotifiers.length>0&&h._onRunFinishedNotifiers.shift()();if(S)return y;throw y}))},r}(b);e.ClientRequestContext=H;var k=function(){function e(e,t){this.m_proxy=e,this.m_shouldPolyfill=t;var n=e[j.scalarPropertyNames],r=e[j.navigationPropertyNames],i=e[j.className],o=e[j.isCollection];if(n)for(var a=0;a<n.length;a++)$.definePropertyThrowUnloadedException(this,i,n[a]);if(r)for(a=0;a<r.length;a++)$.definePropertyThrowUnloadedException(this,i,r[a]);o&&$.definePropertyThrowUnloadedException(this,i,j.itemsLowerCase)}return Object.defineProperty(e.prototype,"$proxy",{get:function(){return this.m_proxy},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"$isNullObject",{get:function(){if(!this.m_isLoaded)throw new i.RuntimeError({code:D.valueNotLoaded,httpStatusCode:400,message:u._getResourceString(X.valueNotLoaded),debugInfo:{errorLocation:"retrieveResult.$isNullObject"}});return this.m_isNullObject},enumerable:!0,configurable:!0}),e.prototype.toJSON=function(){if(this.m_isLoaded)return this.m_isNullObject?null:($.isUndefined(this.m_json)&&(this.m_json=$.purifyJson(this.m_value)),this.m_json)},e.prototype.toString=function(){return JSON.stringify(this.toJSON())},e.prototype._handleResult=function(e){this.m_isLoaded=!0,null===e||"object"==typeof e&&e&&e._IsNull?(this.m_isNullObject=!0,e=null):this.m_isNullObject=!1,this.m_shouldPolyfill&&(e=$.changePropertyNameToCamelLowerCase(e)),this.m_value=e,this.m_proxy._handleRetrieveResult(e,this)},e}(),j=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),t.getItemAt="GetItemAt",t.index="_Index",t.iterativeExecutor="IterativeExecutor",t.isTracked="_IsTracked",t.eventMessageCategory=65536,t.eventWorkbookId="Workbook",t.eventSourceRemote="Remote",t.proxy="$proxy",t.className="_className",t.isCollection="_isCollection",t.collectionPropertyPath="_collectionPropertyPath",t.objectPathInfoDoNotKeepReferenceFieldName="D",t.officeScriptEventId="X-OfficeScriptEventId",t.officeScriptFireRecordingEvent="X-OfficeScriptFireRecordingEvent",t.officeControlId="X-OfficeControlId",t}(I);e.Constants=j;var U=function(e){function t(t){var n=e.call(this,t)||this;return n.m_context=t,n.m_pendingProcessEventHandlers=[],n.m_pendingEventHandlerActions={},n.m_traceInfos={},n.m_responseTraceIds={},n.m_responseTraceMessages=[],n}return __extends(t,e),Object.defineProperty(t.prototype,"traceInfos",{get:function(){return this.m_traceInfos},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"_responseTraceMessages",{get:function(){return this.m_responseTraceMessages},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"_responseTraceIds",{get:function(){return this.m_responseTraceIds},enumerable:!0,configurable:!0}),t.prototype._setResponseTraceIds=function(e){if(e)for(var t=0;t<e.length;t++){var n=e[t];this.m_responseTraceIds[n]=n;var r=this.m_traceInfos[n];u.isNullOrUndefined(r)||this.m_responseTraceMessages.push(r)}},t.prototype.addTrace=function(e,t){this.m_traceInfos[e]=t},t.prototype._addPendingEventHandlerAction=function(e,t){this.m_pendingEventHandlerActions[e._id]||(this.m_pendingEventHandlerActions[e._id]=[],this.m_pendingProcessEventHandlers.push(e)),this.m_pendingEventHandlerActions[e._id].push(t)},Object.defineProperty(t.prototype,"_pendingProcessEventHandlers",{get:function(){return this.m_pendingProcessEventHandlers},enumerable:!0,configurable:!0}),t.prototype._getPendingEventHandlerActions=function(e){return this.m_pendingEventHandlerActions[e._id]},t}(A);e.ClientRequest=U;var L=function(){function e(e,t,n,r){var i=this;this.m_id=e._nextId(),this.m_context=e,this.m_name=n,this.m_handlers=[],this.m_registered=!1,this.m_eventInfo=r,this.m_callback=function(e){i.m_eventInfo.eventArgsTransformFunc(e).then((function(e){return i.fireEvent(e)}))}}return Object.defineProperty(e.prototype,"_registered",{get:function(){return this.m_registered},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"_id",{get:function(){return this.m_id},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"_handlers",{get:function(){return this.m_handlers},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"_context",{get:function(){return this.m_context},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"_callback",{get:function(){return this.m_callback},enumerable:!0,configurable:!0}),e.prototype.add=function(e){var t=F.createTraceAction(this.m_context,null,!1);return this.m_context._pendingRequest._addPendingEventHandlerAction(this,{id:t.actionInfo.Id,handler:e,operation:0}),new B(this.m_context,this,e)},e.prototype.remove=function(e){var t=F.createTraceAction(this.m_context,null,!1);this.m_context._pendingRequest._addPendingEventHandlerAction(this,{id:t.actionInfo.Id,handler:e,operation:1})},e.prototype.removeAll=function(){var e=F.createTraceAction(this.m_context,null,!1);this.m_context._pendingRequest._addPendingEventHandlerAction(this,{id:e.actionInfo.Id,handler:null,operation:2})},e.prototype._processRegistration=function(e){var t=this,n=u._createPromiseFromResult(null),r=e._getPendingEventHandlerActions(this);if(!r)return n;for(var i=[],o=0;o<this.m_handlers.length;o++)i.push(this.m_handlers[o]);var a=!1;for(o=0;o<r.length;o++)if(e._responseTraceIds[r[o].id])switch(a=!0,r[o].operation){case 0:i.push(r[o].handler);break;case 1:for(var s=i.length-1;s>=0;s--)if(i[s]===r[o].handler){i.splice(s,1);break}break;case 2:i=[]}return a&&(!this.m_registered&&i.length>0?n=n.then((function(){return t.m_eventInfo.registerFunc(t.m_callback)})).then((function(){return t.m_registered=!0})):this.m_registered&&0==i.length&&(n=n.then((function(){return t.m_eventInfo.unregisterFunc(t.m_callback)})).catch((function(e){u.log("Error when unregister event: "+JSON.stringify(e))})).then((function(){return t.m_registered=!1}))),n=n.then((function(){return t.m_handlers=i}))),n},e.prototype.fireEvent=function(e){for(var t=[],n=0;n<this.m_handlers.length;n++){var r=this.m_handlers[n],i=u._createPromiseFromResult(null).then(this.createFireOneEventHandlerFunc(r,e)).catch((function(e){u.log("Error when invoke handler: "+JSON.stringify(e))}));t.push(i)}u.Promise.all(t)},e.prototype.createFireOneEventHandlerFunc=function(e,t){return function(){return e(t)}},e}();e.EventHandlers=L;var B=function(){function e(e,t,n){this.m_context=e,this.m_allHandlers=t,this.m_handler=n}return Object.defineProperty(e.prototype,"context",{get:function(){return this.m_context},enumerable:!0,configurable:!0}),e.prototype.remove=function(){this.m_allHandlers&&this.m_handler&&(this.m_allHandlers.remove(this.m_handler),this.m_allHandlers=null,this.m_handler=null)},e}();e.EventHandlerResult=B,function(e){var t=function(){function t(){}return t.prototype.register=function(t,n,r){switch(t){case 4:return $.promisify((function(e){return Office.context.document.bindings.getByIdAsync(n,e)})).then((function(e){return $.promisify((function(t){return e.addHandlerAsync(Office.EventType.BindingDataChanged,r,t)}))}));case 3:return $.promisify((function(e){return Office.context.document.bindings.getByIdAsync(n,e)})).then((function(e){return $.promisify((function(t){return e.addHandlerAsync(Office.EventType.BindingSelectionChanged,r,t)}))}));case 2:return $.promisify((function(e){return Office.context.document.addHandlerAsync(Office.EventType.DocumentSelectionChanged,r,e)}));case 1:return $.promisify((function(e){return Office.context.document.settings.addHandlerAsync(Office.EventType.SettingsChanged,r,e)}));case 5:return OSF.DDA.RichApi.richApiMessageManager.register(r);case 13:return $.promisify((function(e){return Office.context.document.addHandlerAsync(Office.EventType.ObjectDeleted,r,{id:n},e)}));case 14:return $.promisify((function(e){return Office.context.document.addHandlerAsync(Office.EventType.ObjectSelectionChanged,r,{id:n},e)}));case 15:return $.promisify((function(e){return Office.context.document.addHandlerAsync(Office.EventType.ObjectDataChanged,r,{id:n},e)}));case 16:return $.promisify((function(e){return Office.context.document.addHandlerAsync(Office.EventType.ContentControlAdded,r,{id:n},e)}));default:throw e.RuntimeError._createInvalidArgError({argumentName:"eventId"})}},t.prototype.unregister=function(t,n,r){switch(t){case 4:return $.promisify((function(e){return Office.context.document.bindings.getByIdAsync(n,e)})).then((function(e){return $.promisify((function(t){return e.removeHandlerAsync(Office.EventType.BindingDataChanged,{handler:r},t)}))}));case 3:return $.promisify((function(e){return Office.context.document.bindings.getByIdAsync(n,e)})).then((function(e){return $.promisify((function(t){return e.removeHandlerAsync(Office.EventType.BindingSelectionChanged,{handler:r},t)}))}));case 2:return $.promisify((function(e){return Office.context.document.removeHandlerAsync(Office.EventType.DocumentSelectionChanged,{handler:r},e)}));case 1:return $.promisify((function(e){return Office.context.document.settings.removeHandlerAsync(Office.EventType.SettingsChanged,{handler:r},e)}));case 5:return $.promisify((function(e){return OSF.DDA.RichApi.richApiMessageManager.removeHandlerAsync("richApiMessage",{handler:r},e)}));case 13:return $.promisify((function(e){return Office.context.document.removeHandlerAsync(Office.EventType.ObjectDeleted,{id:n,handler:r},e)}));case 14:return $.promisify((function(e){return Office.context.document.removeHandlerAsync(Office.EventType.ObjectSelectionChanged,{id:n,handler:r},e)}));case 15:return $.promisify((function(e){return Office.context.document.removeHandlerAsync(Office.EventType.ObjectDataChanged,{id:n,handler:r},e)}));case 16:return $.promisify((function(e){return Office.context.document.removeHandlerAsync(Office.EventType.ContentControlAdded,{id:n,handler:r},e)}));default:throw e.RuntimeError._createInvalidArgError({argumentName:"eventId"})}},t}();e.officeJsEventRegistration=new t}(i=e._Internal||(e._Internal={}));var W=function(){function e(e,t){this.m_handlersByEventByTarget={},this.m_registerEventImpl=e,this.m_unregisterEventImpl=t}return e.getTargetIdOrDefault=function(e){return $.isNullOrUndefined(e)?"":e},e.prototype.getHandlers=function(t,n){n=e.getTargetIdOrDefault(n);var r=this.m_handlersByEventByTarget[t];r||(r={},this.m_handlersByEventByTarget[t]=r);var i=r[n];return i||(i=[],r[n]=i),i},e.prototype.callHandlers=function(e,t,n){for(var r=this.getHandlers(e,t),i=0;i<r.length;i++)r[i](n)},e.prototype.hasHandlers=function(e,t){return this.getHandlers(e,t).length>0},e.prototype.register=function(e,t,n){if(!n)throw i.RuntimeError._createInvalidArgError({argumentName:"handler"});var r=this.getHandlers(e,t);return r.push(n),1===r.length?this.m_registerEventImpl(e,t):$._createPromiseFromResult(null)},e.prototype.unregister=function(e,t,n){if(!n)throw i.RuntimeError._createInvalidArgError({argumentName:"handler"});for(var r=this.getHandlers(e,t),o=r.length-1;o>=0;o--)if(r[o]===n){r.splice(o,1);break}return 0===r.length?this.m_unregisterEventImpl(e,t):$._createPromiseFromResult(null)},e}();e.EventRegistration=W;var q=function(){function e(){this.m_eventRegistration=new W(this._registerEventImpl.bind(this),this._unregisterEventImpl.bind(this)),this.m_richApiMessageHandler=this._handleRichApiMessage.bind(this)}return e.prototype.ready=function(){var t=this;return this.m_ready||(e._testReadyImpl?this.m_ready=e._testReadyImpl().then((function(){t.m_isReady=!0})):o.instance?this.m_ready=$._createPromiseFromResult(null).then((function(){t.m_isReady=!0})):this.m_ready=i.officeJsEventRegistration.register(5,"",this.m_richApiMessageHandler).then((function(){t.m_isReady=!0}))),this.m_ready},Object.defineProperty(e.prototype,"isReady",{get:function(){return this.m_isReady},enumerable:!0,configurable:!0}),e.prototype.register=function(e,t,n){var r=this;return this.ready().then((function(){return r.m_eventRegistration.register(e,t,n)}))},e.prototype.unregister=function(e,t,n){var r=this;return this.ready().then((function(){return r.m_eventRegistration.unregister(e,t,n)}))},e.prototype._registerEventImpl=function(e,t){return $._createPromiseFromResult(null)},e.prototype._unregisterEventImpl=function(e,t){return $._createPromiseFromResult(null)},e.prototype._handleRichApiMessage=function(e){if(e&&e.entries)for(var t=0;t<e.entries.length;t++){var n=e.entries[t];if(n.messageCategory==j.eventMessageCategory){u._logEnabled&&u.log(JSON.stringify(n));var r=n.messageType,i=n.targetId;if(this.m_eventRegistration.hasHandlers(r,i)){var o=JSON.parse(n.message);n.isRemoteOverride&&(o.source=j.eventSourceRemote),this.m_eventRegistration.callHandlers(r,i,o)}}}},e.getGenericEventRegistration=function(t){u.isNullOrUndefined(t)&&(t="");var n=e.s_genericEventRegistrations[t];return n||(n=new e,e.s_genericEventRegistrations[t]=n),n},e.peekGenericEventRegistrationOrNull=function(t){return u.isNullOrUndefined(t)&&(t=""),e.s_genericEventRegistrations[t]},e.richApiMessageEventCategory=65536,e.s_genericEventRegistrations={},e}();e.GenericEventRegistration=q,e._testSetRichApiMessageReadyImpl=function(e){q._testReadyImpl=e},e._testTriggerRichApiMessageEvent=function(e){q.getGenericEventRegistration("")._handleRichApiMessage(e)};var V=function(e){function t(t,n,r,i){var o=e.call(this,t,n,r,i)||this;return o.m_genericEventInfo=i,o}return __extends(t,e),t.prototype.add=function(e){var t=this;0==this._handlers.length&&this.m_genericEventInfo.registerFunc&&this.m_genericEventInfo.registerFunc();var n=this._context._controlId;return q.getGenericEventRegistration(n).isReady||this._context._pendingRequest._addPreSyncPromise(q.getGenericEventRegistration(n).ready()),F.createTraceMarkerForCallback(this._context,(function(){t._handlers.push(e),1==t._handlers.length&&q.getGenericEventRegistration(n).register(t.m_genericEventInfo.eventType,t.m_genericEventInfo.getTargetIdFunc(),t._callback)})),new B(this._context,this,e)},t.prototype.remove=function(e){var t=this;1==this._handlers.length&&this.m_genericEventInfo.unregisterFunc&&this.m_genericEventInfo.unregisterFunc();var n=this._context._controlId;F.createTraceMarkerForCallback(this._context,(function(){for(var r=t._handlers,i=r.length-1;i>=0;i--)if(r[i]===e){r.splice(i,1);break}0==r.length&&q.getGenericEventRegistration(n).unregister(t.m_genericEventInfo.eventType,t.m_genericEventInfo.getTargetIdFunc(),t._callback)}))},t.prototype.removeAll=function(){},t}(L);e.GenericEventHandlers=V;var G=function(){function e(e){this.m_clientObject=e}return e.prototype._handleResult=function(e){this.m_clientObject._handleIdResult(e)},e}(),J=function(){function e(){}return e.createGlobalObjectObjectPath=function(e){var t={Id:e._nextId(),ObjectPathType:1,Name:""};return new S(t,null,!1,!1,1,4)},e.createNewObjectObjectPath=function(e,t,n,r){var i={Id:e._nextId(),ObjectPathType:2,Name:t};return new S(i,null,n,!1,1,$._fixupApiFlags(r))},e.createPropertyObjectPath=function(e,t,n,r,i,o){var a={Id:e._nextId(),ObjectPathType:4,Name:n,ParentObjectPathId:t._objectPath.objectPathInfo.Id};return new S(a,t._objectPath,r,i,1,$._fixupApiFlags(o))},e.createIndexerObjectPath=function(e,t,n){var r={Id:e._nextId(),ObjectPathType:5,Name:"",ParentObjectPathId:t._objectPath.objectPathInfo.Id,ArgumentInfo:{}};return r.ArgumentInfo.Arguments=n,new S(r,t._objectPath,!1,!1,1,4)},e.createIndexerObjectPathUsingParentPath=function(e,t,n){var r={Id:e._nextId(),ObjectPathType:5,Name:"",ParentObjectPathId:t.objectPathInfo.Id,ArgumentInfo:{}};return r.ArgumentInfo.Arguments=n,new S(r,t,!1,!1,1,4)},e.createMethodObjectPath=function(e,t,n,r,i,o,a,s,c){var l={Id:e._nextId(),ObjectPathType:3,Name:n,ParentObjectPathId:t._objectPath.objectPathInfo.Id,ArgumentInfo:{}},u=$.setMethodArguments(e,l.ArgumentInfo,i),f=new S(l,t._objectPath,o,a,r,$._fixupApiFlags(c));return f.argumentObjectPaths=u,f.getByIdMethodName=s,f},e.createReferenceIdObjectPath=function(e,t){var n={Id:e._nextId(),ObjectPathType:6,Name:t,ArgumentInfo:{}};return new S(n,null,!1,!1,1,4)},e.createChildItemObjectPathUsingIndexerOrGetItemAt=function(t,n,r,i,o){var a=$.tryGetObjectIdFromLoadOrRetrieveResult(i);return t&&!$.isNullOrUndefined(a)?e.createChildItemObjectPathUsingIndexer(n,r,i):e.createChildItemObjectPathUsingGetItemAt(n,r,i,o)},e.createChildItemObjectPathUsingIndexer=function(e,t,n){var r=$.tryGetObjectIdFromLoadOrRetrieveResult(n),i=i={Id:e._nextId(),ObjectPathType:5,Name:"",ParentObjectPathId:t._objectPath.objectPathInfo.Id,ArgumentInfo:{}};return i.ArgumentInfo.Arguments=[r],new S(i,t._objectPath,!1,!1,1,4)},e.createChildItemObjectPathUsingGetItemAt=function(e,t,n,r){var i=n[j.index];i&&(r=i);var o={Id:e._nextId(),ObjectPathType:3,Name:j.getItemAt,ParentObjectPathId:t._objectPath.objectPathInfo.Id,ArgumentInfo:{}};return o.ArgumentInfo.Arguments=[r],new S(o,t._objectPath,!1,!1,1,4)},e}();e.ObjectPathFactory=J;var z=function(){function t(e){this.m_context=e}return t.prototype.executeAsync=function(n,r,i,o,a){var s=this,c=l.buildMessageArrayForIRequestExecutor(n,r,i,t.SourceLibHeaderValue,o,a),f=this.m_context._blockWrite&&0!=(1&r);if(f)throw"Block Write: "+f;return new e.Promise((function(e,n){var r=!1,i=function(){OSF.DDA.RichApi.executeRichApiRequestAsync(c,(function(n){var o;if(u.log("Response:"),u.log(JSON.stringify(n)),"succeeded"==n.status)r&&t._logDeletedSheetRetry("succeeded"),o=l.buildResponseOnSuccess(l.getResponseBody(n),l.getResponseHeaders(n));else{if(t._shouldRetryOnDeletedSheet(n.error.code)){if(!r)return r=!0,t._logDeletedSheetRetry("attempted"),void setTimeout(i,t.DeletedSheetRetryDelayInMs);t._logDeletedSheetRetry("exhausted")}o=l.buildResponseOnError(n.error.code,n.error.message),s.m_context._processOfficeJsErrorResponse(n.error.code,o)}e(o)}))};i()}))},t._shouldRetryOnDeletedSheet=function(e){return g()&&t._isExcelOnTheWeb()&&e===t.InvalidSheetNameErrorCode},t._isExcelOnTheWeb=function(){try{var e="undefined"!=typeof self?self:"undefined"!=typeof window?window:null,t=e&&e.Office&&e.Office.context;return!(!t||"OfficeOnline"!==t.platform)&&(!t.host||"Excel"===t.host)}catch(e){return!1}},t._logDeletedSheetRetry=function(e){try{var t="undefined"!=typeof self?self:"undefined"!=typeof window?window:null,n=t&&t.OSF&&t.OSF.AppTelemetry;n&&"function"==typeof n.logAppCommonMessage&&n.logAppCommonMessage("RichApi.ExcelWebDeletedSheetRetry."+e)}catch(e){}},t.SourceLibHeaderValue="officejs",t.InvalidSheetNameErrorCode=1014,t.DeletedSheetRetryDelayInMs=50,t}(),K=function(){function e(e){this._autoCleanupList={},this.m_context=e}return e.prototype.add=function(e){var t=this;Array.isArray(e)?e.forEach((function(e){return t._addCommon(e,!0)})):this._addCommon(e,!0)},e.prototype._autoAdd=function(e){this._addCommon(e,!1),this._autoCleanupList[e._objectPath.objectPathInfo.Id]=e},e.prototype._autoTrackIfNecessaryWhenHandleObjectResultValue=function(e,t){this.m_context._autoCleanup&&!e[j.isTracked]&&e!==this.m_context._rootObject&&t&&!$.isNullOrEmptyString(t[j.referenceId])&&(this._autoCleanupList[e._objectPath.objectPathInfo.Id]=e,e[j.isTracked]=!0)},e.prototype._addCommon=function(e,t){if(e[j.isTracked])t&&this.m_context._autoCleanup&&delete this._autoCleanupList[e._objectPath.objectPathInfo.Id];else{var n=e[j.referenceId];if(e._objectPath.objectPathInfo[j.objectPathInfoDoNotKeepReferenceFieldName])throw $.createRuntimeError(a.generalException,u._getResourceString(X.objectIsUntracked),null);$.isNullOrEmptyString(n)&&e._KeepReference&&(e._KeepReference(),F.createInstantiateAction(this.m_context,e),t&&this.m_context._autoCleanup&&delete this._autoCleanupList[e._objectPath.objectPathInfo.Id],e[j.isTracked]=!0)}},e.prototype.remove=function(e){var t=this;Array.isArray(e)?e.forEach((function(e){return t._removeCommon(e)})):this._removeCommon(e)},e.prototype._removeCommon=function(e){e._objectPath.objectPathInfo[j.objectPathInfoDoNotKeepReferenceFieldName]=!0,e.context._pendingRequest._removeKeepReferenceAction(e._objectPath.objectPathInfo.Id);var t=e[j.referenceId];if(!$.isNullOrEmptyString(t)){var n=this.m_context._rootObject;n._RemoveReference&&n._RemoveReference(t)}delete e[j.isTracked]},e.prototype._retrieveAndClearAutoCleanupList=function(){var e=this._autoCleanupList;return this._autoCleanupList={},e},e}();e.TrackedObjects=K;var Q=function(){function t(e,t,n,r,i){e||(e="root"),this.m_globalObjName=e,this.m_referencedObjectPaths=t,this.m_actions=n,this.m_statements=[],this.m_variableNameForObjectPathMap={},this.m_variableNameToObjectPathMap={},this.m_declaredObjectPathMap={},this.m_showDispose=r,this.m_removePII=i}return t.prototype.process=function(){this.m_showDispose&&U._calculateLastUsedObjectPathIds(this.m_actions);for(var e=0;e<this.m_actions.length;e++)this.processOneAction(this.m_actions[e]);return this.m_statements},t.prototype.processForDebugStatementInfo=function(e){this.m_showDispose&&U._calculateLastUsedObjectPathIds(this.m_actions);this.m_statements=[];for(var t=-1,n=0;n<this.m_actions.length&&(this.processOneAction(this.m_actions[n]),e==n&&(t=this.m_statements.length-1),!(t>=0&&this.m_statements.length>t+5+1));n++);if(t<0)return null;var r=t-5;r<0&&(r=0);var i=t+1+5;i>this.m_statements.length&&(i=this.m_statements.length);var o=[];0!=r&&o.push("...");for(var a=r;a<t;a++)o.push(this.m_statements[a]);o.push("// >>>>>"),o.push(this.m_statements[t]),o.push("// <<<<<");for(var s=t+1;s<i;s++)o.push(this.m_statements[s]);return i<this.m_statements.length&&o.push("..."),{statement:this.m_statements[t],surroundingStatements:o}},t.prototype.processOneAction=function(e){switch(e.actionInfo.ActionType){case 1:this.processInstantiateAction(e);break;case 3:this.processMethodAction(e);break;case 2:this.processQueryAction(e);break;case 7:this.processQueryAsJsonAction(e);break;case 6:this.processRecursiveQueryAction(e);break;case 4:this.processSetPropertyAction(e);break;case 5:this.processTraceAction(e);break;case 8:this.processEnsureUnchangedAction(e);break;case 9:this.processUpdateAction(e)}},t.prototype.processInstantiateAction=function(e){var t=e.actionInfo.ObjectPathId,n=this.m_referencedObjectPaths[t],r=this.getObjVarName(t);if(this.m_declaredObjectPathMap[t]){i="// Instantiate {"+r+"}";i=this.appendDisposeCommentIfRelevant(i,e),this.m_statements.push(i)}else{var i="var "+r+" = "+this.buildObjectPathExpressionWithParent(n)+";";i=this.appendDisposeCommentIfRelevant(i,e),this.m_statements.push(i),this.m_declaredObjectPathMap[t]=r}},t.prototype.processMethodAction=function(t){var n=t.actionInfo.Name;if("_KeepReference"===n){if(!e._internalConfig.showInternalApiInDebugInfo)return;n="track"}var r=this.getObjVarName(t.actionInfo.ObjectPathId)+"."+$._toCamelLowerCase(n)+"("+this.buildArgumentsExpression(t.actionInfo.ArgumentInfo)+");";r=this.appendDisposeCommentIfRelevant(r,t),this.m_statements.push(r)},t.prototype.processQueryAction=function(e){var t=this.buildQueryExpression(e),n=this.getObjVarName(e.actionInfo.ObjectPathId)+".load("+t+");";n=this.appendDisposeCommentIfRelevant(n,e),this.m_statements.push(n)},t.prototype.processQueryAsJsonAction=function(e){var t=this.buildQueryExpression(e),n=this.getObjVarName(e.actionInfo.ObjectPathId)+".retrieve("+t+");";n=this.appendDisposeCommentIfRelevant(n,e),this.m_statements.push(n)},t.prototype.processRecursiveQueryAction=function(e){var t="";e.actionInfo.RecursiveQueryInfo&&(t=JSON.stringify(e.actionInfo.RecursiveQueryInfo));var n=this.getObjVarName(e.actionInfo.ObjectPathId)+".loadRecursive("+t+");";n=this.appendDisposeCommentIfRelevant(n,e),this.m_statements.push(n)},t.prototype.processSetPropertyAction=function(e){var t=this.getObjVarName(e.actionInfo.ObjectPathId)+"."+$._toCamelLowerCase(e.actionInfo.Name)+" = "+this.buildArgumentsExpression(e.actionInfo.ArgumentInfo)+";";t=this.appendDisposeCommentIfRelevant(t,e),this.m_statements.push(t)},t.prototype.processTraceAction=function(e){var t="context.trace();";t=this.appendDisposeCommentIfRelevant(t,e),this.m_statements.push(t)},t.prototype.processEnsureUnchangedAction=function(e){var t=this.getObjVarName(e.actionInfo.ObjectPathId)+".ensureUnchanged("+JSON.stringify(e.actionInfo.ObjectState)+");";t=this.appendDisposeCommentIfRelevant(t,e),this.m_statements.push(t)},t.prototype.processUpdateAction=function(e){var t=this.getObjVarName(e.actionInfo.ObjectPathId)+".update("+JSON.stringify(e.actionInfo.ObjectState)+");";t=this.appendDisposeCommentIfRelevant(t,e),this.m_statements.push(t)},t.prototype.appendDisposeCommentIfRelevant=function(e,t){var n=this;if(this.m_showDispose){var r=t.actionInfo.L;if(r&&r.length>0)return e+" // And then dispose {"+r.map((function(e){return n.getObjVarName(e)})).join(", ")+"}"}return e},t.prototype.buildQueryExpression=function(e){if(e.actionInfo.QueryInfo){var t={};return t.select=e.actionInfo.QueryInfo.Select,t.expand=e.actionInfo.QueryInfo.Expand,t.skip=e.actionInfo.QueryInfo.Skip,t.top=e.actionInfo.QueryInfo.Top,void 0===t.top&&void 0===t.skip&&void 0===t.expand?void 0===t.select?"":JSON.stringify(t.select):JSON.stringify(t)}return""},t.prototype.buildObjectPathExpressionWithParent=function(e){return(5==e.objectPathInfo.ObjectPathType||3==e.objectPathInfo.ObjectPathType||4==e.objectPathInfo.ObjectPathType)&&e.objectPathInfo.ParentObjectPathId?this.getObjVarName(e.objectPathInfo.ParentObjectPathId)+"."+this.buildObjectPathExpression(e):this.buildObjectPathExpression(e)},t.prototype.buildObjectPathExpression=function(e){var t=this.buildObjectPathInfoExpression(e.objectPathInfo),n=e.originalObjectPathInfo;return n&&(t=t+" /* originally "+this.buildObjectPathInfoExpression(n)+" */"),t},t.prototype.buildObjectPathInfoExpression=function(e){switch(e.ObjectPathType){case 1:return"context."+this.m_globalObjName;case 5:return"getItem("+this.buildArgumentsExpression(e.ArgumentInfo)+")";case 3:return $._toCamelLowerCase(e.Name)+"("+this.buildArgumentsExpression(e.ArgumentInfo)+")";case 2:return e.Name+".newObject()";case 7:return"null";case 4:return $._toCamelLowerCase(e.Name);case 6:return"context."+this.m_globalObjName+"._getObjectByReferenceId("+JSON.stringify(e.Name)+")"}},t.prototype.buildArgumentsExpression=function(e){var t="";if(!e.Arguments||0===e.Arguments.length)return t;if(this.m_removePII)return void 0===e.Arguments[0]?t:"...";for(var n=0;n<e.Arguments.length;n++)n>0&&(t+=", "),t+=this.buildArgumentLiteral(e.Arguments[n],e.ReferencedObjectPathIds?e.ReferencedObjectPathIds[n]:null);return"undefined"===t&&(t=""),t},t.prototype.buildArgumentLiteral=function(e,t){return"number"==typeof e&&e===t?this.getObjVarName(t):JSON.stringify(e)},t.prototype.getObjVarNameBase=function(e){var t="v",n=this.m_referencedObjectPaths[e];if(n)switch(n.objectPathInfo.ObjectPathType){case 1:t=this.m_globalObjName;break;case 4:t=$._toCamelLowerCase(n.objectPathInfo.Name);break;case 3:var r=n.objectPathInfo.Name;r.length>3&&"Get"===r.substr(0,3)&&(r=r.substr(3)),t=$._toCamelLowerCase(r);break;case 5:var i=this.getObjVarNameBase(n.objectPathInfo.ParentObjectPathId);t="s"===i.charAt(i.length-1)?i.substr(0,i.length-1):i+"Item"}return t},t.prototype.getObjVarName=function(e){if(this.m_variableNameForObjectPathMap[e])return this.m_variableNameForObjectPathMap[e];var t=this.getObjVarNameBase(e);if(!this.m_variableNameToObjectPathMap[t])return this.m_variableNameForObjectPathMap[e]=t,this.m_variableNameToObjectPathMap[t]=e,t;for(var n=1;this.m_variableNameToObjectPathMap[t+n.toString()];)n++;return t+=n.toString(),this.m_variableNameForObjectPathMap[e]=t,this.m_variableNameToObjectPathMap[t]=e,t},t}(),X=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),t.cannotRegisterEvent="CannotRegisterEvent",t.connectionFailureWithStatus="ConnectionFailureWithStatus",t.connectionFailureWithDetails="ConnectionFailureWithDetails",t.propertyNotLoaded="PropertyNotLoaded",t.runMustReturnPromise="RunMustReturnPromise",t.moreInfoInnerError="MoreInfoInnerError",t.cannotApplyPropertyThroughSetMethod="CannotApplyPropertyThroughSetMethod",t.invalidOperationInCellEditMode="InvalidOperationInCellEditMode",t.objectIsUntracked="ObjectIsUntracked",t.customFunctionDefintionMissing="CustomFunctionDefintionMissing",t.customFunctionImplementationMissing="CustomFunctionImplementationMissing",t.customFunctionNameContainsBadChars="CustomFunctionNameContainsBadChars",t.customFunctionNameCannotSplit="CustomFunctionNameCannotSplit",t.customFunctionUnexpectedNumberOfEntriesInResultBatch="CustomFunctionUnexpectedNumberOfEntriesInResultBatch",t.customFunctionCancellationHandlerMissing="CustomFunctionCancellationHandlerMissing",t.customFunctionInvalidFunction="CustomFunctionInvalidFunction",t.customFunctionInvalidFunctionMapping="CustomFunctionInvalidFunctionMapping",t.customFunctionWindowMissing="CustomFunctionWindowMissing",t.customFunctionDefintionMissingOnWindow="CustomFunctionDefintionMissingOnWindow",t.pendingBatchInProgress="PendingBatchInProgress",t.notInsideBatch="NotInsideBatch",t.cannotUpdateReadOnlyProperty="CannotUpdateReadOnlyProperty",t}(T);e.ResourceStrings=X,u.addResourceStringValues({CannotRegisterEvent:"The event handler cannot be registered.",PropertyNotLoaded:"The property '{0}' is not available. Before reading the property's value, call the load method on the containing object and call \"context.sync()\" on the associated request context.",RunMustReturnPromise:'The batch function passed to the ".run" method didn\'t return a promise. The function must return a promise, so that any automatically-tracked objects can be released at the completion of the batch operation. Typically, you return a promise by returning the response from "context.sync()".',InvalidOrTimedOutSessionMessage:"Your Office Online session has expired or is invalid. To continue, refresh the page.",InvalidOperationInCellEditMode:"Excel is in cell-editing mode. Please exit the edit mode by pressing ENTER or TAB or selecting another cell, and then try again.",InvalidSheetName:"The request cannot be processed because the specified worksheet cannot be found. Please try again.",CustomFunctionDefintionMissing:"A property with the name '{0}' that represents the function's definition must exist on Excel.Script.CustomFunctions.",CustomFunctionDefintionMissingOnWindow:"A property with the name '{0}' that represents the function's definition must exist on the window object.",CustomFunctionImplementationMissing:"The property with the name '{0}' on Excel.Script.CustomFunctions that represents the function's definition must contain a 'call' property that implements the function.",CustomFunctionNameContainsBadChars:"The function name may only contain letters, digits, underscores, and periods.",CustomFunctionNameCannotSplit:"The function name must contain a non-empty namespace and a non-empty short name.",CustomFunctionUnexpectedNumberOfEntriesInResultBatch:"The batching function returned a number of results that doesn't match the number of parameter value sets that were passed into it.",CustomFunctionCancellationHandlerMissing:"The cancellation handler onCanceled is missing in the function. The handler must be present as the function is defined as cancelable.",CustomFunctionInvalidFunction:"The property with the name '{0}' that represents the function's definition is not a valid function.",CustomFunctionInvalidFunctionMapping:"The property with the name '{0}' on CustomFunctionMappings that represents the function's definition is not a valid function.",CustomFunctionWindowMissing:"The window object was not found.",PendingBatchInProgress:"There is a pending batch in progress. The batch method may not be called inside another batch, or simultaneously with another batch.",NotInsideBatch:"Operations may not be invoked outside of a batch method.",CannotUpdateReadOnlyProperty:"The property '{0}' is read-only and it cannot be updated.",ObjectIsUntracked:"The object is untracked."});var $=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return __extends(n,t),n.fixObjectPathIfNecessary=function(e,t){e&&e._objectPath&&t&&e._objectPath.updateUsingObjectData(t,e)},n.load=function(e,t){return e.context.load(e,t),e},n.loadAndSync=function(e,t){return e.context.load(e,t),e.context.sync().then((function(){return e}))},n.retrieve=function(t,r){var i=e._internalConfig.alwaysPolyfillClientObjectRetrieveMethod;i||(i=!n.isSetSupported("RichApiRuntime","1.1"));var o=new k(t,i);return t._retrieve(r,o),o},n.retrieveAndSync=function(e,t){var r=n.retrieve(e,t);return e.context.sync().then((function(){return r}))},n.toJson=function(e,t,r,i){var o={};for(var a in t){void 0!==(s=t[a])&&(o[a]=s)}for(var a in r){var s;void 0!==(s=r[a])&&(s[n.fieldName_isCollection]&&void 0!==s[n.fieldName_m__items]?o[a]=s.toJSON().items:o[a]=s.toJSON())}return i&&(o.items=i.map((function(e){return e.toJSON()}))),o},n.throwError=function(e,t,n){throw new i.RuntimeError({code:e,httpStatusCode:400,message:u._getResourceString(e,t),debugInfo:n?{errorLocation:n}:void 0})},n.createRuntimeError=function(e,t,n,r,o){return new i.RuntimeError({code:e,httpStatusCode:r,message:t,debugInfo:{errorLocation:n},data:o})},n.throwIfNotLoaded=function(e,t,r,i){if(!i&&u.isUndefined(t)&&e.charCodeAt(0)!=n.s_underscoreCharCode&&!n.s_suppressPropertyNotLoadedException)throw n.createPropertyNotLoadedException(r,e)},n._getPropertyValueWithoutCheckLoaded=function(e,t){n.s_suppressPropertyNotLoadedException=!0;try{return e[t]}finally{n.s_suppressPropertyNotLoadedException=!1}},n.createPropertyNotLoadedException=function(e,t){return new i.RuntimeError({code:D.propertyNotLoaded,httpStatusCode:400,message:u._getResourceString(X.propertyNotLoaded,t),debugInfo:e?{errorLocation:e+"."+t}:void 0})},n.createCannotUpdateReadOnlyPropertyException=function(e,t){return new i.RuntimeError({code:D.cannotUpdateReadOnlyProperty,httpStatusCode:400,message:u._getResourceString(X.cannotUpdateReadOnlyProperty,t),debugInfo:e?{errorLocation:e+"."+t}:void 0})},n.promisify=function(t){return new e.Promise((function(e,n){t((function(t){"failed"==t.status?n(t.error):e(t.value)}))}))},n._addActionResultHandler=function(e,t,n){e.context._pendingRequest.addActionResultHandler(t,n)},n._handleNavigationPropertyResults=function(e,t,n){for(var r=0;r<n.length-1;r+=2)u.isUndefined(t[n[r+1]])||e[n[r]]._handleResult(t[n[r+1]])},n._fixupApiFlags=function(e){return"boolean"==typeof e&&(e=e?1:0),e},n.definePropertyThrowUnloadedException=function(e,t,r){Object.defineProperty(e,r,{configurable:!0,enumerable:!0,get:function(){throw n.createPropertyNotLoadedException(t,r)},set:function(){throw n.createCannotUpdateReadOnlyPropertyException(t,r)}})},n.defineReadOnlyPropertyWithValue=function(e,t,r){Object.defineProperty(e,t,{configurable:!0,enumerable:!0,get:function(){return r},set:function(){throw n.createCannotUpdateReadOnlyPropertyException(null,t)}})},n.processRetrieveResult=function(e,t,r,i){if(!u.isNullOrUndefined(t))if(i){var o=t[j.itemsLowerCase];if(Array.isArray(o)){for(var a=[],s=0;s<o.length;s++){var c=i(o[s],s),l={};l[j.proxy]=c,c._handleRetrieveResult(o[s],l),a.push(l)}n.defineReadOnlyPropertyWithValue(r,j.itemsLowerCase,a)}}else{var f=e[j.scalarPropertyNames],d=e[j.navigationPropertyNames],p=e[j.className];if(f)for(s=0;s<f.length;s++){var m=t[g=f[s]];u.isUndefined(m)?n.definePropertyThrowUnloadedException(r,p,g):n.defineReadOnlyPropertyWithValue(r,g,m)}if(d)for(s=0;s<d.length;s++){var g;m=t[g=d[s]];if(u.isUndefined(m))n.definePropertyThrowUnloadedException(r,p,g);else{var h=e[g],y={};h._handleRetrieveResult(m,y),y[j.proxy]=h,Array.isArray(y[j.itemsLowerCase])&&(y=y[j.itemsLowerCase]),n.defineReadOnlyPropertyWithValue(r,g,y)}}}},n.setMockData=function(e,t,r,i){if(u.isNullOrUndefined(t))e._handleResult(t);else{if(e[j.scalarPropertyOriginalNames]){for(var o={},a=e[j.scalarPropertyOriginalNames],s=e[j.scalarPropertyNames],c=0;c<s.length;c++)void 0!==t[s[c]]&&(o[a[c]]=t[s[c]]);e._handleResult(o)}if(e[j.navigationPropertyNames]){var l=e[j.navigationPropertyNames];for(c=0;c<l.length;c++)if(void 0!==t[l[c]]){var f=e[l[c]];f.setMockData&&f.setMockData(t[l[c]])}}if(e[j.isCollection]&&r){var d=Array.isArray(t)?t:t[j.itemsLowerCase];if(Array.isArray(d)){var p=[];for(c=0;c<d.length;c++){var m=r(d,c);n.setMockData(m,d[c]),p.push(m)}i(p)}}}},n.applyMixin=function(e,t){Object.getOwnPropertyNames(t.prototype).forEach((function(n){"constructor"!==n&&Object.defineProperty(e.prototype,n,Object.getOwnPropertyDescriptor(t.prototype,n))}))},n.ensureTypeInitialized=function(e){var t=new H;new e(t,J.createNewObjectObjectPath(t,"Temp",!1,0))},n.fieldName_m__items="m__items",n.fieldName_isCollection="_isCollection",n._synchronousCleanup=!1,n.s_underscoreCharCode="_".charCodeAt(0),n.s_suppressPropertyNotLoadedException=!1,n}(w);e.Utility=$;var Y=function(){function e(){}return e.invokeMethod=function(e,t,n,r,i,o){var a=F.createMethodAction(e.context,e,t,n,r,i),s=new C(o);return $._addActionResultHandler(e,a,s),s},e.invokeEnsureUnchanged=function(e,t){F.createEnsureUnchangedAction(e.context,e,t)},e.invokeSetProperty=function(e,t,n,r){F.createSetPropertyAction(e.context,e,t,n,r)},e.createRootServiceObject=function(e,t){return new e(t,J.createGlobalObjectObjectPath(t))},e.createObjectFromReferenceId=function(e,t,n){return new e(t,J.createReferenceIdObjectPath(t,n))},e.createTopLevelServiceObject=function(e,t,n,r,i){return new e(t,J.createNewObjectObjectPath(t,n,r,i))},e.createPropertyObject=function(e,t,n,r,i){var o=J.createPropertyObjectPath(t.context,t,n,r,!1,i);return new e(t.context,o)},e.createIndexerObject=function(e,t,n){var r=J.createIndexerObjectPath(t.context,t,n);return new e(t.context,r)},e.createMethodObject=function(e,t,n,r,i,o,a,s,c){var l=J.createMethodObjectPath(t.context,t,n,r,i,o,a,s,c);return new e(t.context,l)},e.createChildItemObject=function(e,t,n,r,i){var o=J.createChildItemObjectPathUsingIndexerOrGetItemAt(t,n.context,n,r,i);return new e(n.context,o)},e}();e.BatchApiHelper=Y;var Z=function(){function t(e){if(this.m_namespaceMap={},this.m_namespace=e.metadata.name,this.m_targetNamespaceObject=e.targetNamespaceObject,this.m_namespaceMap[this.m_namespace]=e.targetNamespaceObject,e.namespaceMap)for(var t in e.namespaceMap)this.m_namespaceMap[t]=e.namespaceMap[t];this.m_defaultApiSetName=e.metadata.defaultApiSetName,this.m_hostName=e.metadata.hostName;var n=e.metadata;if(n.enumTypes)for(var r=0;r<n.enumTypes.length;r++)this.buildEnumType(n.enumTypes[r]);if(n.apiSets){for(r=0;r<n.apiSets.length;r++){var i=n.apiSets[r];Array.isArray(i)&&(n.apiSets[r]={version:i[0],name:i[1]||this.m_defaultApiSetName})}this.m_apiSets=n.apiSets}if(this.m_strings=n.strings,n.clientObjectTypes)for(r=0;r<n.clientObjectTypes.length;r++){i=n.clientObjectTypes[r];Array.isArray(i)&&(this.ensureArraySize(i,11),n.clientObjectTypes[r]={name:this.getString(i[0]),behaviorFlags:i[1],collectionPropertyPath:this.getString(i[6]),newObjectServerTypeFullName:this.getString(i[9]),newObjectApiFlags:i[10],childItemTypeFullName:this.getString(i[7]),scalarProperties:i[2],navigationProperties:i[3],scalarMethods:i[4],navigationMethods:i[5],events:i[8]}),this.buildClientObjectType(n.clientObjectTypes[r],e.fullyInitialize)}}return t.prototype.ensureArraySize=function(e,t){for(var n=t-e.length;n>0;)e.push(0),n--},t.prototype.getString=function(e){return"number"==typeof e?e>0?this.m_strings[e-1]:null:e},t.prototype.buildEnumType=function(e){var t;if(Array.isArray(e)){(t={name:e[0],fields:e[2]}).fields||(t.fields={});var n=e[1];if(Array.isArray(n))for(var r=0;r<n.length;r++)t.fields[n[r]]=this.toSimpleCamelUpperCase(n[r])}else t=e;this.m_targetNamespaceObject[t.name]=t.fields},t.prototype.buildClientObjectType=function(n,r){var i=this,o=function(t,r){M.apply(this,arguments),i.m_targetNamespaceObject[n.name]._typeInited||(i.buildPrototype(i.m_targetNamespaceObject[n.name],n),i.m_targetNamespaceObject[n.name]._typeInited=!0),e._internalConfig.appendTypeNameToObjectPathInfo&&this._objectPath&&this._objectPath.objectPathInfo&&this._className&&(this._objectPath.objectPathInfo.T=this._className)};(this.m_targetNamespaceObject[n.name]=o,this.extendsType(o,M),this.buildNewObject(o,n),0!=(2&n.behaviorFlags)&&(o.prototype._KeepReference=function(){Y.invokeMethod(this,"_KeepReference",1,[],0,0)}),0!=(32&n.behaviorFlags))&&this.getFunction(t.CustomizationCodeNamespace+"."+n.name+"_StaticCustomize").call(null,o);r&&(this.buildPrototype(o,n),o._typeInited=!0)},t.prototype.extendsType=function(e,t){function n(){this.constructor=e}e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)},t.prototype.findObjectUnderPath=function(t,n,r){for(var i=t,o=r;o<n.length;o++){if("object"!=typeof i)throw new e.Error("Cannot find "+n.join("."));i=i[n[o]]}return i},t.prototype.getFunction=function(t){var n=this.resolveObjectByFullName(t);if("function"!=typeof n)throw new e.Error("Cannot find function or type: "+t);return n},t.prototype.resolveObjectByFullName=function(e){var t=e.split(".");if(1===t.length)return this.m_targetNamespaceObject[t[0]];var n=t[0];return n===this.m_namespace?this.findObjectUnderPath(this.m_targetNamespaceObject,t,1):this.m_namespaceMap[n]?this.findObjectUnderPath(this.m_namespaceMap[n],t,1):this.findObjectUnderPath(this.m_targetNamespaceObject,t,0)},t.prototype.evaluateSimpleExpression=function(t,n){if($.isNullOrUndefined(t))return null;var r=t.split(".");if(3===r.length&&"OfficeExtension"===r[0]&&"Constants"===r[1])return j[r[2]];if("this"===r[0]){for(var i=n,o=1;o<r.length;o++)i="toString()"==r[o]?i.toString():"()"===r[o].substr(r[o].length-2)?i[r[o].substr(0,r[o].length-2)]():i[r[o]];return i}throw new e.Error("Cannot evaluate: "+t)},t.prototype.evaluateEventTargetId=function(e,t){return $.isNullOrEmptyString(e)?"":this.evaluateSimpleExpression(e,t)},t.prototype.isAllDigits=function(e){for(var t="0".charCodeAt(0),n="9".charCodeAt(0),r=0;r<e.length;r++)if(e.charCodeAt(r)<t||e.charCodeAt(r)>n)return!1;return!0},t.prototype.evaluateEventType=function(t){if($.isNullOrEmptyString(t))return 0;if(this.isAllDigits(t))return parseInt(t);var n=this.resolveObjectByFullName(t);if("number"!=typeof n)throw new e.Error("Invalid event type: "+t);return n},t.prototype.buildPrototype=function(e,t){this.buildScalarProperties(e,t),this.buildNavigationProperties(e,t),this.buildScalarMethods(e,t),this.buildNavigationMethods(e,t),this.buildEvents(e,t),this.buildHandleResult(e,t),this.buildHandleIdResult(e,t),this.buildHandleRetrieveResult(e,t),this.buildLoad(e,t),this.buildRetrieve(e,t),this.buildSetMockData(e,t),this.buildEnsureUnchanged(e,t),this.buildUpdate(e,t),this.buildSet(e,t),this.buildToJSON(e,t),this.buildItems(e,t),this.buildTypeMetadataInfo(e,t),this.buildTrackUntrack(e,t),this.buildMixin(e,t)},t.prototype.toSimpleCamelUpperCase=function(e){return e.substr(0,1).toUpperCase()+e.substr(1)},t.prototype.ensureOriginalName=function(e){null===e.originalName&&(e.originalName=this.toSimpleCamelUpperCase(e.name))},t.prototype.getFieldName=function(e){return"m_"+e.name},t.prototype.throwIfApiNotSupported=function(e,t){if(this.m_apiSets&&t.apiSetInfoOrdinal>0){var n=this.m_apiSets[t.apiSetInfoOrdinal-1];n&&$.throwIfApiNotSupported(e.name+"."+t.name,n.name,n.version,this.m_hostName)}},t.prototype.buildScalarProperties=function(e,t){if(Array.isArray(t.scalarProperties))for(var n=0;n<t.scalarProperties.length;n++){var r=t.scalarProperties[n];Array.isArray(r)&&(this.ensureArraySize(r,6),t.scalarProperties[n]={name:this.getString(r[0]),behaviorFlags:r[1],apiSetInfoOrdinal:r[2],originalName:this.getString(r[3]),setMethodApiFlags:r[4],undoableApiSetInfoOrdinal:r[5]}),this.buildScalarProperty(e,t,t.scalarProperties[n])}},t.prototype.calculateApiFlags=function(e,t){if(t>0){var n=this.m_apiSets[t-1];n&&(e=w.calculateApiFlags(e,n.name,n.version))}return e},t.prototype.buildScalarProperty=function(e,n,r){this.ensureOriginalName(r);var i=this,o=this.getFieldName(r),a={get:function(){return $.throwIfNotLoaded(r.name,this[o],n.name,this._isNull),i.throwIfApiNotSupported(n,r),this[o]},enumerable:!0,configurable:!0};0==(2&r.behaviorFlags)&&(a.set=function(e){if(4&r.behaviorFlags&&i.getFunction(t.CustomizationCodeNamespace+"."+n.name+"_"+r.originalName+"_Set").call(this,this,e).handled)return;this[o]=e;var a=i.calculateApiFlags(r.setMethodApiFlags,r.undoableApiSetInfoOrdinal);Y.invokeSetProperty(this,r.originalName,e,a)}),Object.defineProperty(e.prototype,r.name,a)},t.prototype.buildNavigationProperties=function(e,t){if(Array.isArray(t.navigationProperties))for(var n=0;n<t.navigationProperties.length;n++){var r=t.navigationProperties[n];Array.isArray(r)&&(this.ensureArraySize(r,8),t.navigationProperties[n]={name:this.getString(r[0]),behaviorFlags:r[2],apiSetInfoOrdinal:r[3],originalName:this.getString(r[4]),getMethodApiFlags:r[5],setMethodApiFlags:r[6],propertyTypeFullName:this.getString(r[1]),undoableApiSetInfoOrdinal:r[7]}),this.buildNavigationProperty(e,t,t.navigationProperties[n])}},t.prototype.buildNavigationProperty=function(e,n,r){this.ensureOriginalName(r);var i=this,o=this.getFieldName(r),a={get:function(){(this[i.getFieldName(r)]||(i.throwIfApiNotSupported(n,r),this[o]=Y.createPropertyObject(i.getFunction(r.propertyTypeFullName),this,r.originalName,0!=(16&r.behaviorFlags),r.getMethodApiFlags)),64&r.behaviorFlags)&&i.getFunction(t.CustomizationCodeNamespace+"."+n.name+"_"+r.originalName+"_Get").call(this,this,this[o]);return this[o]},enumerable:!0,configurable:!0};0==(2&r.behaviorFlags)&&(a.set=function(e){if(4&r.behaviorFlags&&i.getFunction(t.CustomizationCodeNamespace+"."+n.name+"_"+r.originalName+"_Set").call(this,this,e).handled)return;this[o]=e;var a=i.calculateApiFlags(r.setMethodApiFlags,r.undoableApiSetInfoOrdinal);Y.invokeSetProperty(this,r.originalName,e,a)}),Object.defineProperty(e.prototype,r.name,a)},t.prototype.buildScalarMethods=function(e,t){if(Array.isArray(t.scalarMethods))for(var n=0;n<t.scalarMethods.length;n++){var r=t.scalarMethods[n];Array.isArray(r)&&(this.ensureArraySize(r,7),t.scalarMethods[n]={name:this.getString(r[0]),behaviorFlags:r[2],apiSetInfoOrdinal:r[3],originalName:this.getString(r[5]),apiFlags:r[4],parameterCount:r[1],undoableApiSetInfoOrdinal:r[6]}),this.buildScalarMethod(e,t,t.scalarMethods[n])}},t.prototype.buildScalarMethod=function(e,n,r){this.ensureOriginalName(r);var i=this;e.prototype[r.name]=function(){var e=[];if(64&r.behaviorFlags&&r.parameterCount>0){for(var o=0;o<r.parameterCount-1;o++)e.push(arguments[o]);var a=[];for(o=r.parameterCount-1;o<arguments.length;o++)a.push(arguments[o]);e.push(a)}else for(o=0;o<arguments.length;o++)e.push(arguments[o]);if(1&r.behaviorFlags){var s=i.getFunction(t.CustomizationCodeNamespace+"."+n.name+"_"+r.originalName),c=[this];for(o=0;o<e.length;o++)c.push(e[o]);var l=s.apply(this,c),u=l.handled,f=l.result;if(u)return f}i.throwIfApiNotSupported(n,r);var d=0;32&r.behaviorFlags&&(d=1);var p=0;2&r.behaviorFlags&&(p=1);var m=i.calculateApiFlags(r.apiFlags,r.undoableApiSetInfoOrdinal);return Y.invokeMethod(this,r.originalName,p,e,m,d)}},t.prototype.buildNavigationMethods=function(e,t){if(Array.isArray(t.navigationMethods))for(var n=0;n<t.navigationMethods.length;n++){var r=t.navigationMethods[n];Array.isArray(r)&&(this.ensureArraySize(r,9),t.navigationMethods[n]={name:this.getString(r[0]),behaviorFlags:r[3],apiSetInfoOrdinal:r[4],originalName:this.getString(r[6]),apiFlags:r[5],parameterCount:r[2],returnTypeFullName:this.getString(r[1]),returnObjectGetByIdMethodName:this.getString(r[7]),undoableApiSetInfoOrdinal:r[8]}),this.buildNavigationMethod(e,t,t.navigationMethods[n])}},t.prototype.buildNavigationMethod=function(e,n,r){this.ensureOriginalName(r);var i=this;e.prototype[r.name]=function(){var e=[];if(64&r.behaviorFlags&&r.parameterCount>0){for(var o=0;o<r.parameterCount-1;o++)e.push(arguments[o]);var a=[];for(o=r.parameterCount-1;o<arguments.length;o++)a.push(arguments[o]);e.push(a)}else for(o=0;o<arguments.length;o++)e.push(arguments[o]);if(1&r.behaviorFlags){var s=i.getFunction(t.CustomizationCodeNamespace+"."+n.name+"_"+r.originalName),c=[this];for(o=0;o<e.length;o++)c.push(e[o]);var l=s.apply(this,c),u=l.handled,f=l.result;if(u)return f}if(i.throwIfApiNotSupported(n,r),0!=(16&r.behaviorFlags))return Y.createIndexerObject(i.getFunction(r.returnTypeFullName),this,e);var d=0;2&r.behaviorFlags&&(d=1);var p=i.calculateApiFlags(r.apiFlags,r.undoableApiSetInfoOrdinal);return Y.createMethodObject(i.getFunction(r.returnTypeFullName),this,r.originalName,d,e,0!=(4&r.behaviorFlags),0!=(8&r.behaviorFlags),r.returnObjectGetByIdMethodName,p)}},t.prototype.buildHandleResult=function(e,n){var r=this;e.prototype._handleResult=function(e){if(M.prototype._handleResult.call(this,e),!$.isNullOrUndefined(e)){if($.fixObjectPathIfNecessary(this,e),8&n.behaviorFlags)r.getFunction(t.CustomizationCodeNamespace+"."+n.name+"_HandleResult").call(this,this,e);if(n.scalarProperties)for(var i=0;i<n.scalarProperties.length;i++)$.isUndefined(e[n.scalarProperties[i].originalName])||(0!=(8&n.scalarProperties[i].behaviorFlags)?this[r.getFieldName(n.scalarProperties[i])]=$.adjustToDateTime(e[n.scalarProperties[i].originalName]):this[r.getFieldName(n.scalarProperties[i])]=e[n.scalarProperties[i].originalName]);if(n.navigationProperties){for(var o=[],a=0;a<n.navigationProperties.length;a++)o.push(n.navigationProperties[a].name),o.push(n.navigationProperties[a].originalName);$._handleNavigationPropertyResults(this,e,o)}if(0!=(1&n.behaviorFlags)){var s=r.hasIndexMethod(n);if(!$.isNullOrUndefined(e[j.items])){this.m__items=[];for(var c=e[j.items],l=r.getFunction(n.childItemTypeFullName),u=0;u<c.length;u++){var f=Y.createChildItemObject(l,s,this,c[u],u);f._handleResult(c[u]),this.m__items.push(f)}}}}}},t.prototype.buildHandleRetrieveResult=function(e,t){var n=this;e.prototype._handleRetrieveResult=function(e,r){if(M.prototype._handleRetrieveResult.call(this,e,r),!$.isNullOrUndefined(e)){if(t.scalarProperties)for(var i=0;i<t.scalarProperties.length;i++)8&t.scalarProperties[i].behaviorFlags&&($.isNullOrUndefined(e[t.scalarProperties[i].name])||(e[t.scalarProperties[i].name]=$.adjustToDateTime(e[t.scalarProperties[i].name])));if(1&t.behaviorFlags){var o=n.hasIndexMethod(t),a=n.getFunction(t.childItemTypeFullName),s=this;$.processRetrieveResult(s,e,r,(function(e,t){return Y.createChildItemObject(a,o,s,e,t)}))}else $.processRetrieveResult(this,e,r)}}},t.prototype.buildHandleIdResult=function(e,n){var r=this;e.prototype._handleIdResult=function(e){if(M.prototype._handleIdResult.call(this,e),!$.isNullOrUndefined(e)){if(16&n.behaviorFlags)r.getFunction(t.CustomizationCodeNamespace+"."+n.name+"_HandleIdResult").call(this,this,e);if(n.scalarProperties)for(var i=0;i<n.scalarProperties.length;i++){var o=n.scalarProperties[i].originalName;"Id"!==o&&"_Id"!==o&&"_ReferenceId"!==o||$.isNullOrUndefined(e[n.scalarProperties[i].originalName])||(this[r.getFieldName(n.scalarProperties[i])]=e[n.scalarProperties[i].originalName])}}}},t.prototype.buildLoad=function(e,t){e.prototype.load=function(e){return $.load(this,e)}},t.prototype.buildRetrieve=function(e,t){e.prototype.retrieve=function(e){return $.retrieve(this,e)}},t.prototype.buildNewObject=function(e,t){$.isNullOrEmptyString(t.newObjectServerTypeFullName)||(e.newObject=function(n){return Y.createTopLevelServiceObject(e,n,t.newObjectServerTypeFullName,0!=(1&t.behaviorFlags),t.newObjectApiFlags)})},t.prototype.buildSetMockData=function(e,t){var n=this;if(1&t.behaviorFlags){var r=n.hasIndexMethod(t);e.prototype.setMockData=function(e){var i=this;$.setMockData(i,e,(function(e,o){return Y.createChildItemObject(n.getFunction(t.childItemTypeFullName),r,i,e,o)}),(function(e){i.m__items=e}))}}else e.prototype.setMockData=function(e){$.setMockData(this,e)}},t.prototype.buildEnsureUnchanged=function(e,t){e.prototype.ensureUnchanged=function(e){Y.invokeEnsureUnchanged(this,e)}},t.prototype.buildUpdate=function(e,t){e.prototype.update=function(e){this._recursivelyUpdate(e)}},t.prototype.buildSet=function(e,t){if(0==(1&t.behaviorFlags)){var n=[],r=[];if(t.scalarProperties)for(var i=0;i<t.scalarProperties.length;i++)0==(2&t.scalarProperties[i].behaviorFlags)&&0!=(1&t.scalarProperties[i].behaviorFlags)?r.push(t.scalarProperties[i].name):n.push(t.scalarProperties[i].name);var o=[];if(t.navigationProperties)for(i=0;i<t.navigationProperties.length;i++)0!=(16&t.navigationProperties[i].behaviorFlags)||0==(1&t.navigationProperties[i].behaviorFlags)||0==(32&t.navigationProperties[i].behaviorFlags)?n.push(t.navigationProperties[i].name):o.push(t.navigationProperties[i].name);0===o.length&&0===r.length||(e.prototype.set=function(e,t){this._recursivelySet(e,t,r,o,n)})}},t.prototype.buildItems=function(e,t){0!=(1&t.behaviorFlags)&&Object.defineProperty(e.prototype,"items",{get:function(){return $.throwIfNotLoaded("items",this.m__items,t.name,this._isNull),this.m__items},enumerable:!0,configurable:!0})},t.prototype.buildToJSON=function(e,t){var n=this;0==(1&t.behaviorFlags)?e.prototype.toJSON=function(){var e={};if(t.scalarProperties)for(var r=0;r<t.scalarProperties.length;r++)0!=(1&t.scalarProperties[r].behaviorFlags)&&(e[t.scalarProperties[r].name]=this[n.getFieldName(t.scalarProperties[r])]);var i={};if(t.navigationProperties)for(r=0;r<t.navigationProperties.length;r++)0!=(1&t.navigationProperties[r].behaviorFlags)&&(i[t.navigationProperties[r].name]=this[n.getFieldName(t.navigationProperties[r])]);return $.toJson(this,e,i)}:e.prototype.toJSON=function(){return $.toJson(this,{},{},this.m__items)}},t.prototype.buildTypeMetadataInfo=function(e,t){Object.defineProperty(e.prototype,"_className",{get:function(){return t.name},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"_isCollection",{get:function(){return 0!=(1&t.behaviorFlags)},enumerable:!0,configurable:!0}),$.isNullOrEmptyString(t.collectionPropertyPath)||Object.defineProperty(e.prototype,"_collectionPropertyPath",{get:function(){return t.collectionPropertyPath},enumerable:!0,configurable:!0}),t.scalarProperties&&t.scalarProperties.length>0&&(Object.defineProperty(e.prototype,"_scalarPropertyNames",{get:function(){return this.m__scalarPropertyNames||(this.m__scalarPropertyNames=t.scalarProperties.map((function(e){return e.name}))),this.m__scalarPropertyNames},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"_scalarPropertyOriginalNames",{get:function(){return this.m__scalarPropertyOriginalNames||(this.m__scalarPropertyOriginalNames=t.scalarProperties.map((function(e){return e.originalName}))),this.m__scalarPropertyOriginalNames},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"_scalarPropertyUpdateable",{get:function(){return this.m__scalarPropertyUpdateable||(this.m__scalarPropertyUpdateable=t.scalarProperties.map((function(e){return 0==(2&e.behaviorFlags)}))),this.m__scalarPropertyUpdateable},enumerable:!0,configurable:!0})),t.navigationProperties&&t.navigationProperties.length>0&&Object.defineProperty(e.prototype,"_navigationPropertyNames",{get:function(){return this.m__navigationPropertyNames||(this.m__navigationPropertyNames=t.navigationProperties.map((function(e){return e.name}))),this.m__navigationPropertyNames},enumerable:!0,configurable:!0})},t.prototype.buildTrackUntrack=function(e,t){2&t.behaviorFlags&&(e.prototype.track=function(){return this.context.trackedObjects.add(this),this},e.prototype.untrack=function(){return this.context.trackedObjects.remove(this),this})},t.prototype.buildMixin=function(e,t){if(4&t.behaviorFlags){var n=this.getFunction(t.name+"Custom");$.applyMixin(e,n)}},t.prototype.getOnEventName=function(e){return"_"===e[0]?"_on"+e.substr(1):"on"+e},t.prototype.buildEvents=function(e,t){if(t.events)for(var n=0;n<t.events.length;n++){var r=t.events[n];Array.isArray(r)&&(this.ensureArraySize(r,7),t.events[n]={name:this.getString(r[0]),behaviorFlags:r[1],apiSetInfoOrdinal:r[2],typeExpression:this.getString(r[3]),targetIdExpression:this.getString(r[4]),register:this.getString(r[5]),unregister:this.getString(r[6])}),this.buildEvent(e,t,t.events[n])}},t.prototype.buildEvent=function(e,t,n){1&n.behaviorFlags?this.buildV0Event(e,t,n):this.buildV2Event(e,t,n)},t.prototype.buildV2Event=function(e,n,r){var i=this,o=this.getOnEventName(r.name),a=this.getFieldName(r);Object.defineProperty(e.prototype,o,{get:function(){if(!this[a]){i.throwIfApiNotSupported(n,r);var e=this,o=null;"null"!==r.register&&(o=this[r.register].bind(this));var s=null;"null"!==r.unregister&&(s=this[r.unregister].bind(this));var c=null;2&r.behaviorFlags&&(c=i.getFunction(t.CustomizationCodeNamespace+"."+n.name+"_"+r.name+"_EventArgsTransform"));var l=i.evaluateEventType(r.typeExpression);this[a]=new V(this.context,this,r.name,{eventType:l,getTargetIdFunc:function(){return i.evaluateEventTargetId(r.targetIdExpression,e)},registerFunc:o,unregisterFunc:s,eventArgsTransformFunc:function(t){return c&&(t=c.call(e,e,t)),$._createPromiseFromResult(t)}})}return this[a]},enumerable:!0,configurable:!0})},t.prototype.buildV0Event=function(e,n,r){var i=this,o=this.getOnEventName(r.name),a=this.getFieldName(r);Object.defineProperty(e.prototype,o,{get:function(){if(!this[a]){i.throwIfApiNotSupported(n,r);var e=this,o=null;if($.isNullOrEmptyString(r.register)){var s=i.evaluateEventType(r.typeExpression);o=function(t){var n=i.evaluateEventTargetId(r.targetIdExpression,e);return e.context.eventRegistration.register(s,n,t)}}else if("null"!==r.register){var c=i.getFunction(r.register);o=function(t){return c.call(e,e,t)}}var l=null;if($.isNullOrEmptyString(r.unregister)){var u=i.evaluateEventType(r.typeExpression);l=function(t){var n=i.evaluateEventTargetId(r.targetIdExpression,e);return e.context.eventRegistration.unregister(u,n,t)}}else if("null"!==r.unregister){var f=i.getFunction(r.unregister);l=function(t){return f.call(e,e,t)}}var d=null;2&r.behaviorFlags&&(d=i.getFunction(t.CustomizationCodeNamespace+"."+n.name+"_"+r.name+"_EventArgsTransform"));this[a]=new L(this.context,this,r.name,{registerFunc:o,unregisterFunc:l,eventArgsTransformFunc:function(t){return d&&(t=d.call(e,e,t)),$._createPromiseFromResult(t)}})}return this[a]},enumerable:!0,configurable:!0})},t.prototype.hasIndexMethod=function(e){var t=!1;if(e.navigationMethods)for(var n=0;n<e.navigationMethods.length;n++)if(0!=(16&e.navigationMethods[n].behaviorFlags)){t=!0;break}return t},t.CustomizationCodeNamespace="_CC",t}();e.LibraryBuilder=Z}(OfficeExtension||(OfficeExtension={})),function(e){var t;!function(t){t.getPromiseType=function(){if("undefined"!=typeof Promise)return Promise;if(void 0!==Office&&Office.Promise)return Office.Promise;throw new e.Error("No Promise implementation found")}}(t||(t={})),Object.defineProperty(e,"Promise",{get:function(){return t.getPromiseType()},enumerable:!0,configurable:!0})}(OfficeExtension||(OfficeExtension={}));try{if("undefined"!=typeof OfficePlatformGlobal&&void 0!==OfficePlatformGlobal.ReactNativeReka){var RichApiBridgeImpl=function(){function e(){}return e.prototype.sendMessageToHost=function(e){OfficePlatformGlobal.ReactNativeReka.RekaInstance.InvokeNative("RichApiDataService","ProcessMessageToHost",e)},e}(),RichApiBridge_1=new RichApiBridgeImpl,RichApiDataService_1=function(){function e(){}return e.prototype.Invoke=function(e,t){"ProcessMessageFromHost"===e&&RichApiBridge_1.onMessageFromHost&&RichApiBridge_1.onMessageFromHost(t)},e}();OfficePlatformGlobal.ReactNativeReka.initReka(),OfficePlatformGlobal.ReactNativeReka.RekaInstance.RegisterService("RichApiDataService",(function(){return new RichApiDataService_1})),OfficeExtension.HostBridge.init(RichApiBridge_1),OfficeExtension.HostBridgeSession.getInstanceIfHostBridgeInited()}}catch(e){}var oteljs;__assign=this&&this.__assign||function(){return(__assign=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};!function(e){function t(e,t,n,r){return{name:e,dataType:t,value:n,classification:r||4}}e.makeBooleanDataField=function(e,n,r){return t(e,1,n,r)},e.makeInt64DataField=function(e,n,r){return t(e,2,n,r)},e.makeDoubleDataField=function(e,n,r){return t(e,3,n,r)},e.makeStringDataField=function(e,n,r){return t(e,0,n,r)},e.makeGuidDataField=function(e,n,r){return t(e,4,n,r)}}(oteljs||(oteljs={})),function(e){!function(e){e[e.EssentialServiceMetadata=1]="EssentialServiceMetadata",e[e.AccountData=2]="AccountData",e[e.SystemMetadata=4]="SystemMetadata",e[e.OrganizationIdentifiableInformation=8]="OrganizationIdentifiableInformation",e[e.EndUserIdentifiableInformation=16]="EndUserIdentifiableInformation",e[e.CustomerContent=32]="CustomerContent",e[e.AccessControl=64]="AccessControl",e[e.PublicNonPersonalData=128]="PublicNonPersonalData",e[e.EndUserPseudonymousInformation=256]="EndUserPseudonymousInformation",e[e.PublicPersonalData=512]="PublicPersonalData",e[e.SupportData=1024]="SupportData",e[e.DirectMeasurementData=2048]="DirectMeasurementData",e[e.Everything=65535]="Everything"}(e.DataClassification||(e.DataClassification={})),function(e){e[e.String=0]="String",e[e.Boolean=1]="Boolean",e[e.Int64=2]="Int64",e[e.Double=3]="Double",e[e.Guid=4]="Guid"}(e.DataFieldType||(e.DataFieldType={})),function(e){e[e.NotSet=0]="NotSet",e[e.Measure=1]="Measure",e[e.Diagnostics=2]="Diagnostics",e[e.CriticalBusinessImpact=191]="CriticalBusinessImpact",e[e.CriticalCensus=192]="CriticalCensus",e[e.CriticalExperimentation=193]="CriticalExperimentation",e[e.CriticalUsage=194]="CriticalUsage"}(e.SamplingPolicy||(e.SamplingPolicy={})),function(e){e[e.NotSet=0]="NotSet",e[e.Normal=1]="Normal",e[e.High=2]="High"}(e.PersistencePriority||(e.PersistencePriority={})),function(e){e[e.NotSet=0]="NotSet",e[e.Normal=1]="Normal",e[e.High=2]="High"}(e.CostPriority||(e.CostPriority={})),function(e){e[e.NotSet=0]="NotSet",e[e.SoftwareSetup=1]="SoftwareSetup",e[e.ProductServiceUsage=2]="ProductServiceUsage",e[e.ProductServicePerformance=4]="ProductServicePerformance",e[e.DeviceConfiguration=8]="DeviceConfiguration",e[e.InkingTypingSpeech=16]="InkingTypingSpeech"}(e.DataCategories||(e.DataCategories={})),function(e){e[e.ReservedDoNotUse=0]="ReservedDoNotUse",e[e.Required=10]="Required",e[e.BasicEvent=10]="BasicEvent",e[e.Optional=100]="Optional",e[e.FullEvent=100]="FullEvent",e[e.RequiredServiceData=110]="RequiredServiceData",e[e.NecessaryServiceDataEvent=110]="NecessaryServiceDataEvent",e[e.RequiredServiceDataForEssentialServices=120]="RequiredServiceDataForEssentialServices",e[e.AlwaysOnNecessaryServiceDataEvent=120]="AlwaysOnNecessaryServiceDataEvent"}(e.DiagnosticLevel||(e.DiagnosticLevel={})),function(e){e[e.None=0]="None",e[e.MocaAddIn=1]="MocaAddIn"}(e.CustomerContentType||(e.CustomerContentType={})),function(e){e[e.Error=0]="Error",e[e.Warning=1]="Warning",e[e.Info=2]="Info",e[e.Verbose=3]="Verbose"}(e.LogLevel||(e.LogLevel={})),function(e){e[e.Core=0]="Core",e[e.Sink=1]="Sink",e[e.Transport=2]="Transport"}(e.Category||(e.Category={})),function(e){e[e.Hourly=1]="Hourly",e[e.Daily=2]="Daily"}(e.DnmInterval||(e.DnmInterval={})),function(e){e[e.ReleaseAudienceGroup=1]="ReleaseAudienceGroup",e[e.WacRing=2]="WacRing",e[e.AppName=3]="AppName",e[e.AppPlatform=4]="AppPlatform",e[e.AppVersion=5]="AppVersion"}(e.AllowedPartA||(e.AllowedPartA={})),function(e){e[e.SendTelemetryEvent=1]="SendTelemetryEvent",e[e.CustomerContent=2]="CustomerContent",e[e.DirectNumericEvent=3]="DirectNumericEvent"}(e.EventType||(e.EventType={}))}(oteljs||(oteljs={})),function(e){e.getEffectiveEventFlags=function(t){var n={costPriority:1,samplingPolicy:1,persistencePriority:1,dataCategories:0,diagnosticLevel:100};return t.eventFlags&&t.eventFlags.dataCategories||e.logNotification(0,0,(function(){return"DataCategories"})),t.eventFlags?(t.eventFlags.costPriority&&(n.costPriority=t.eventFlags.costPriority),t.eventFlags.samplingPolicy&&(n.samplingPolicy=t.eventFlags.samplingPolicy),t.eventFlags.persistencePriority&&(n.persistencePriority=t.eventFlags.persistencePriority),t.eventFlags.dataCategories&&(n.dataCategories=t.eventFlags.dataCategories),t.eventFlags.diagnosticLevel&&(n.diagnosticLevel=t.eventFlags.diagnosticLevel),n):n}}(oteljs||(oteljs={})),function(e){var t,n=(t=[],{fireEvent:function(e){t.forEach((function(t){return t(e)}))},addListener:function(e){e&&t.push(e)}});function r(e,t,r){n.fireEvent({level:e,category:t,message:r})}e.onNotification=function(){return n},e.logNotification=r,e.logError=function(e,t,n){r(0,e,(function(){var e=n instanceof Error?n.message:"";return"".concat(t,": ").concat(e)}))}}(oteljs||(oteljs={})),function(e){var t;function n(e){var t={eventName:e.eventName,eventFlags:e.eventFlags||{},telemetryProperties:e.telemetryProperties?__assign({},e.telemetryProperties):{},dataFields:e.dataFields?e.dataFields.slice():[],timestamp:e.timestamp||(new Date).getTime()};return e.eventContract&&(t.eventContract={name:e.eventContract.name,dataFields:e.eventContract.dataFields.slice()}),t}!function(e){e[e.TelemetryData=0]="TelemetryData",e[e.AnonymousData=1]="AnonymousData",e[e.CustomerContent=2]="CustomerContent"}(t||(t={})),e.SuppressNexus=-1,e.cloneEvent=n;var r=function(){function t(e,t,n){var r,i,o;this.telemetrySinks=[],this.persistentDataFields=[],this.partAFields=[],this.eventQueue=[],this.config=n||{},e&&(this.telemetrySinks=e.telemetrySinks,(r=this.persistentDataFields).push.apply(r,e.persistentDataFields),this.config=__assign(__assign({},e.getConfig()),this.config),(i=this.partAFields).push.apply(i,e.partAFields)),t&&(o=this.persistentDataFields).push.apply(o,t)}return t.prototype.addEventContentType=function(t,n){t.push(e.makeInt64DataField("EventContent.Type",n))},t.prototype.sendTelemetryEvent=function(t){var r=n(t),i=r.telemetryProperties;i.nexusTenantToken=e.SuppressNexus;var o=i.ariaTenantToken;if(!o&&(!e.fillTenantTokens(r.eventName,i)&&!o))return void e.logNotification(0,0,(function(){return"No tenant token: "+t.eventName}));this.sendTelemetryEventInternal(r,1)},t.prototype.sendNonStandardEvent=function(e,t){var r=n(e);this.sendTelemetryEventInternal(r,t)},t.prototype.sendCustomerContent=function(e){var t=n(e),r=t.telemetryProperties,i=r.customerContentVersion;return(!i||i>2)&&(r.customerContentVersion=2),r.ariaTenantToken=void 0,r.nexusTenantToken=void 0,r.dnmToken=void 0,this.addEventContentType(t.dataFields,2),this.sendTelemetryEventInternal(t,2)},t.prototype.sendDirectNumericEvent=function(t){var r=n(t),i=r.telemetryProperties;if(!i.dnmToken&&(!e.fillTenantTokens(r.eventName,i)&&!i.dnmToken))return void e.logNotification(0,0,(function(){return"No dnm token: "+r.eventName}));this.addEventContentType(r.dataFields,1),this.sendTelemetryEventInternal(r,3)},t.prototype.sendTelemetryEventInternal=function(t,n){if(2===n||!t.telemetryProperties.customerContentVersion&&!t.telemetryProperties.customerContentType){try{if(0===this.telemetrySinks.length)return void(this.config.enableQueue&&this.eventQueue.length<1e3?this.eventQueue.push([t,n]):e.logNotification(1,0,(function(){return"No telemetry sinks are attached."})));this.processTelemetryEvent(t,n)}catch(t){return void e.logError(0,"SendTelemetryEvent",t)}this.telemetrySinks.forEach((function(e){try{3===n||2===n?e.sendNonStandardEvent&&e.sendNonStandardEvent(t,n):e.sendTelemetryEvent(t)}catch(e){}}))}else e.logNotification(0,0,(function(){return"Customer content"}))},t.prototype.processTelemetryEvent=function(t,n){var r,i,o;if(t.dataFields&&(null===(o=t.dataFields)||void 0===o||o.unshift(e.makeStringDataField("OTelJS.Version",e.oteljsVersion)),3!==n&&this.persistentDataFields&&(r=t.dataFields).unshift.apply(r,this.persistentDataFields)),this.partAFields.length>0){var a=t.eventContract||{name:"",dataFields:[]};(i=a.dataFields).push.apply(i,this.partAFields),t.eventContract=a}this.config.disableValidation||e.validateTelemetryEvent(t)},t.prototype.addSink=function(e){this.telemetrySinks.push(e),this.flushQueue()},t.prototype.flushQueue=function(){var e=this.eventQueue;if(this.eventQueue=[],this.telemetrySinks.length>0)for(var t=0,n=e;t<n.length;t++){var r=n[t],i=r[0],o=r[1];this.sendTelemetryEventInternal(i,o)}},t.prototype.setTenantToken=function(t,n,r){e.setTenantTokens(t,{ariaTenantToken:n,nexusTenantToken:r})},t.prototype.setDNMToken=function(t,n){e.setTenantTokens(t,{dnmToken:n})},t.prototype.cloneEvent=function(e){return n(e)},t.prototype.getConfig=function(){return this.config},t}();e.SimpleTelemetryLogger=r}(oteljs||(oteljs={})),function(e){var t=9007199254740991,n=/^Office(\.[A-Z][a-zA-Z0-9]*){2,}$/,r=/^[a-zA-Z0-9_\.]{1,95}$/;function i(e){return r.test(e)}function o(e){e&&e.forEach((function(e){if("string"!=typeof e.name||!i(e.name))throw new Error("Invalid dataField name");2===e.dataType&&a(e.value)}))}function a(e){if("number"!=typeof e||!isFinite(e)||Math.floor(e)!==e||e<-9007199254740991||e>t)throw new Error("Invalid integer ".concat(JSON.stringify(e)))}e.validateTelemetryEvent=function(e){if(!function(e){if(!e||e.length>98)return!1;return n.test(e)}(e.eventName))throw new Error("Invalid eventName");var t=e.eventContract;if(t){if(t.name&&!i(t.name))throw new Error("Invalid eventContract");o(t.dataFields)}o(e.dataFields)},e.validateInt=a}(oteljs||(oteljs={})),function(e){var t={};e.setTenantTokens=function(n,r){"Office."===n.substring(0,7)&&"."!==n[n.length-1]?t[n]?(r.ariaTenantToken&&(t[n].ariaTenantToken=r.ariaTenantToken),r.dnmToken&&(t[n].dnmToken=r.dnmToken)):t[n]=r:e.logNotification(0,0,(function(){return"Namespace: ".concat(n)}))},e.fillTenantTokens=function(e,n){for(var r=e.length;r>0;){var i=e.substr(0,r);if(t[i]){var o=t[i];return n.ariaTenantToken=o.ariaTenantToken,n.dnmToken=o.dnmToken,!0}r=e.lastIndexOf(".",r-1)}return!1},e.clear=function(){t={}}}(oteljs||(oteljs={})),function(e){e.oteljsVersion="4.18.0"}(oteljs||(oteljs={})),function(e){var t="AppTelemetry is disabled for this platform.",n="AgaveSink has no available sink",r=function(){function r(t){e.TelemetryContext.setTelemetryContext(t),this.initialize()}return r.createInstance=function(e){void 0===e&&(e={});var t=new r(e);if(t._sink)return t},r.prototype.initialize=function(){if(!this.isTelemetryEnabled())return this.failToInitialize(t);if(e.RichApiSink.isSupportedByDeclaration())this.connectRichApiSink();else if(e.OutlookSink.isSupported())this.connectSink("OutlookSink",new e.OutlookSink);else{if(!e.TelemetryContext.isWacAgave()||!e.SdxWacSink.isSupported())return this.failToInitialize();this.connectSink("SdxWacSink",new e.SdxWacSink)}},r.prototype.failToInitialize=function(t){this._sink=void 0;var r=t||n;e.logNotification(0,1,(function(){return r}))},r.prototype.sendTelemetryEvent=function(t){if(this._sink)try{this._sink.sendTelemetryEvent(t)}catch(t){e.logError(1,"AgaveSink",t)}else e.logNotification(0,1,(function(){return n}))},r.prototype.sendCustomerContent=function(t){if(this._sink&&this._sink.sendCustomerContent)try{this._sink.sendCustomerContent(t)}catch(t){e.logError(1,"AgaveSink",t)}else e.logNotification(0,1,(function(){return n}))},r.prototype.connectSink=function(t,n){this._sink=n,e.logNotification(2,1,(function(){return"AgaveSink is using "+t}))},r.prototype.connectRichApiSink=function(){this.connectSink("RichApiSink",new e.RichApiSink)},r.prototype.isTelemetryEnabled=function(){return!(void 0===OSF||void 0===OSF.AppTelemetry||"boolean"!=typeof OSF.AppTelemetry.enableTelemetry||!OSF.AppTelemetry.enableTelemetry)||(e.logNotification(1,0,(function(){return t})),!1)},r}();e.AgaveSink=r}(oteljs||(oteljs={})),function(e){function t(e){return Office.context.requirements.isSetSupported("OutlookTelemetry",e)}var n=function(){function n(){this._supportsAllEvents=!1,this._contextDataFields=[],this._supportsAllEvents=t("1.1");var n=e.TelemetryContext.getAppPlatform();"iOS"!==n&&"Android"!==n||(this._contextDataFields=e.TelemetryContext.getDataFieldsFromContext())}return n.isSupported=function(){try{return t()}catch(e){return!1}},n.prototype.sendTelemetryEvent=function(t){this._supportsAllEvents||t.eventName.match(/^Office\.Extensibility\.OfficeJs\.[a-zA-Z]*$/)?(this.addAdditionalDataFields(t),Office.context.mailbox.logTelemetry(JSON.stringify(t))):e.logNotification(2,1,(function(){return"This version of Outlook only accepts OfficeJS telemetry events"}))},n.prototype.sendCustomerContent=function(e){t("1.2")&&(this.addAdditionalDataFields(e),Office.context.mailbox.logCustomerContentTelemetry(JSON.stringify(e)))},n.prototype.addAdditionalDataFields=function(e){var t;e.dataFields=e.dataFields||[],(t=e.dataFields).push.apply(t,this._contextDataFields)},n}();e.OutlookSink=n}(oteljs||(oteljs={})),function(e){var t=function(){function t(){var e=this;this._requestIsPending=!0,this._telemetryQueue=[],this._customerContentQueue=[],this.pause(1e3).then((function(){return e._requestIsPending=!1,e.processTelemetryEvents()})).catch()}return t.isSupportedByDeclaration=function(){return t.isSupportedVersion("1.2")},t.isSupportedVersion=function(e){return Office.context.requirements.isSetSupported("Telemetry",e)},t.prototype.sendCustomerContent=function(e){t.isSupportedVersion("1.3")&&(this._customerContentQueue.push(e),this.processWorkBacklog())},t.prototype.sendTelemetryEvent=function(e){this._telemetryQueue.push(e),this.processWorkBacklog()},t.prototype.processWorkBacklog=function(){var t=this;this._requestIsPending||(this._requestIsPending=!0,this.processTelemetryEvents().then((function(){t.waitAndProcessMore()})).catch((function(n){e.logError(1,"RichApiSink Error",n),t.waitAndProcessMore()})))},t.prototype.waitAndProcessMore=function(){var e=this;this.pause(1e3).then((function(){e._requestIsPending=!1,e._telemetryQueue.length>0&&setTimeout((function(){return e.processWorkBacklog()}),0)})).catch((function(){e._requestIsPending=!1}))},t.prototype.processTelemetryEvents=function(){var t=this,n=this._telemetryQueue;this._telemetryQueue=[];var r=this._customerContentQueue;this._customerContentQueue=[];var i=new OfficeCore.RequestContext,o=function(n,r){if(n.telemetryProperties){var i=[];t.addDataFields(i,n.dataFields);var o=n.eventContract?n.eventContract.name:"";n.eventContract&&t.addDataFields(i,n.eventContract.dataFields),r(n.telemetryProperties,n.eventName,o,e.getEffectiveEventFlags(n),i)}};return n.forEach((function(e){o(e,(function(e,t,n,r,o){i.telemetry.sendTelemetryEvent(e,t,n,r,o)}))})),r.forEach((function(e){o(e,(function(e,t,n,r,o){i.telemetry.sendCustomerContent(e,t,n,r,o)}))})),i.sync().catch((function(t){e.logError(1,"RichApi telemetry failed.",t)}))},t.prototype.addDataFields=function(e,t){t&&t.forEach((function(t){e.push({name:t.name,value:t.value,classification:t.classification?t.classification:4,type:4===t.dataType?0:t.dataType})}))},t.prototype.pause=function(e){return new Office.Promise((function(t){return setTimeout(t,e)}))},t}();e.RichApiSink=t}(oteljs||(oteljs={})),function(e){!function(t){!function(t){!function(t){!function(t){t.getFields=function(t,n){var r=[];return void 0!==n.id&&r.push(e.makeStringDataField("".concat(t,".Id"),n.id)),void 0!==n.version&&r.push(e.makeStringDataField("".concat(t,".Version"),n.version)),void 0!==n.instanceId&&r.push(e.makeStringDataField("".concat(t,".InstanceId"),n.instanceId)),void 0!==n.name&&r.push(e.makeStringDataField("".concat(t,".Name"),n.name)),void 0!==n.marketplaceType&&r.push(e.makeStringDataField("".concat(t,".MarketplaceType"),n.marketplaceType)),void 0!==n.sessionId&&r.push(e.makeStringDataField("".concat(t,".SessionId"),n.sessionId)),void 0!==n.browserToken&&r.push(e.makeStringDataField("".concat(t,".BrowserToken"),n.browserToken)),void 0!==n.osfRuntimeVersion&&r.push(e.makeStringDataField("".concat(t,".OsfRuntimeVersion"),n.osfRuntimeVersion)),void 0!==n.officeJsVersion&&r.push(e.makeStringDataField("".concat(t,".OfficeJsVersion"),n.officeJsVersion)),void 0!==n.hostJsVersion&&r.push(e.makeStringDataField("".concat(t,".HostJsVersion"),n.hostJsVersion)),void 0!==n.assetId&&r.push(e.makeStringDataField("".concat(t,".AssetId"),n.assetId)),void 0!==n.providerName&&r.push(e.makeStringDataField("".concat(t,".ProviderName"),n.providerName)),void 0!==n.type&&r.push(e.makeStringDataField("".concat(t,".Type"),n.type)),r}}(t.SDX||(t.SDX={}))}(t.System||(t.System={}))}(t.Office||(t.Office={}))}(e.Contracts||(e.Contracts={}))}(oteljs||(oteljs={})),function(e){var t=function(){function t(){}return t.isSupported=function(){return Office.context&&Office.context.platform?Office.context.platform===Office.PlatformType.OfficeOnline:OfficeExt&&OfficeExt.HostName&&OfficeExt.HostName.Host&&OfficeExt.HostName.Host.getInstance().getPlatform()===Office.PlatformType.OfficeOnline},t.prototype.sendTelemetryEvent=function(t,n){try{if(t.dataFields&&t.dataFields.filter((function(e){var t=e.classification;return t&&4!==t&&1!==t})).length>0)return;var r=OSF._OfficeAppFactory.getId(),i=OSF.AgaveHostAction.SendTelemetryEvent;OSF.getClientEndPoint().invoke("ContextActivationManager_notifyHost",null,[r,i,t])}catch(t){e.logError(1,"AgaveWacSink",t)}},t.prototype.sendCustomerContent=function(t,n){try{if(t.dataFields&&t.dataFields.filter((function(e){var t=e.classification;return t&&4!==t&&1!==t&&32!==t})).length>0)return;var r=OSF._OfficeAppFactory.getId(),i=OSF.AgaveHostAction.SendCustomerContent;OSF.getClientEndPoint().invoke("ContextActivationManager_notifyHost",null,[r,i,t])}catch(t){e.logError(1,"AgaveWacSink",t)}},t}();e.SdxWacSink=t}(oteljs||(oteljs={})),function(e){var t=function(){function e(){}return e.setTelemetryContext=function(e){this._steContext=e},e.getDataFieldsFromContext=function(){var e=this,t=[];return Object.keys(this._steContext).forEach((function(n){t.push({name:n,value:e._steContext[n],dataType:0})})),t},e.getAppName=function(){return this._steContext["App.Name"]},e.getAppPlatform=function(){return this._steContext["App.Platform"]},e.getAppVersion=function(){return this._steContext["App.Version"]},e.isWacAgave=function(){return"Web"===this._steContext["App.Platform"]},e._steContext={},e}();e.TelemetryContext=t}(oteljs||(oteljs={})),function(e){!function(e){function t(){try{if(void 0!==OSF&&void 0!==OSF.isOfficeReactNative&&OSF.isOfficeReactNative())return!0}catch(e){}return!1}function n(){var e="web";try{void 0!==OSF&&void 0!==OSF._OfficeAppFactory&&void 0!==OSF._OfficeAppFactory.getHostInfo&&(e=OSF._OfficeAppFactory.getHostInfo().hostPlatform)}catch(e){}return e}e.isNativeStorage=function(){var e=n();return!(function(){try{if(void 0!==OSF&&void 0!==OSF._OfficeAppFactory&&void 0!==OSF._OfficeAppFactory.getHostInfo&&OSF._OfficeAppFactory.getHostInfo().flags&OSF.HostInfoFlags.SharedApp)return!0}catch(e){}return!1}()||!(t()||"win32"===e||"mac"===e&&window._useSDXSandbox))},e.isNativeApiInfomation=function(){var e=n();return!!(t()||"win32"===e||"mac"===e&&window._useSDXSandbox)},e.isNativeDialog=function(){var e=n();return!(!t()&&"win32"!==e)}}(e.ApiHelper||(e.ApiHelper={}))}(OfficeRuntime||(OfficeRuntime={})),function(e){e.ApiHelper.isNativeApiInfomation()?e.apiInformation=t:e.apiInformation=n;var t={isSetSupported:function(e,t){if("string"!=typeof e)return!1;if(null==t&&(t="0.0.0"),void 0===global.__apiSets)return!1;var n=global.__apiSets,i=Object.keys(n).map((function(e){return e.toLowerCase()})).indexOf(e.toLowerCase());if(i>-1){var o=n[Object.keys(n)[i]];try{var a=r(t),s=void 0;if((s=Array.isArray(o)?function(e,t){for(var n=0;n<e.length;n++){var i=r(e[n]);if(i.major==t)return i}return{major:0,minor:0,patch:0}}(o,a.major):r(o)).major>0){if(s.major>a.major)return!0;if(s.major==a.major&&s.minor>a.minor)return!0;if(s.major==a.major&&s.minor==a.minor&&s.patch>=a.patch)return!0}}catch(e){return!1}}return!1}},n={isSetSupported:function(e,t){try{return!!(Office&&Office.context&&Office.context.requirements)&&Office.context.requirements.isSetSupported(e,Number(t))}catch(e){return!1}}};function r(e){var t=e.split("."),n=0,r=0,i=0;if(t.length<2&&isNaN(Number(e)))throw"version format incorrect";if(n=Number(t[0]),t.length>=2&&(r=Number(t[1])),t.length>=3&&(i=Number(t[2])),isNaN(n)||isNaN(r)||isNaN(i))throw"version format incorrect";return{major:n,minor:r,patch:i}}}(OfficeRuntime||(OfficeRuntime={}));var OfficeRuntime;__extends=this&&this.__extends||function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();!function(e){OfficeExtension.BatchApiHelper.createPropertyObject,OfficeExtension.BatchApiHelper.createMethodObject,OfficeExtension.BatchApiHelper.createIndexerObject,OfficeExtension.BatchApiHelper.createRootServiceObject;var t=OfficeExtension.BatchApiHelper.createTopLevelServiceObject,n=(OfficeExtension.BatchApiHelper.createChildItemObject,OfficeExtension.BatchApiHelper.invokeMethod),r=(OfficeExtension.BatchApiHelper.invokeEnsureUnchanged,OfficeExtension.BatchApiHelper.invokeSetProperty,OfficeExtension.Utility.isNullOrUndefined),i=(OfficeExtension.Utility.isUndefined,OfficeExtension.Utility.throwIfNotLoaded,OfficeExtension.Utility.throwIfApiNotSupported,OfficeExtension.Utility.load,OfficeExtension.Utility.retrieve,OfficeExtension.Utility.toJson),o=OfficeExtension.Utility.fixObjectPathIfNecessary,a=(OfficeExtension.Utility._handleNavigationPropertyResults,OfficeExtension.Utility.adjustToDateTime,OfficeExtension.Utility.processRetrieveResult),s=(OfficeExtension.Utility.setMockData,OfficeExtension.CommonUtility.calculateApiFlags,function(e){this._dialogService=e});e.Dialog=s;var c=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),t.prototype.close=function(){return this._dialogService.close(),OfficeExtension.CoreUtility.Promise.resolve()},t}(s),l=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),t.prototype.close=function(){return this._dialogService.close(),this._dialogService.context.sync()},t}(s);function u(e){return/^(\-|\+)?([0-9]+)%?$/.test(e)}function f(e){var t,n=((t={})[12002]={code:"InvalidUrl",message:"Cannot load URL, no such page or bad URL syntax."},t[12003]={code:"InvalidUrl",message:"HTTPS is required."},t[12004]={code:"Untrusted",message:"Domain is not trusted."},t[12005]={code:"InvalidUrl",message:"HTTPS is required."},t[12007]={code:"FailedToOpen",message:"Another dialog is already opened."},t);return n[e]?n[e]:{code:"Unknown",message:"An unknown error has occured with code: "+e}}e.displayWebDialog=function(t,n){return void 0===n&&(n={}),new OfficeExtension.CoreUtility.Promise((function(r,i){if(n.width&&n.height&&(!u(n.width)||!u(n.height)))throw new OfficeExtension.Error({code:"InvalidArgument",message:'Dimensions must be "number%" or number.'});var o={width:n.width?parseInt(n.width):50,height:n.height?parseInt(n.height):50,displayInIFrame:n.displayInIFrame};e.ApiHelper.isNativeDialog()?function(e,t,n,r,i){void 0===i&&(i={});var o=new OfficeExtension.ClientRequestContext,a=p.newObject(o),s=new l(a),c=a.onDialogMessage.add((function(e){switch(OfficeExtension.Utility.log("dialogMessageHandler:"+JSON.stringify(e)),e.type){case 17:e.error?n(e.error):t(s);break;case 12:i.onMessage&&i.onMessage(e.message,s);break;case 10:default:12006===e.originalErrorCode?(c&&(c.remove(),o.sync()),i.onClose&&i.onClose()):i.onRuntimeError&&(i.onRuntimeError(e.error,s),n(e.error))}return OfficeExtension.CoreUtility.Promise.resolve()}));o.sync().then((function(){return a.displayDialog(r,e),o.sync()})).catch((function(e){n(e)}))}(o,r,i,t,n):function(e,t,n,r,i){void 0===i&&(i={});var o;function a(e){"failed"===e.status?n(new OfficeExtension.Error(f(e.error.code))):((o=e.value).addEventHandler(Office.EventType.DialogMessageReceived,s),o.addEventHandler(Office.EventType.DialogEventReceived,l),t(new c(o)))}function s(e){i.onMessage&&i.onMessage(e.message,o,e.origin)}function l(e){12006===e.error?i.onClose&&i.onClose():i.onRuntimeError&&i.onRuntimeError(new OfficeExtension.Error(f(e.error)),o)}Office.context.ui.displayDialogAsync(r,e,a)}(o,r,i,t,n)}))};var d,p=function(s){function c(){return null!==s&&s.apply(this,arguments)||this}return __extends(c,s),Object.defineProperty(c.prototype,"_className",{get:function(){return"DialogService"},enumerable:!0,configurable:!0}),c.prototype.close=function(){n(this,"Close",1,[],4,0)},c.prototype.displayDialog=function(e,t){n(this,"DisplayDialog",1,[e,t],4,0)},c.prototype._handleResult=function(e){(s.prototype._handleResult.call(this,e),r(e))||o(this,e)},c.prototype._handleRetrieveResult=function(e,t){s.prototype._handleRetrieveResult.call(this,e,t),a(this,e,t)},c.newObject=function(n){return t(e.DialogService,n,"Microsoft.Dialog.DialogService",!1,4)},Object.defineProperty(c.prototype,"onDialogMessage",{get:function(){return this.m_dialogMessage||(this.m_dialogMessage=new OfficeExtension.GenericEventHandlers(this.context,this,"DialogMessage",{eventType:65536,registerFunc:function(){},unregisterFunc:function(){},getTargetIdFunc:function(){return null},eventArgsTransformFunc:function(e){var t;try{var n=JSON.parse(e.message),r=n.errorCode?new OfficeExtension.Error(f(n.errorCode)):null;t={originalErrorCode:n.errorCode,type:n.type,error:r,message:n.message,origin:n.origin}}catch(e){t={originalErrorCode:null,type:17,error:new OfficeExtension.Error({code:"GenericException",message:"Unknown error"}),message:e.message}}return OfficeExtension.Utility._createPromiseFromResult(t)}})),this.m_dialogMessage},enumerable:!0,configurable:!0}),c.prototype.toJSON=function(){return i(this,{},{})},c}(OfficeExtension.ClientObject);e.DialogService=p,function(e){e[e.dialogMessageReceived=0]="dialogMessageReceived",e[e.dialogEventReceived=1]="dialogEventReceived"}(d||(d={})),function(e){e.generalException="GeneralException"}(e.DialogErrorCodes||(e.DialogErrorCodes={}))}(OfficeRuntime||(OfficeRuntime={})),function(e){!function(e){function t(e,t){try{var n=Microsoft.Office.WebExtension.FeatureGates[e];return null==n?t:"true"===n.toString().toLowerCase()}catch(e){return t}}function n(e,t){try{var n=Microsoft.Office.WebExtension.FeatureGates,r=parseInt(n[e]);return isNaN(r)?t:r}catch(e){return t}}function r(e,t){try{var n=Microsoft.Office.WebExtension.FeatureGates[e];return null==n?t:n}catch(e){return t}}e.getBooleanFeatureGate=t,e.getIntFeatureGate=n,e.getStringFeatureGate=r,e.getBooleanFeatureGateAsync=function(e,n){return Promise.resolve(t(e,n))},e.getIntFeatureGateAsync=function(e,t){return Promise.resolve(n(e,t))},e.getStringFeatureGateAsync=function(e,t){return Promise.resolve(r(e,t))}}(e.experimentation||(e.experimentation={}))}(OfficeRuntime||(OfficeRuntime={})),function(e){!function(e){var n={};function r(e){var t=e.eventName,r=e.message;n.hasOwnProperty(t)&&n[t].call(r)}e.on=function(e,i){return function(e,i){n.hasOwnProperty(e)||(n[e]=new t,function(){Office&&Office.context&&Office.context.messaging&&!Office.context.messaging.onMessage&&(Office.context.messaging.onMessage=r.bind(this))}());n[e].add(i)}(e,i),new Promise((function(e){e()}))},e.off=function(e,t){return function(e,t){n.hasOwnProperty(e)&&(t?n[e].remove(t):delete n[e])}(e,t),new Promise((function(e){e()}))},e.emit=function(e,t){return function(e,t){var n={eventName:e,message:t};Office&&Office.context&&Office.context.messaging&&Office.context.messaging.sendMessage&&Office.context.messaging.sendMessage(n)}(e,t),new Promise((function(e){e()}))}}(e.message||(e.message={}));var t=function(){function e(){this.listeners=[]}return e.prototype.add=function(e){this.listeners.push(e)},e.prototype.remove=function(e){var t=this.listeners.lastIndexOf(e);-1!==t&&this.listeners.splice(t,1)},e.prototype.call=function(e){this.listeners.forEach((function(t){return t(e)}))},e}();e.ListenerManager=t}(OfficeRuntime||(OfficeRuntime={})),function(e){OfficeExtension.BatchApiHelper.createPropertyObject,OfficeExtension.BatchApiHelper.createMethodObject,OfficeExtension.BatchApiHelper.createIndexerObject,OfficeExtension.BatchApiHelper.createRootServiceObject;var t=OfficeExtension.BatchApiHelper.createTopLevelServiceObject,n=(OfficeExtension.BatchApiHelper.createChildItemObject,OfficeExtension.BatchApiHelper.invokeMethod),r=(OfficeExtension.BatchApiHelper.invokeEnsureUnchanged,OfficeExtension.BatchApiHelper.invokeSetProperty,OfficeExtension.Utility.isNullOrUndefined),i=(OfficeExtension.Utility.isUndefined,OfficeExtension.Utility.throwIfNotLoaded,OfficeExtension.Utility.throwIfApiNotSupported,OfficeExtension.Utility.load,OfficeExtension.Utility.retrieve,OfficeExtension.Utility.toJson),o=OfficeExtension.Utility.fixObjectPathIfNecessary,a=(OfficeExtension.Utility._handleNavigationPropertyResults,OfficeExtension.Utility.adjustToDateTime,OfficeExtension.Utility.processRetrieveResult),s=(OfficeExtension.Utility.setMockData,OfficeExtension.CommonUtility.calculateApiFlags,"_Office_AsyncStorage_"),c=s+"|_unusedKey_",l={getItem:function(e){return p((function(t,n){return t.multiGet(n,JSON.stringify([e]))}),(function(e){var t=JSON.parse(e);return t&&t[0]&&t[0][1]?t[0][1]:null}))},setItem:function(e,t){return p((function(n,r){return n.multiSet(r,JSON.stringify([[e,t]]))}),(function(){return null}))},removeItem:function(e){return p((function(t,n){return t.multiRemove(n,JSON.stringify([e]))}),(function(){return null}))},getItems:function(e){return p((function(t,n){return t.multiGet(n,JSON.stringify(e))}),(function(t){var n=JSON.parse(t),r={};return n&&n.forEach((function(e){var t=e[0],n=e[1];return r[t]=n,n})),e&&e.forEach((function(e){r[e]&&r[e]})),r}))},setItems:function(e){var t=[];for(var n in e)e.hasOwnProperty(n)&&t.push([n,e[n]]);return p((function(e,n){return e.multiSet(n,JSON.stringify(t))}),(function(){return null}))},removeItems:function(e){return p((function(t,n){return t.multiRemove(n,JSON.stringify(e))}),(function(){return null}))},getKeys:function(){return p((function(e,t){return e.getAllKeys(t)}),(function(e){return JSON.parse(e)}))}},u={getItem:function(e){return h((function(){return f(e)}))},setItem:function(e,t){return g((function(){return d(e,t)}))},removeItem:function(e){return g((function(){return window.localStorage.removeItem(s+e)}))},getItems:function(e){return new Promise((function(t,n){var r={},i=[];try{m()}catch(e){n(e)}e.forEach((function(e){try{var t=f(e);r[e]=t||null}catch(e){i.push(e)}})),i.length>0?n(new Error("Unknown error.")):t(r)}))},setItems:function(e){return y(e,(function(t){return d(t,e[t])}))},removeItems:function(e){return y(e,(function(e){return window.localStorage.removeItem(s+e)}))},getKeys:function(){return h((function(){return Object.keys(window.localStorage).filter((function(e){return 0===e.indexOf(s)})).map((function(e){return e.substr(s.length)}))}))}};function f(e){return window.localStorage.getItem(s+e)}function d(e,t){window.localStorage.setItem(s+e,t)}function p(e,t){return new OfficeExtension.CoreUtility.Promise((function(n,r){var i=v.getInstance(),o=i.setCallBack((function(e,i){if(i)r(i);else{var o=t(e);n(o)}}));i.ctx.sync().then((function(){var t=i.getPersistentKvStorageService();return e(t,o),i.ctx.sync()})).catch((function(e){r(e)}))}))}function m(){d(c,null),window.localStorage.removeItem(c)}function g(e,t){return void 0===t&&(t=function(){}),new Promise((function(n,r){try{m(),e(),t(null),n()}catch(e){t(e),r(e)}}))}function h(e,t){return void 0===t&&(t=function(){}),new Promise((function(n,r){try{m();var i=e();t(null,i),n(i)}catch(e){t(e,null),r(e)}}))}function y(e,t,n){return void 0===n&&(n=function(){}),new Promise((function(r,i){var o=[];try{m()}catch(e){o.push(e)}for(var a in e)if(e.hasOwnProperty(a)||Array.isArray(e))try{Array.isArray(e)?t(e[a]):t(a)}catch(e){o.push(e)}n(o),o.length>0?i(o):r()}))}e.ApiHelper.isNativeStorage()?e.storage=l:e.storage=u;var v=function(){function e(){var e=this;this._invokeId=0,this._callDict={},this.ctx=new OfficeExtension.ClientRequestContext,this._perkvstorService=O.newObject(this.ctx),this._eventResult=this._perkvstorService.onPersistentStorageMessage.add((function(t){OfficeExtension.Utility.log("persistentKvStoragegMessageHandler:"+JSON.stringify(t));var n=e._callDict[t.invokeId];n&&(n(t.message,t.error),delete e._callDict[t.invokeId])}))}return e.getInstance=function(){return void 0===e.instance?e.instance=new e:e.instance._perkvstorService=O.newObject(e.instance.ctx),e.instance},e.prototype.getPersistentKvStorageService=function(){return this._perkvstorService},e.prototype.getCallBack=function(e){return this._callDict[e]},e.prototype.setCallBack=function(e){var t=this._invokeId;return this._callDict[this._invokeId++]=e,t},e}(),O=function(s){function c(){return null!==s&&s.apply(this,arguments)||this}return __extends(c,s),Object.defineProperty(c.prototype,"_className",{get:function(){return"PersistentKvStorageService"},enumerable:!0,configurable:!0}),c.prototype.clear=function(e){n(this,"Clear",1,[e],4,0)},c.prototype.getAllKeys=function(e){n(this,"GetAllKeys",1,[e],4,0)},c.prototype.multiGet=function(e,t){n(this,"MultiGet",1,[e,t],4,0)},c.prototype.multiRemove=function(e,t){n(this,"MultiRemove",1,[e,t],4,0)},c.prototype.multiSet=function(e,t){n(this,"MultiSet",1,[e,t],4,0)},c.prototype._handleResult=function(e){(s.prototype._handleResult.call(this,e),r(e))||o(this,e)},c.prototype._handleRetrieveResult=function(e,t){s.prototype._handleRetrieveResult.call(this,e,t),a(this,e,t)},c.newObject=function(n){return t(e.PersistentKvStorageService,n,"Microsoft.PersistentKvStorage.PersistentKvStorageService",!1,4)},Object.defineProperty(c.prototype,"onPersistentStorageMessage",{get:function(){return this.m_persistentStorageMessage||(this.m_persistentStorageMessage=new OfficeExtension.GenericEventHandlers(this.context,this,"PersistentStorageMessage",{eventType:65537,registerFunc:function(){},unregisterFunc:function(){},getTargetIdFunc:function(){return null},eventArgsTransformFunc:function(e){var t,n,r,i;try{var o=JSON.parse(e.message),a=parseInt(o.errorCode),s=0!=a?new OfficeExtension.Error((n=a,(r={})[16389]={code:"GenericException",message:"Unknown error."},r[65535]={code:"Unexcepted",message:"Catastrophic failure."},r[14]={code:"OutOfMemory",message:"Ran out of memory."},r[87]={code:"InvalidArg",message:"One or more arguments are invalid."},r[16385]={code:"NotImplemented",message:"Not implemented."},r[6]={code:"BadHandle",message:"File Handle is not Set."},r[5]={code:"AccessDenied",message:"Can't read the Storage File."},(i=r)[n]?i[n]:{code:"Unknown",message:"An unknown error has occured"})):null;t={invokeId:o.invokeId,message:o.message,error:s}}catch(e){t={invokeId:-1,message:e.message,error:new OfficeExtension.Error({code:"GenericException",message:"Unknown error"})}}return OfficeExtension.Utility._createPromiseFromResult(t)}})),this.m_persistentStorageMessage},enumerable:!0,configurable:!0}),c.prototype.toJSON=function(){return i(this,{},{})},c}(OfficeExtension.ClientObject);e.PersistentKvStorageService=O,function(e){e.generalException="GeneralException"}(e.ErrorCodes||(e.ErrorCodes={}))}(OfficeRuntime||(OfficeRuntime={}));var OfficeFirstPartyDialog,OfficeFirstPartyAuth,OfficeFirstParty,OfficeCore;__extends=this&&this.__extends||function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),__awaiter=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{c(r.next(e))}catch(e){o(e)}}function s(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){e.done?i(e.value):new n((function(t){t(e.value)})).then(a,s)}c((r=r.apply(e,t||[])).next())}))},__generator=this&&this.__generator||function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=t.call(e,a)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}},__assign=this&&this.__assign||function(){return(__assign=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};!function(e){OfficeExtension.BatchApiHelper.createPropertyObject,OfficeExtension.BatchApiHelper.createMethodObject,OfficeExtension.BatchApiHelper.createIndexerObject,OfficeExtension.BatchApiHelper.createRootServiceObject;var t=OfficeExtension.BatchApiHelper.createTopLevelServiceObject,n=(OfficeExtension.BatchApiHelper.createChildItemObject,OfficeExtension.BatchApiHelper.invokeMethod),r=(OfficeExtension.BatchApiHelper.invokeEnsureUnchanged,OfficeExtension.BatchApiHelper.invokeSetProperty,OfficeExtension.Utility.isNullOrUndefined),i=(OfficeExtension.Utility.isUndefined,OfficeExtension.Utility.throwIfNotLoaded,OfficeExtension.Utility.throwIfApiNotSupported,OfficeExtension.Utility.load,OfficeExtension.Utility.retrieve,OfficeExtension.Utility.toJson),o=OfficeExtension.Utility.fixObjectPathIfNecessary,a=(OfficeExtension.Utility._handleNavigationPropertyResults,OfficeExtension.Utility.adjustToDateTime,OfficeExtension.Utility.processRetrieveResult),s=(OfficeExtension.Utility.setMockData,OfficeExtension.CommonUtility.calculateApiFlags),c=function(c){function l(){return null!==c&&c.apply(this,arguments)||this}return __extends(l,c),Object.defineProperty(l.prototype,"_className",{get:function(){return"BiShim"},enumerable:!0,configurable:!0}),l.prototype.initialize=function(e){n(this,"Initialize",0,[e],s(2,"SharedApiUndo","1.5"),0)},l.prototype.getData=function(){return n(this,"getData",1,[],4,0)},l.prototype.setVisualObjects=function(e){n(this,"setVisualObjects",0,[e],2,0)},l.prototype.setVisualObjectsToPersist=function(e){n(this,"setVisualObjectsToPersist",0,[e],2,0)},l.prototype._handleResult=function(e){(c.prototype._handleResult.call(this,e),r(e))||o(this,e)},l.prototype._handleRetrieveResult=function(e,t){c.prototype._handleRetrieveResult.call(this,e,t),a(this,e,t)},l.newObject=function(n){return t(e.BiShim,n,"Microsoft.AgaveVisual.BiShim",!1,4)},l.prototype.toJSON=function(){return i(this,{},{})},l}(OfficeExtension.ClientObject);e.BiShim=c,function(e){e.generalException="GeneralException"}(e.AgaveVisualErrorCodes||(e.AgaveVisualErrorCodes={}))}(OfficeCore||(OfficeCore={})),function(e){OfficeExtension.BatchApiHelper.createPropertyObject;var t=OfficeExtension.BatchApiHelper.createMethodObject,n=(OfficeExtension.BatchApiHelper.createIndexerObject,OfficeExtension.BatchApiHelper.createRootServiceObject,OfficeExtension.BatchApiHelper.createTopLevelServiceObject),r=(OfficeExtension.BatchApiHelper.createChildItemObject,OfficeExtension.BatchApiHelper.invokeMethod),i=OfficeExtension.BatchApiHelper.invokeEnsureUnchanged,o=(OfficeExtension.BatchApiHelper.invokeSetProperty,OfficeExtension.Utility.isNullOrUndefined),a=OfficeExtension.Utility.isUndefined,s=OfficeExtension.Utility.throwIfNotLoaded,c=(OfficeExtension.Utility.throwIfApiNotSupported,OfficeExtension.Utility.load),l=OfficeExtension.Utility.retrieve,u=OfficeExtension.Utility.toJson,f=OfficeExtension.Utility.fixObjectPathIfNecessary,d=(OfficeExtension.Utility._handleNavigationPropertyResults,OfficeExtension.Utility.adjustToDateTime,OfficeExtension.Utility.processRetrieveResult),p=function(i){function a(){return null!==i&&i.apply(this,arguments)||this}return __extends(a,i),Object.defineProperty(a.prototype,"_className",{get:function(){return"FlightingService"},enumerable:!0,configurable:!0}),a.prototype.getABConfigs=function(){return r(this,"GetABConfigs",1,[],4,0)},a.prototype.getClientSessionId=function(){return r(this,"GetClientSessionId",1,[],4,0)},a.prototype.getDeferredFlights=function(){return r(this,"GetDeferredFlights",1,[],4,0)},a.prototype.getFeature=function(n,r,i,o){return t(e.ABType,this,"GetFeature",1,[n,r,i,o],!1,!1,null,4)},a.prototype.getFeatureGate=function(n,r){return t(e.ABType,this,"GetFeatureGate",1,[n,r],!1,!1,null,4)},a.prototype.resetOverride=function(e){r(this,"ResetOverride",0,[e],0,0)},a.prototype.setOverride=function(e,t,n){r(this,"SetOverride",0,[e,t,n],0,0)},a.prototype._handleResult=function(e){(i.prototype._handleResult.call(this,e),o(e))||f(this,e)},a.prototype._handleRetrieveResult=function(e,t){i.prototype._handleRetrieveResult.call(this,e,t),d(this,e,t)},a.newObject=function(t){return n(e.FlightingService,t,"Microsoft.Experiment.FlightingService",!1,4)},a.prototype.toJSON=function(){return u(this,{},{})},a}(OfficeExtension.ClientObject);e.FlightingService=p;var m=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),Object.defineProperty(t.prototype,"_className",{get:function(){return"ABType"},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"_scalarPropertyNames",{get:function(){return["value"]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"value",{get:function(){return s("value",this._V,"ABType",this._isNull),this._V},enumerable:!0,configurable:!0}),t.prototype._handleResult=function(t){if(e.prototype._handleResult.call(this,t),!o(t)){var n=t;f(this,n),a(n.Value)||(this._V=n.Value)}},t.prototype.load=function(e){return c(this,e)},t.prototype.retrieve=function(e){return l(this,e)},t.prototype._handleRetrieveResult=function(t,n){e.prototype._handleRetrieveResult.call(this,t,n),d(this,t,n)},t.prototype.toJSON=function(){return u(this,{value:this._V},{})},t.prototype.ensureUnchanged=function(e){i(this,e)},t}(OfficeExtension.ClientObject);e.ABType=m,function(e){e.boolean="Boolean",e.integer="Integer",e.string="String"}(e.FeatureType||(e.FeatureType={})),function(e){e.generalException="GeneralException"}(e.ExperimentErrorCodes||(e.ExperimentErrorCodes={}))}(OfficeCore||(OfficeCore={})),function(e){var t,n=function(){function e(e){this._dialogService=e}return e.prototype.close=function(){return this._dialogService.close(),this._dialogService.context.sync()},e.prototype.messageChild=function(e,t){DialogApiManager&&DialogApiManager.messageChildRichApiBridge&&DialogApiManager.messageChildRichApiBridge(e,t)},e}();e.Dialog=n,e.displayWebDialog=function(t,n){return void 0===n&&(n={}),new OfficeExtension.CoreUtility.Promise((function(i,o){if(n.width&&n.height&&(!r(n.width)||!r(n.height)))throw new OfficeExtension.Error({code:"InvalidArgument",message:'Dimensions must be "number%" or number.'});var a=new OfficeExtension.ClientRequestContext,s=OfficeCore.FirstPartyDialogService.newObject(a),c=new e.Dialog(s),l=s.onDialogMessage.add((function(e){OfficeExtension.Utility.log("dialogMessageHandler:"+JSON.stringify(e));var t,r,s,u=JSON.parse(e.message),f=u.errorCode?new OfficeExtension.Error((t=u.errorCode,(r={})[12002]={code:"InvalidUrl",message:"Cannot load URL, no such page or bad URL syntax."},r[12003]={code:"InvalidUrl",message:"HTTPS is required."},r[12004]={code:"Untrusted",message:"Domain is not trusted."},r[12005]={code:"InvalidUrl",message:"HTTPS is required."},r[12007]={code:"FailedToOpen",message:"Another dialog is already opened."},(s=r)[t]?s[t]:{code:"Unknown",message:"An unknown error has occured with code: "+t})):null,d=u.type,p=u.origin,m=u.message;switch(d){case 17:f?o(f):i(c);break;case 12:n.onMessage&&n.onMessage(m,c,p);break;case 10:default:12006===u.errorCode?(l&&(l.remove(),a.sync()),n.onClose&&n.onClose()):n.onRuntimeError&&(n.onRuntimeError(f,c),o(f))}return OfficeExtension.CoreUtility.Promise.resolve()}));return a.sync().then((function(){var e={width:n.width?parseInt(n.width):50,height:n.height?parseInt(n.height):50,displayInIFrame:n.displayInIFrame,dialogTitle:n.dialogTitle,escKeyCloseDialog:void 0===n.escKeyCloseDialog||n.escKeyCloseDialog};return s.displayDialog(t,e),a.sync()})).catch((function(e){o(e)}))}));function r(e){return/^(\-|\+)?([0-9]+)%?$/.test(e)}},function(e){e[e.dialogMessageReceived=0]="dialogMessageReceived",e[e.dialogEventReceived=1]="dialogEventReceived"}(t||(t={}))}(OfficeFirstPartyDialog||(OfficeFirstPartyDialog={})),function(e){e.OfficeOnlineDomainList=["*.dod.online.office365.us","*.gov.online.office365.us","*.officeapps-df.live.com","*.officeapps.live.com","*.office.svc.cloud.microsoft","*.office.guest.usercontent.microsoft","*.excel.cloud.microsoft","*.word.cloud.microsoft","*.powerpoint.cloud.microsoft","*.online.office.de","*.partner.officewebapps.cn"],e.isHostOriginTrusted=function(){if(void 0===window.external||void 0===window.external.GetContext){var t=OSF.getClientEndPoint()._targetUrl,n=t.split("/")[2].split(":")[0].split("?")[0];return 0!=t.indexOf("https:")||e.OfficeOnlineDomainList.forEach((function(e){if(0==e.indexOf("*.")&&(e=e.substring(2)),n.indexOf(e)==n.length-e.length)return!0})),!1}return!0}}(OfficeCore||(OfficeCore={})),function(e){var t=function(){function t(e){this.context=e}return Object.defineProperty(t.prototype,"roamingSettings",{get:function(){return this.m_roamingSettings||(this.m_roamingSettings=e.AuthenticationService.newObject(this.context).roamingSettings),this.m_roamingSettings},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"tap",{get:function(){return this.m_tap||(this.m_tap=e.Tap.newObject(this.context)),this.m_tap},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"skill",{get:function(){return this.m_skill||(this.m_skill=e.Skill.newObject(this.context)),this.m_skill},enumerable:!0,configurable:!0}),t}();e.FirstPartyApis=t;var n=function(n){function r(e){return n.call(this,e)||this}return __extends(r,n),Object.defineProperty(r.prototype,"firstParty",{get:function(){return this.m_firstPartyApis||(this.m_firstPartyApis=new t(this)),this.m_firstPartyApis},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"flighting",{get:function(){return this.flightingService},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"telemetry",{get:function(){return this.m_telemetry||(this.m_telemetry=e.TelemetryService.newObject(this)),this.m_telemetry},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"ribbon",{get:function(){return this.m_ribbon||(this.m_ribbon=e.DynamicRibbon.newObject(this)),this.m_ribbon},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"bi",{get:function(){return this.m_biShim||(this.m_biShim=e.BiShim.newObject(this)),this.m_biShim},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"flightingService",{get:function(){return this.m_flightingService||(this.m_flightingService=e.FlightingService.newObject(this)),this.m_flightingService},enumerable:!0,configurable:!0}),r}(OfficeExtension.ClientRequestContext);e.RequestContext=n,e.run=function(t,n){return OfficeExtension.ClientRequestContext._runBatch("OfficeCore.run",arguments,(function(t){return new e.RequestContext(t)}))}}(OfficeCore||(OfficeCore={})),function(e){!function(e){function t(){var e=new OfficeCore.RequestContext;return"web"==OSF._OfficeAppFactory.getHostInfo().hostPlatform&&(e._customData="WacPartition"),e}e.isFeatureEnabled=function(e,n){return __awaiter(this,void 0,void 0,(function(){var r,i,o;return __generator(this,(function(a){switch(a.label){case 0:return r=t(),i=OfficeCore.License.newObject(r),o=i.isFeatureEnabled(e,n),[4,r.sync()];case 1:return a.sent(),[2,o.value]}}))}))},e.getFeatureTier=function(e,n){return __awaiter(this,void 0,void 0,(function(){var r,i,o;return __generator(this,(function(a){switch(a.label){case 0:return r=t(),i=OfficeCore.License.newObject(r),o=i.getFeatureTier(e,n),[4,r.sync()];case 1:return a.sent(),[2,o.value]}}))}))},e.isFreemiumUpsellEnabled=function(){return __awaiter(this,void 0,void 0,(function(){var e,n,r;return __generator(this,(function(i){switch(i.label){case 0:return e=t(),n=OfficeCore.License.newObject(e),r=n.isFreemiumUpsellEnabled(),[4,e.sync()];case 1:return i.sent(),[2,r.value]}}))}))},e.launchUpsellExperience=function(e,n){return __awaiter(this,void 0,void 0,(function(){var r;return __generator(this,(function(i){switch(i.label){case 0:return r=t(),OfficeCore.License.newObject(r).launchUpsellExperience(e,n),[4,r.sync()];case 1:return i.sent(),[2]}}))}))},e.onFeatureStateChanged=function(e,n){return __awaiter(this,void 0,void 0,(function(){var r,i,o,a;return __generator(this,(function(s){switch(s.label){case 0:return r=t(),i=OfficeCore.License.newObject(r),(o=i.getLicenseFeature(e)).onStateChanged.add(n),a=function(){return o.onStateChanged.remove(n),null},[4,r.sync()];case 1:return s.sent(),[2,a]}}))}))},e.getMsaDeviceTicket=function(e,n,r){return __awaiter(this,void 0,void 0,(function(){var i,o,a;return __generator(this,(function(s){switch(s.label){case 0:return i=t(),o=OfficeCore.License.newObject(i),a=o.getMsaDeviceTicket(e,n,r),[4,i.sync()];case 1:return s.sent(),[2,a.value]}}))}))},e.getLicensingAndEligibilityArtifact=function(e){return __awaiter(this,void 0,void 0,(function(){var n,r,i;return __generator(this,(function(o){switch(o.label){case 0:return n=t(),r=OfficeCore.License.newObject(n),i=r.getLicensingAndEligibilityArtifact(e),[4,n.sync()];case 1:return o.sent(),[2,i.value]}}))}))}}(e.license||(e.license={}))}(Office||(Office={})),function(e){OfficeExtension.BatchApiHelper.createPropertyObject,OfficeExtension.BatchApiHelper.createMethodObject,OfficeExtension.BatchApiHelper.createIndexerObject,OfficeExtension.BatchApiHelper.createRootServiceObject,OfficeExtension.BatchApiHelper.createTopLevelServiceObject,OfficeExtension.BatchApiHelper.createChildItemObject,OfficeExtension.BatchApiHelper.invokeMethod,OfficeExtension.BatchApiHelper.invokeEnsureUnchanged,OfficeExtension.BatchApiHelper.invokeSetProperty,OfficeExtension.Utility.isNullOrUndefined,OfficeExtension.Utility.isUndefined,OfficeExtension.Utility.throwIfNotLoaded,OfficeExtension.Utility.throwIfApiNotSupported,OfficeExtension.Utility.load,OfficeExtension.Utility.retrieve,OfficeExtension.Utility.toJson,OfficeExtension.Utility.fixObjectPathIfNecessary,OfficeExtension.Utility._handleNavigationPropertyResults,OfficeExtension.Utility.adjustToDateTime,OfficeExtension.Utility.processRetrieveResult,OfficeExtension.Utility.setMockData,OfficeExtension.CommonUtility.calculateApiFlags;!function(e){e.Skill_HostSkillEvent_EventArgsTransform=function(e,t){return{type:t.type,data:t.data}}}(e._CC||(e._CC={})),function(e){e.generalException="GeneralException"}(e.SkillErrorCodes||(e.SkillErrorCodes={}));new OfficeExtension.LibraryBuilder({metadata:{version:"1.0.0",name:"OfficeCore",defaultApiSetName:"OfficeSharedApi",hostName:"Office",apiSets:[["1.1","SharedApiUndo"]],strings:["Skill","registerHostSkillEvent","unregisterHostSkillEvent"],enumTypes:[],clientObjectTypes:[[1,0,0,0,[["executeAction",3,2,0,5],["notifyPaneEvent",2,2,0,5],[2,0,0,0,3,0,1],[3,0,0,0,3,0,1],["testFireEvent",0,0,0,3,0,1]],0,0,0,[["HostSkillEvent",2,0,"65538","",2,3]],"Microsoft.SkillApi.Skill",4]]},targetNamespaceObject:e})}(OfficeCore||(OfficeCore={})),function(e){var t="OfficeCore",n=(OfficeExtension.BatchApiHelper.createPropertyObject,OfficeExtension.BatchApiHelper.createMethodObject,OfficeExtension.BatchApiHelper.createIndexerObject,OfficeExtension.BatchApiHelper.createRootServiceObject,OfficeExtension.BatchApiHelper.createTopLevelServiceObject),r=(OfficeExtension.BatchApiHelper.createChildItemObject,OfficeExtension.BatchApiHelper.invokeMethod),i=(OfficeExtension.BatchApiHelper.invokeEnsureUnchanged,OfficeExtension.BatchApiHelper.invokeSetProperty,OfficeExtension.Utility.isNullOrUndefined),o=(OfficeExtension.Utility.isUndefined,OfficeExtension.Utility.throwIfNotLoaded,OfficeExtension.Utility.throwIfApiNotSupported),a=(OfficeExtension.Utility.load,OfficeExtension.Utility.retrieve,OfficeExtension.Utility.toJson),s=OfficeExtension.Utility.fixObjectPathIfNecessary,c=(OfficeExtension.Utility._handleNavigationPropertyResults,OfficeExtension.Utility.adjustToDateTime,OfficeExtension.Utility.processRetrieveResult),l=(OfficeExtension.Utility.setMockData,OfficeExtension.CommonUtility.calculateApiFlags,function(l){function u(){return null!==l&&l.apply(this,arguments)||this}return __extends(u,l),Object.defineProperty(u.prototype,"_className",{get:function(){return"TelemetryService"},enumerable:!0,configurable:!0}),u.prototype.sendNonStandardEvent=function(e,n,i,a,s,c){o("TelemetryService.sendNonStandardEvent","Telemetry","1.4",t),r(this,"SendNonStandardEvent",1,[e,n,i,a,s,c],4,0)},u.prototype.sendTelemetryEvent=function(e,t,n,i,o){r(this,"SendTelemetryEvent",1,[e,t,n,i,o],4,0)},u.prototype.sendTelemetryEventBatch=function(e){o("TelemetryService.sendTelemetryEventBatch","Telemetry","1.5",t),r(this,"SendTelemetryEventBatch",1,[e],4,0)},u.prototype._handleResult=function(e){(l.prototype._handleResult.call(this,e),i(e))||s(this,e)},u.prototype._handleRetrieveResult=function(e,t){l.prototype._handleRetrieveResult.call(this,e,t),c(this,e,t)},u.newObject=function(t){return n(e.TelemetryService,t,"Microsoft.Telemetry.TelemetryService",!1,4)},u.prototype.toJSON=function(){return a(this,{},{})},u}(OfficeExtension.ClientObject));e.TelemetryService=l,function(e){e.unset="Unset",e.string="String",e.boolean="Boolean",e.int64="Int64",e.double="Double"}(e.DataFieldType||(e.DataFieldType={})),function(e){e.sendTelemetryEvent="SendTelemetryEvent",e.customerContent="CustomerContent",e.directNumericEvent="DirectNumericEvent"}(e.EventType||(e.EventType={})),function(e){e.generalException="GeneralException"}(e.TelemetryErrorCodes||(e.TelemetryErrorCodes={}))}(OfficeCore||(OfficeCore={})),function(e){var t="officeWebAuthReplyUrls",n=!1,r=null;function i(e){var t=null,n=null,r=function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return t=e.apply(void 0,n)};return{immediateCall:r,delayCall:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];n=function(){return r.apply(void 0,e)}},waitForPromise:function(){return n&&(n(),n=null),t||Promise.resolve()}}}function o(t){return __awaiter(this,void 0,void 0,(function(){var n,r;return __generator(this,(function(i){switch(i.label){case 0:return n=!1,t&&e.supportsTeamsTokenFlow?(n=!0,[3,3]):[3,1];case 1:return[4,a()];case 2:(r=i.sent()).supportsAuthToken?n=!0:t&&(n=!r.hostPageSupportsAuth),i.label=3;case 3:return[2,n]}}))}))}function a(){return Office&&Office.context&&Office.context.webAuth?r?Promise.resolve(r):new Promise((function(e,t){Office.context.webAuth.getAuthContextAsync((function(n){if("succeeded"===n.status){var i=n.value;if(!i||i.isAnonymous)return void t({code:"CannotGetAuthContext",message:i?i.Error:void 0,loggableErrorMessage:"Anonymous user"});if(!i.appId)return void t({code:"CannotGetAuthContext",message:"App ID is missing from getAuthContextAsync. Please verify the WebApplicationInfo node in app manifest."});e(r=i)}else t({code:"CannotGetAuthContext",message:n.status,loggableErrorMessage:String(n.error.code)})}))})):Promise.reject({code:"GetAuthContextAsyncMissing",message:"Office:["+!Office+"],Office.context:["+!Office.context+"],Office.context.webAuth:["+!Office.context.webAuth+"]"})}e.authFlow="authcode",e.autoPopup=!1,e.upnCheck=!0,e.timeout=void 0,e.clientCapabilities=[],e.msal="https://alcdn.msauth.net/browser-1p/2.28.1/js/msal-browser-1p.min.js",e.debugging=!1,e.useMsal3=void 0,e.useMsal5=void 0,e.enableLegacyPolling=!1,e.delay=0,e.delayMsal=0,e.supportsOauthManager=!1,e.supportsTeamsTokenFlow=!0,e.supportsBrowserAuth=!0,e.supportsPairWiseBroker=!1;var s=i((function(r,i){return __awaiter(this,void 0,void 0,(function(){var o,s;return __generator(this,(function(c){switch(c.label){case 0:return o=Date.now(),e.supportsBrowserAuth?[4,a()]:[2,Promise.reject({code:"PackageNotLoaded"})];case 1:return s=c.sent(),[2,new Promise((function(a,c){try{var l="msa"===s.authorityType.toLowerCase(),f=!0===e.supportsPairWiseBroker?OSF.pairwiseBrokerConfig:void 0,d=null!=f&&!0===f.enabled,p=null!=f?f.trustedBrokerDomain:void 0;if(OSF.WebAuth.config={authFlow:e.authFlow,authVersion:e.authVersion?e.authVersion:null,msal:e.msal,delayWebAuth:e.delay,delayMsal:e.delayMsal,debugging:e.debugging,useMsal3:e.useMsal3,useMsal5:e.useMsal5,enableLegacyPolling:e.enableLegacyPolling,authority:e.authorityOverride?e.authorityOverride:s.authority,idp:s.authorityType.toLowerCase(),appIds:[l&&s.msaAppId?s.msaAppId:s.appId],redirectUri:r||null,upn:s.upn,puid:s.userId,prefetch:i,telemetryInstance:"otel",autoPopup:e.autoPopup,enableUpnCheck:e.upnCheck,enableConsoleLogging:e.debugging,tenantId:s.tenantId,timeout:e.timeout,clientCapabilities:e.clientCapabilities,usePairwiseBroker:d,trustedBrokerDomain:p},OSF.WebAuth.load().then((function(e){u(e,n=!0,o),a()})).catch((function(e){c({code:"PackageNotLoaded",message:e instanceof Event?e.type:e,telemetryResult:e})})),"implicit"===e.authFlow){var m=r||window.location.href.split("?")[0],g=sessionStorage.getItem(t);g||""===g?g=m:g+=", "+m,g&&sessionStorage.setItem(t,g)}}catch(e){OSF.WebAuth.config=null,OSF.WebAuth.load().then((function(){a()})).catch((function(){c({code:"FailedToLoad",message:e})}))}}))]}}))}))}));var c=i((function(t,n){return __awaiter(this,void 0,void 0,(function(){var r,i,a;return __generator(this,(function(c){switch(c.label){case 0:if(!OSF.WebAuth||"web"!=OSF._OfficeAppFactory.getHostInfo().hostPlatform)return[3,6];r=Date.now(),c.label=1;case 1:return c.trys.push([1,5,,6]),s.delayCall(t,n),[4,o(e.supportsOauthManager)];case 2:return c.sent()?[3,4]:[4,s.waitForPromise()];case 3:c.sent(),c.label=4;case 4:return[3,6];case 5:throw i=c.sent(),u((a=i).result,!1,r,a),delete a.result,delete a.loggableErrorMessage,a;case 6:return[2]}}))}))}));function l(e,t){return c.immediateCall(e,t)}function u(e,t,n,r){var i=Date.now()-n;void 0!==OTel&&OTel.OTelLogger.onTelemetryLoaded((function(){var n=OSF.WebAuth.config?[oteljs.makeStringDataField("IdentityProvider",OSF.WebAuth.config.idp),oteljs.makeStringDataField("AppId",OSF.WebAuth.config.appIds[0]),oteljs.makeStringDataField("Target",{authFlow:OSF.WebAuth.config.authFlow,authVersion:OSF.WebAuth.config.authVersion,msal:OSF.WebAuth.config.msal,autoPopup:OSF.WebAuth.config.autoPopup,enableUpnCheck:OSF.WebAuth.config.upnCheck}),oteljs.makeBooleanDataField("UseMsal3",!0===OSF.WebAuth.config.useMsal3),oteljs.makeBooleanDataField("UseMsal5",!0===OSF.WebAuth.config.useMsal5),oteljs.makeStringDataField("MsalVersion",OSF.WebAuth.msalVersion||""),oteljs.makeBooleanDataField("UsePairwiseBroker",!0===OSF.WebAuth.config.usePairwiseBroker)]:[],o=r&&r.loggableErrorMessage?r.loggableErrorMessage:"",a=t?[]:[oteljs.makeStringDataField("ApiErrorCode",r&&r.code?r.code:""),oteljs.makeStringDataField("Error",o||(e instanceof Event?e.type:""))],s=n.concat(a,[oteljs.makeBooleanDataField("Result",t),oteljs.makeInt64DataField("Duration",Math.round(i))]);if(e&&!(e instanceof Event)&&e.Telemetry)for(var c in e.Telemetry)if(e.Telemetry[c])switch(c){case"succeeded":s.push(oteljs.makeBooleanDataField(c,e.Telemetry[c]));break;case"loadedApplicationCount":case"timeToLoad":s.push(oteljs.makeInt64DataField(c,e.Telemetry[c]));break;default:s.push(oteljs.makeStringDataField(c,e.Telemetry[c]))}OTel.OTelLogger.sendTelemetryEvent({eventName:"Office.Extensibility.OfficeJs.OfficeFirstPartyAuth.Load",dataFields:s,eventFlags:{dataCategories:oteljs.DataCategories.ProductServiceUsage}})}))}function f(e,t,n,r,i,o){var a=Date.now()-r;void 0!==OTel&&OTel.OTelLogger.onTelemetryLoaded((function(){var r=OSF.WebAuth.config?[oteljs.makeStringDataField("IdentityProvider",OSF.WebAuth.config.idp),oteljs.makeStringDataField("AppId",OSF.WebAuth.config.appIds[0]),oteljs.makeStringDataField("Target",{authFlow:OSF.WebAuth.config.authFlow,authVersion:OSF.WebAuth.config.authVersion,msal:OSF.WebAuth.config.msal,autoPopup:OSF.WebAuth.config.autoPopup,enableUpnCheck:OSF.WebAuth.config.upnCheck}),oteljs.makeBooleanDataField("UseMsal5",!0===OSF.WebAuth.config.useMsal5),oteljs.makeStringDataField("MsalVersion",OSF.WebAuth.msalVersion||""),oteljs.makeBooleanDataField("UsePairwiseBroker",!0===OSF.WebAuth.config.usePairwiseBroker)]:[],s="";e instanceof Event?s=e.type||"":e&&(s=e.ErrorCode||e.code||"");var c=r.concat([oteljs.makeStringDataField("CorrelationId",n),oteljs.makeBooleanDataField("Popup","boolean"==typeof i&&i),oteljs.makeBooleanDataField("Result",t),oteljs.makeStringDataField("Error",s),oteljs.makeBooleanDataField("UseOauthManager",!0===o),oteljs.makeInt64DataField("Duration",Math.round(a))]);if(e&&!(e instanceof Event)&&e.Telemetry)for(var l in e.Telemetry)if(e.Telemetry[l])switch(l){case"succeeded":c.push(oteljs.makeBooleanDataField(l,e.Telemetry[l]));break;case"timeToGetToken":c.push(oteljs.makeInt64DataField(l,e.Telemetry[l]));break;default:c.push(oteljs.makeStringDataField(l,e.Telemetry[l]))}OTel.OTelLogger.sendTelemetryEvent({eventName:"Office.Extensibility.OfficeJs.OfficeFirstPartyAuth.GetAccessToken",dataFields:c,eventFlags:{dataCategories:oteljs.DataCategories.ProductServiceUsage}})}))}e.load=l,e.getAccessToken=function(e,t){var r=this,i=Date.now();return c.waitForPromise().then((function(){return new Promise((function(a,c){return __awaiter(r,void 0,void 0,(function(){var r,l,u,d,p,m,g,h,y,v,O,S;return __generator(this,(function(b){switch(b.label){case 0:return b.trys.push([0,12,,13]),"web"!=OSF._OfficeAppFactory.getHostInfo().hostPlatform?[3,8]:[4,o(!!e.appName)];case 1:return b.sent()?[3,3]:[4,s.waitForPromise()];case 2:return b.sent(),OSF.WebAuth&&n?(r=e.correlationId||OSF._OfficeAppFactory.getHostInfo().osfControlAppCorrelationId,OSF.WebAuth.config.appIds[0]&&OSF.WebAuth.getToken(e.resource,null,OSF.WebAuth.config.appIds[0],r,t&&t.popup?t.popup:null,e&&e.authChallenge?e.authChallenge:null).then((function(e){f(e,!0,r,i,!(!t||!t.popup)&&t.popup),a({accessToken:e.Token,tokenIdenityType:"msa"==OSF.WebAuth.config.idp.toLowerCase()?OfficeCore.IdentityType.microsoftAccount:OfficeCore.IdentityType.organizationAccount})})).catch((function(e){f(e,!1,r,i,!(!t||!t.popup)&&t.popup),c({code:e.ErrorCode,message:e instanceof Event?e.type:e.ErrorMessage})}))):(_=n,A=OSF.WebAuth.loadAttempts,void 0!==OTel&&OTel.OTelLogger.onTelemetryLoaded((function(){var e=[oteljs.makeBooleanDataField("Loaded",_),oteljs.makeInt64DataField("LoadAttempts","number"==typeof A?A:0)];OTel.OTelLogger.sendTelemetryEvent({eventName:"Office.Extensibility.OfficeJs.OfficeFirstPartyAuth.UnexpectedAcquire",dataFields:e,eventFlags:{dataCategories:oteljs.DataCategories.ProductServiceUsage}})}))),[3,7];case 3:l=new OfficeCore.RequestContext,h=OfficeCore.AuthenticationService.newObject(l),l._customData="WacPartition",u=!!e.appName,d=e.correlationId,b.label=4;case 4:return b.trys.push([4,6,,7]),p=h.getAccessToken(e,null),[4,l.sync()];case 5:return b.sent(),u&&f(p.value,!0,d,i,void 0,!0),a(p.value),[3,7];case 6:throw m=b.sent(),u&&f(m,!1,d,i,void 0,!0),m;case 7:return[3,11];case 8:return g=new OfficeCore.RequestContext,h=OfficeCore.AuthenticationService.newObject(g),y=h.onTokenReceived.add((function(e){if(!OfficeExtension.CoreUtility.isNullOrUndefined(e))if(y.remove(),g.sync().catch((function(){})),0==e.code)a(e.tokenValue);else if(OfficeExtension.CoreUtility.isNullOrUndefined(e.errorInfo))c({code:e.code});else try{c(JSON.parse(e.errorInfo))}catch(t){c({code:e.code,message:e.errorInfo})}return null})),[4,g.sync()];case 9:return b.sent(),v=h.getAccessToken(e,h._targetId),[4,g.sync()];case 10:if(b.sent(),OfficeExtension.CoreUtility.isNullOrUndefined(v.value))return[2,null];O=v.value.accessToken,OfficeExtension.CoreUtility.isNullOrUndefined(O)||a(v.value),b.label=11;case 11:return[3,13];case 12:return S=b.sent(),c(S),[3,13];case 13:return[2]}var _,A}))}))}))}))},e.getPrimaryIdentityInfo=function(){var e=new OfficeCore.RequestContext,t=OfficeCore.AuthenticationService.newObject(e);e._customData="WacPartition";var n=t.getPrimaryIdentityInfo();return e.sync().then((function(){return n.value}))},e.getIdentities=function(){var e=new OfficeCore.RequestContext,t=OfficeCore.AuthenticationService.newObject(e).getIdentities();return e.sync().then((function(){return t.value}))},e.onIdentityChanged=function(e){return __awaiter(this,void 0,void 0,(function(){var t,n,r=this;return __generator(this,(function(i){switch(i.label){case 0:return i.trys.push([0,3,,4]),"web"===OSF._OfficeAppFactory.getHostInfo().hostPlatform?[3,2]:(t=new OfficeCore.RequestContext,n=OfficeCore.AuthenticationService.newObject(t),n.onIdentityChanged.add(e),[4,t.sync()]);case 1:return i.sent(),[2,function(){return __awaiter(r,void 0,void 0,(function(){return __generator(this,(function(r){switch(r.label){case 0:return n.onIdentityChanged.remove(e),[4,t.sync()];case 1:return r.sent(),[2]}}))}))}];case 2:return[3,4];case 3:return i.sent(),[3,4];case 4:return[2,function(){return Promise.resolve()}]}}))}))},"undefined"!=typeof window&&window.OSF&&function(){try{if("undefined"==typeof window||!window.sessionStorage)return;var e=sessionStorage.getItem(t);null!==e&&-1!==e.indexOf(window.location.origin+window.location.pathname)&&l()}catch(e){console.error(e)}}()}(OfficeFirstPartyAuth||(OfficeFirstPartyAuth={})),function(e){!function(e){var t,n;!function(e){e[e.None=0]="None",e[e.Auto=1]="Auto",e[e.Force=2]="Force"}(t=e.PopupOptions||(e.PopupOptions={})),function(e){e[e.UnsupportedUserIdentity=13003]="UnsupportedUserIdentity",e[e.UserAborted=13004]="UserAborted",e[e.InteractionRequired=13005]="InteractionRequired",e[e.ClientError=13006]="ClientError",e[e.ServerError=13007]="ServerError",e[e.NotAvailable=13012]="NotAvailable",e[e.PopupAuthFlowNotSupported=13014]="PopupAuthFlowNotSupported",e[e.InternalError=5001]="InternalError",e[e.InvalidApiArguments=5013]="InvalidApiArguments"}(n=e.AuthErrorCode||(e.AuthErrorCode={}));var r={ACCOUNT_UNAVAILABLE:n.UnsupportedUserIdentity,USER_CANCEL:n.UserAborted,USER_INTERACTION_REQUIRED:n.InteractionRequired,PERSISTENT_ERROR:n.ClientError,NO_NETWORK:n.ServerError,TRANSIENT_ERROR:n.ServerError,NESTED_APP_AUTH_UNAVAILABLE:n.NotAvailable},i={POPUP_WINDOW_ERROR:n.ClientError,USER_CANCELLED:n.UserAborted,POPUP_AUTH_FLOW_NOT_SUPPORTED:n.PopupAuthFlowNotSupported},o="access_token",a="xms_cc",s=0,c=!1,l={};function u(e){return l[e]||(l[e]={loaded:!1,usePairwiseBroker:!1}),l[e]}var f=void 0;e.clientCapabilities=[],e.upnCheck=!0,e.timeout=void 0,e.msal="https://alcdn.msauth.net/browser-1p/2.28.1/js/msal-browser-1p.min.js",e.debugging=!1,e.delay=0,e.delayMsal=0,e.useMsal3=void 0,e.useMsal5=void 0,e.enableLegacyPolling=!1;var d=void 0,p={},m=function(e){try{var t="string"==typeof e?e:e.data,i=JSON.parse(t);if(i.requestId){var o=i.requestId;if(p.hasOwnProperty(o)){var a=n.InternalError,s=p[o],c=s[0],l=s[1];delete p[o];var u=i.token;if(u&&!0===i.success&&u.access_token&&"number"==typeof u.expires_in)return void c({accessToken:u.access_token,idToken:u.id_token,expiresOn:new Date(Date.now()+1e3*u.expires_in)});var f=i.error;if(f){var d=f.status;r[d]&&(a=r[d])}l({code:a})}}}catch(e){}},g={code:n.NotAvailable};function h(t){if(0===e.clientCapabilities.length)return t;var n={};if(t)try{n=JSON.parse(t)}catch(e){}return n.hasOwnProperty(o)||(n[o]={}),n[o][a]={values:e.clientCapabilities},JSON.stringify(n)}function y(t,r){var o=t.clientId||f;if(!o)return Promise.reject({code:n.InvalidApiArguments});var a=t.correlationId||OSF.OUtil.Guid.generateNewGuid(),l=Date.now(),d=null,y=function(t){var n=function(t,n){var i=Date.now()-l;!function(t,n,r,i,o,a,c){if(s>0&&!r)return;s++,void 0!==OTel&&OTel.OTelLogger.onTelemetryLoaded((function(){var o=O(),s="";!o&&OSF.WebAuth&&OSF.WebAuth.msalVersion&&(s=OSF.WebAuth.msalVersion);var l=[oteljs.makeStringDataField("NestedClientId",t),oteljs.makeStringDataField("CorrelationId",n),oteljs.makeBooleanDataField("Popup",r),oteljs.makeInt64DataField("Duration",i),oteljs.makeInt64DataField("ErrorCode",a?a.code:0),oteljs.makeBooleanDataField("BridgeAvailable",o),oteljs.makeBooleanDataField("UseMsal5",!0===e.useMsal5),oteljs.makeStringDataField("MsalVersion",s),oteljs.makeBooleanDataField("UsePairwiseBroker",!0===u(t).usePairwiseBroker)];c&&(c.errorCode&&l.push(oteljs.makeStringDataField("WebAuthErrorCode",c.errorCode)),c.errorMessage&&l.push(oteljs.makeStringDataField("WebAuthErrorMessage",c.errorMessage))),OTel.OTelLogger.sendTelemetryEvent({eventName:"Office.Extensibility.OfficeJs.NestedAppAuth.GetAccessToken",dataFields:l,eventFlags:{dataCategories:oteljs.DataCategories.ProductServiceUsage,diagnosticLevel:oteljs.DiagnosticLevel.NecessaryServiceDataEvent}})}))}(o,a,r,i,0,n,d)};return t.then((function(e){n(0,null)})).catch((function(e){n(0,e)})),t};if(O())return y(new Promise((function(e,n){var i=OSF.OUtil.Guid.generateNewGuid(),s=t.scopes.join(" "),l={messageType:"NestedAppAuthRequest",method:r?"GetTokenPopup":"GetToken",requestId:i,clientLibrary:"officejs",sendTime:Date.now(),tokenParams:{clientId:o,scope:s,correlationId:a,claims:h(t.claims)}};c||(nestedAppAuthBridge.addEventListener("message",m),c=!0),p[i]=[e,n],nestedAppAuthBridge.postMessage(JSON.stringify(l))})));var v=u(o);return v.loadPromise?y(v.loadPromise.then((function(){if(!v.loaded)return Promise.reject(g);var e=t.scopes.join(" ");return e=e.replace(/(\/.default)$/,""),OSF.WebAuth.getToken(e,t.scopes,o,a,r,t.claims).then((function(e){return e&&(d=e.Telemetry),{accessToken:e.Token,expiresOn:e.MsalResult?e.MsalResult.expiresOn:void 0}})).catch((function(e){var t=n.InternalError,r=void 0;if(e)if(r=e.ErrorMessage,d=e.Telemetry,e.MsalResult&&"InteractionRequiredAuthError"===e.MsalResult.name)t=n.InteractionRequired;else if(e.ErrorCode){var o=e.ErrorCode.toUpperCase();i[o]&&(t=i[o])}return Promise.reject({code:t,description:r})}))}))):y(Promise.reject(g))}function v(){return O()||"function"!=typeof __initializeNestedAppAuth?Promise.resolve():__initializeNestedAppAuth()}function O(){return"undefined"!=typeof nestedAppAuthBridge}function S(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:return[4,v()];case 1:return e.sent(),[2,O()]}}))}))}e.isBridgeAvailable=O,e.isBridgeAvailableAsync=S,e.load=function(t,n,r,i,o){var a=u(t);return a.loadPromise=a.loadPromise||function(t,n,r,i,o){return __awaiter(this,void 0,void 0,(function(){var a,s,c,l,p,m,h;return __generator(this,(function(y){switch(y.label){case 0:return f=t,a=i||e.clientCapabilities,i&&0===e.clientCapabilities.length&&(e.clientCapabilities=i),Office&&Office.context&&Office.context.auth&&OSF.WebAuth?[4,S()]:[2];case 1:return y.sent()?[2]:(d||(d=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){return[2,new Promise((function(e){Office.context.auth.getAuthContextAsync((function(t){"succeeded"===t.status?e(t.value):e(null)}))})).catch((function(){return null}))]}))}))}()),[4,d]);case 2:if(!(s=y.sent()))throw g;OSF.WebAuth.config={authFlow:"authcode",authVersion:e.authVersion?e.authVersion:null,msal:e.msal,delayWebAuth:e.delay,delayMsal:e.delayMsal,debugging:e.debugging,useMsal3:e.useMsal3,useMsal5:e.useMsal5,enableLegacyPolling:e.enableLegacyPolling,authority:e.authorityOverride?e.authorityOverride:s.authorityBaseUrl,idp:"msa"===s.authorityType.toLowerCase()?"msa":"aad",appIds:[t],redirectUri:n||null,upn:s.userPrincipalName,prefetch:r,telemetryInstance:"otel",enableUpnCheck:e.upnCheck,enableConsoleLogging:e.debugging,checkActiveAccount:!0,tenantId:s.tenantId,timeout:e.timeout,clientCapabilities:a},c=OSF.pairwiseBrokerConfig,l=!0===o&&null!=c&&!0===c.enabled,p=null!=c?c.trustedBrokerDomain:void 0,(m=u(t)).usePairwiseBroker=l,y.label=3;case 3:return y.trys.push([3,5,,6]),[4,OSF.WebAuth.load({appIds:[t],redirectUri:n||null,prefetch:r,clientCapabilities:a,usePairwiseBroker:l,trustedBrokerDomain:p})];case 4:return y.sent(),m.loaded=!0,[3,6];case 5:throw h=y.sent(),__assign({},g,{description:h instanceof Event?h.type:void 0});case 6:return[2]}}))}))}(t,n,r,i,o),a.loadPromise},e.getAccessToken=function(e){var r=null==e.popup?t.None:e.popup;if(r===t.Auto&&!e.directUserActionCallback)throw{code:n.InvalidApiArguments};return v().then((function(){return y(e,r===t.Force).catch((function(i){if(i.code==n.InteractionRequired&&r===t.Auto&&e.directUserActionCallback)return e.directUserActionCallback().then((function(t){if(t)return y(e,!0);throw{code:n.UserAborted}})).catch((function(){throw{code:n.UserAborted}}));throw i}))}))}}(e.NestedAppAuth||(e.NestedAppAuth={}))}(OfficeFirstPartyAuth||(OfficeFirstPartyAuth={})),function(e){var t;OfficeExtension.BatchApiHelper.createPropertyObject,OfficeExtension.BatchApiHelper.createMethodObject,OfficeExtension.BatchApiHelper.createIndexerObject,OfficeExtension.BatchApiHelper.createRootServiceObject,OfficeExtension.BatchApiHelper.createTopLevelServiceObject,OfficeExtension.BatchApiHelper.createChildItemObject,OfficeExtension.BatchApiHelper.invokeMethod,OfficeExtension.BatchApiHelper.invokeEnsureUnchanged,OfficeExtension.BatchApiHelper.invokeSetProperty,OfficeExtension.Utility.isNullOrUndefined,OfficeExtension.Utility.isUndefined,OfficeExtension.Utility.throwIfNotLoaded,OfficeExtension.Utility.throwIfApiNotSupported,OfficeExtension.Utility.load,OfficeExtension.Utility.retrieve,OfficeExtension.Utility.toJson,OfficeExtension.Utility.fixObjectPathIfNecessary,OfficeExtension.Utility._handleNavigationPropertyResults,OfficeExtension.Utility.adjustToDateTime,OfficeExtension.Utility.processRetrieveResult,OfficeExtension.Utility.setMockData,OfficeExtension.CommonUtility.calculateApiFlags;!function(e){e.LicenseFeature_StateChanged_EventArgsTransform=function(e,t){var n={feature:t.featureName,isEnabled:t.isEnabled,tier:t.tierName};return t.tierName&&(n.tier=0==t.tierName?LicenseFeatureTier.unknown:1==t.tierName?LicenseFeatureTier.basic:2==t.tierName?LicenseFeatureTier.premium:t.tierName),n}}(e._CC||(e._CC={})),function(e){e.ThemeService_OfficeThemeChanged_EventArgsTransform=function(e,t){return{bodyBackgroundColor:t.bodyBackgroundColor,bodyForegroundColor:t.bodyForegroundColor,controlBackgroundColor:t.controlBackgroundColor,controlForegroundColor:t.controlForegroundColor,themeId:t.themeId,isDarkTheme:t.isDarkTheme,fluentThemeData:t.fluentThemeData}}}(e._CC||(e._CC={})),function(e){e[e.immediate=0]="immediate",e[e.load=3]="load"}(t=e.PersonaPromiseType||(e.PersonaPromiseType={}));var n=function(){};e.PersonaInfoAndSource=n;var r=function(){function r(){}return r.prototype.performAsyncOperation=function(e,n,r,i){var o=this;e!=t.immediate?i().then((function(e){if(e)r();else{var t=o;t.load("hostId"),t.context.sync().then((function(){var e=t.hostId;o.getPersonaLifetime().then((function(o){var a=function(s){return new OfficeExtension.CoreUtility.Promise((function(c,l){if(s.sendingPersonaHostId==e)for(var u=0;u<s.dataUpdated.length;++u){var f=s.dataUpdated[u];if(n==f)return void i().then((function(e){e&&(r(),o.onPersonaUpdated.remove(a),t.context.sync()),c(e)}))}c(!1)}))};o.onPersonaUpdated.add(a),t.context.sync()}))}))}})):r()},r.prototype.getOrganizationAsync=function(e){var t=this;return new OfficeExtension.CoreUtility.Promise((function(n,r){var i=t;t.performAsyncOperation(e,PersonaDataUpdated.organization,(function(){var e=i.organization;e.load("*"),i.context.sync().then((function(){n(e)}))}),(function(){return new OfficeExtension.CoreUtility.Promise((function(e,t){var n=i.organization;n.load("isWarmedUp"),i.context.sync().then((function(){e(n.isWarmedUp)}))}))}))}))},r.prototype.getIsPersonaInfoResolvedCheck=function(){var e=this;return new OfficeExtension.CoreUtility.Promise((function(t,n){var r=e.personaInfo;r.load("isPersonResolved"),e.context.sync().then((function(){t(r.isPersonResolved)}))}))},r.prototype.getPersonaInfoAsync=function(e){var t=this;return new OfficeExtension.CoreUtility.Promise((function(n,r){var i=t;t.performAsyncOperation(e,PersonaDataUpdated.personaInfo,(function(){var e=i.personaInfo;e.load(),i.context.sync().then((function(){n(e)}))}),(function(){return t.getIsPersonaInfoResolvedCheck()}))}))},r.prototype.getPersonaInfoWithSourceAsync=function(e){var t=this;return new OfficeExtension.CoreUtility.Promise((function(r,i){var o=t;t.performAsyncOperation(e,PersonaDataUpdated.personaInfo,(function(){var e=new n;e.info=o.personaInfo,e.info.load(),e.source=o.personaInfo.sources,e.source.load(),o.context.sync().then((function(){r(e)}))}),(function(){return t.getIsPersonaInfoResolvedCheck()}))}))},r.prototype.getUnifiedCommunicationInfo=function(e){var t=this;return new OfficeExtension.CoreUtility.Promise((function(n,r){var i=t;t.performAsyncOperation(e,PersonaDataUpdated.personaInfo,(function(){var e=i.unifiedCommunicationInfo;e.load("*"),i.context.sync().then((function(){n(e)}))}),(function(){return t.getIsPersonaInfoResolvedCheck()}))}))},r.prototype.getUnifiedGroupInfoAsync=function(e){var t=this;return new OfficeExtension.CoreUtility.Promise((function(n,r){var i=t;t.performAsyncOperation(e,PersonaDataUpdated.personaInfo,(function(){var e=i.unifiedGroupInfo;e.load("*"),i.context.sync().then((function(){n(e)}))}),(function(){return t.getIsPersonaInfoResolvedCheck()}))}))},r.prototype.getTypeAsync=function(t){var n=this;return new OfficeExtension.CoreUtility.Promise((function(r,i){var o=n;n.performAsyncOperation(t,PersonaDataUpdated.personaInfo,(function(){o.load("type"),o.context.sync().then((function(){r(e.PersonaType[o.type.valueOf()])}))}),(function(){return n.getIsPersonaInfoResolvedCheck()}))}))},r.prototype.getCustomizationsAsync=function(e){var t=this;return new OfficeExtension.CoreUtility.Promise((function(n,r){var i=t;t.performAsyncOperation(e,PersonaDataUpdated.personaInfo,(function(){var e=i.getCustomizations();i.context.sync().then((function(){n(e.value)}))}),(function(){return t.getIsPersonaInfoResolvedCheck()}))}))},r.prototype.getMembersAsync=function(e){var t=this;return new OfficeExtension.CoreUtility.Promise((function(n,r){var i=t;t.performAsyncOperation(e,PersonaDataUpdated.members,(function(){var e=i.getMembers();e.load("isWarmedUp"),i.context.sync().then((function(){n(e)}))}),(function(){return new OfficeExtension.CoreUtility.Promise((function(e,t){var n=i.getMembers();n.load("isWarmedUp"),i.context.sync().then((function(){e(n.isWarmedUp)}))}))}))}))},r.prototype.getMembershipAsync=function(e){var t=this;return new OfficeExtension.CoreUtility.Promise((function(n,r){var i=t;t.performAsyncOperation(e,PersonaDataUpdated.membership,(function(){var e=i.getMembership();e.load("*"),i.context.sync().then((function(){n(e)}))}),(function(){return new OfficeExtension.CoreUtility.Promise((function(e){var t=i.getMembership();t.load("isWarmedUp"),i.context.sync().then((function(){e(t.isWarmedUp)}))}))}))}))},r.prototype.getPersonaLifetime=function(){var e=this;return new OfficeExtension.CoreUtility.Promise((function(t,n){var r=e;r.load("instanceId"),r.context.sync().then((function(){new i(r.context,r.instanceId).getPersonaLifetime().then((function(e){t(e)}))}))}))},r}();e.PersonaCustom=r;var i=function(){function t(e,t){this.context=e,this.instanceId=t}return Object.defineProperty(t.prototype,"serviceContext",{get:function(){return this.m_serviceConext||(this.m_serviceConext=e.ServiceContext.newObject(this.context)),this.m_serviceConext},enumerable:!0,configurable:!0}),t.prototype.getPersonaLifetime=function(){var e=this;return new OfficeExtension.CoreUtility.Promise((function(t,n){var r=e.serviceContext.getPersonaLifetime(e.instanceId);e.context.sync().then((function(){r.load("instanceId"),e.context.sync().then((function(){t(r)}))}))}))},t.prototype.getInitialPersona=function(){var e=this;return new OfficeExtension.CoreUtility.Promise((function(t,n){var r=e.serviceContext.getInitialPersona(e.instanceId);e.context.sync().then((function(){t(r)}))}))},t.prototype.getLokiTokenProvider=function(){var e=this;return new OfficeExtension.CoreUtility.Promise((function(t,n){var r=e.serviceContext.getLokiTokenProvider(e.instanceId);e.context.sync().then((function(){r.load("instanceId"),e.context.sync().then((function(){t(r)}))}))}))},t}();e.PeopleApiContext=i,function(e){e.FirstPartyDialogService_DialogMessage_EventArgsTransform=function(e,t){return{message:t.message}}}(e._CC||(e._CC={}));var o=function(){function e(){}return Object.defineProperty(e.prototype,"_targetId",{get:function(){return null==this.m_targetId&&(void 0!==OSF&&OSF.OUtil?this.m_targetId=OSF.OUtil.Guid.generateNewGuid():this.m_targetId=""+this.context._nextId()),this.m_targetId},enumerable:!0,configurable:!0}),e}();e.AuthenticationServiceCustom=o,function(e){e.AuthenticationService_TokenReceived_EventArgsTransform=function(e,t){var n=t;return{tokenValue:n.tokenValue,code:n.code,errorInfo:n.errorInfo}}}(e._CC||(e._CC={})),function(e){e.ExternalCodeService_ExternalCodeExecutionCompleted_EventArgsTransform=function(e,t){return{result:t.result}},e.ExternalCodeService_ExternalCodeServiceRequestCompleted_EventArgsTransform=function(e,t){return t},e.ExternalCodeService_ExternalCodeServiceResult_EventArgsTransform=function(e,t){return t}}(e._CC||(e._CC={})),function(e){e.AddinSkillActionService_ReplyReceived_EventArgsTransform=function(e,t){return{actionCorrelationId:t.actionCorrelationId,replyMessage:t.replyMessage,resultCode:t.resultCode}}}(e._CC||(e._CC={})),function(e){e.apiNotAvailable="ApiNotAvailable",e.clientError="ClientError",e.clpSessionError="ClpSessionError",e.controlIdNotFound="ControlIdNotFound",e.docCookieError="DocCookieError",e.entryIdRequired="EntryIdRequired",e.errorPointer="ErrorPointer",e.generalException="GeneralException",e.hostIntegrationManagerError="HostIntegrationManagerError",e.hostRestartNeeded="HostRestartNeeded",e.instanceNotFound="InstanceNotFound",e.interactiveFlowAborted="InteractiveFlowAborted",e.invalidArgument="InvalidArgument",e.invalidGrant="InvalidGrant",e.invalidResourceUrl="InvalidResourceUrl",e.invalidRibbonDefinition="InvalidRibbonDefinition",e.labelingDisabledAppguard="LabelingDisabledAppguard",e.labelingDisabledNoSignedInClpCompatibleUsers="LabelingDisabledNoSignedInClpCompatibleUsers",e.labelingDisabledPrivacySettings="LabelingDisabledPrivacySettings",e.labelingDisabledProtectedView="LabelingDisabledProtectedView",e.labelingDisabledUnsupportedLabelClient="LabelingDisabledUnsupportedLabelClient",e.msoOLDocumentError="MsoOLDocumentError",e.notImplement="NotImplement",e.objectNotFound="ObjectNotFound",e.officeJSItemLabelForIdentityError="OfficeJSItemLabelForIdentityError",e.officeJSRMSLicenseError="OfficeJSRMSLicenseError",e.officeJSSessionOrDocError="OfficeJSSessionOrDocError",e.officeSolutionFrameworkHostError="OfficeSolutionFrameworkHostError",e.omworkflowUserNotFound="OMWorkflowUserNotFound",e.osfControlContainerError="OsfControlContainerError",e.outOfMemory="OutOfMemory",e.resourceNotSupported="ResourceNotSupported",e.sensitivityDocumentReadOnly="SensitivityDocumentReadOnly",e.sensitivityInsufficientPermission="SensitivityInsufficientPermission",e.sensitivityLabelDisabled="SensitivityLabelDisabled",e.sensitivityLabelingDisabled="SensitivityLabelingDisabled",e.sensitivityLabelNotFound="SensitivityLabelNotFound",e.sensitivityNewLabelSensitivityOrder="SensitivityNewLabelSensitivityOrder",e.sensitivityUnsupportedContentType="SensitivityUnsupportedContentType",e.sensitivityUnsupportedCrossTenant="SensitivityUnsupportedCrossTenant",e.sensitivityUnsupportedDke="SensitivityUnsupportedDke",e.sensitivityUnsupportedUdp="SensitivityUnsupportedUdp",e.serverError="ServerError",e.serviceUrlNotFound="ServiceUrlNotFound",e.sharedRuntimeNotAvailable="SharedRuntimeNotAvailable",e.ticketInvalidParams="TicketInvalidParams",e.ticketNetworkError="TicketNetworkError",e.ticketUnauthorized="TicketUnauthorized",e.ticketUninitialized="TicketUninitialized",e.ticketUnknownError="TicketUnknownError",e.unexpectedError="UnexpectedError",e.unsupportedUserIdentity="UnsupportedUserIdentity",e.userNotSignedIn="UserNotSignedIn"}(e.ErrorCodes||(e.ErrorCodes={})),e.Interfaces||(e.Interfaces={});new OfficeExtension.LibraryBuilder({metadata:{version:"1.0.0",name:"OfficeCore",defaultApiSetName:"OfficeSharedApi",hostName:"Office",apiSets:[["1.2","SharedApiUndo"],["1.2","SharedRuntimeInternal"],["1.1","SnapshotControl"],["1.1","SharedApiUndo"],["1.4","SharedApiUndo"],["1.2","DynamicRibbon"],["1.4","DynamicRibbon"],["1.6","DynamicRibbon"],["1.1","DynamicRibbonUndo"],["1.3","DynamicRibbon"],["1.5","DynamicRibbon"],["1.2","FirstPartyAuthentication"],["1.3","FirstPartyAuthentication"],["1.5","FirstPartyAuthentication"],["1.2","ApiVersion"],["1.1","SensitivityUndo"],["1.2","SensitivityService"],["1.2","SensitivityUndo"],["1.3","SensitivityService"],["1.3","SensitivityUndo"],["1.3","SharedApiUndo"],["1.2","CopilotService"],["1.1","PrivateAPI"],["1.1","ExternalCodeServiceUndo"],["1.1","TaskPaneApi"]],strings:["DialogPage","License","LicenseFeature","MsaDeviceTicketOptions","AppRuntimePersistenceService","AppRuntimeService","ThemeService","Tap","MemberInfoList","PersonaActions","PersonaInfoSource","PersonaInfo","PersonaUnifiedCommunicationInfo","PersonaPhotoInfo","PersonaCollection","PersonaOrganizationInfo","UnifiedGroupInfo","Persona","PersonaLifetime","LokiTokenProvider","LokiTokenProviderFactory","ServiceContext","RichapiPcxFeatureChecks","Comment","CommentCollection","ExtensionLifeCycle","OfficeServicesManagerApi","LocaleApi","FirstPartyDialogService","DynamicRibbon","RibbonTab","RibbonButton","RibbonButtonCollection","ServiceUrlProvider","LinkedIn","NetworkUsage","BeforeDocumentCloseNotification","AuthenticationService","RoamingSetting","RoamingSettingCollection","ApiVersionService","SharedFilePicker","ActionService","Auth","AugLoopEventService","UndoService","UserFeedbackService","NotificationService","SensitivityService","CopilotService","PrivateApiService","ExternalCodeService","BusinessBarService","ShowSimpleDialog","DispatchApiService","DevicePermissionService","DimeEventHandlers","Dime","TaskpaneService","AddinSkillActionService","UnifiedStoreService","SdxMessaging","HostMcpService","close","registerOnShow","unregisterOnShow","id","_RegisterStateChange","_UnregisterStateChange","","null","registerOfficeThemeChangedEvent","unregisterOfficeThemeChangedEvent","isWarmedUp","isWarmingUp","displayName","email","emailAddresses","sipAddresses","birthday","birthdays","title","jobInfoDepartment","companyName","office","linkedTitles","linkedDepartments","linkedCompanyNames","linkedOffices","webSites","notes","getImageUri","setPlaceholderColor","getPlaceholderUri","getImageUriWithMetadata","getCount","getItem","instanceId","dispose","_RegisterPersonaUpdatedEvent","_UnregisterPersonaUpdatedEvent","this.instanceId","_RegisterLokiTokenAvailableEvent","_UnregisterLokiTokenAvailableEvent","_RegisterIdentityUniqueIdAvailableEvent","_UnregisterIdentityUniqueIdAvailableEvent","_RegisterClientAccessTokenAvailableEvent","_UnregisterClientAccessTokenAvailableEvent","getLokiTokenProvider","registerIdentityChangedEvent","unregisterIdentityChangedEvent","sendMessage","_RegisterHostMessageReceivedEvent","_UnregisterHostMessageReceivedEvent","_RegisterUndoStackChangedEvent","_UnregisterUndoStackChangedEvent","_RegisterUserFeedbackUIDismissedEvent","_UnregisterUserFeedbackUIDismissedEvent","_RegisterUserFeedbackResponseEvent","_UnregisterUserFeedbackResponseEvent","_RegisterSensitivityLabelChangedEvent","_UnregisterSensitivityLabelChangedEvent","execute","_RegisterPrivateApiEvent","_UnregisterPrivateApiEvent","registerExternalCodeExecutionCompletedEvent","unregisterExternalCodeExecutionCompletedEvent","registerExternalCodeServiceRequestCompletedEvent","unregisterExternalCodeServiceRequestCompletedEvent","registerExternalCodeServiceResultEvent","unregisterExternalCodeServiceResultEvent","_RegisterOnDimeShown","_UnregisterOnDimeShown","_RegisterOnTaskComplete","_UnregisterOnTaskComplete","this.dimeInstanceId","launch","_RegisterReplyReceivedEvent","_UnregisterReplyReceivedEvent","_RegisterCopilotAgentEvent","_UnregisterCopilotAgentEvent","_RegisterRefreshedAcquisitionStateEvent","_UnregisterRefreshedAcquisitionStateEvent","_RegisterMessageReceived","_UnregisterMessageReceived","_RegisterSubscriberChanged","_UnregisterSubscriberChanged","_RegisterSdxReady","_UnregisterSdxReady"],enumTypes:[["DialogPageEventType",[],{onShow:1}],["LicenseFeatureTier",["unknown","basic","premium"]],["LicenseEventType",[],{featureStateChanged:1}],["AppRuntimeState",["inactive","background","visible"]],["Visibility",["hidden","visible"]],["VisualSurface",["default","menus","panes","statusBar","backstage","dialogs"],{qat:"QAT"}],["ObjectType",["unknown","chart","smartArt","table","image","slide","text"],{ole:"OLE"}],["PersonaCardPerfPoint",["placeHolderRendered","initialCardRendered"]],["MessageType",[],{personaLifetimePersonaUpdatedEvent:3502,lokiTokenProviderLokiTokenAvailableEvent:3503,lokiTokenProviderIdentityUniqueIdAvailableEvent:3504,lokiTokenProviderClientAccessTokenAvailableEvent:3505}],["UnifiedCommunicationAvailability",["notSet","free","idle","busy","idleBusy","doNotDisturb","unalertable","unavailable"]],["UnifiedCommunicationStatus",["online","notOnline","away","busy","beRightBack","onThePhone","outToLunch","inAMeeting","outOfOffice","doNotDisturb","inAConference","getting","notABuddy","disconnected","notInstalled","urgentInterruptionsOnly","mayBeAvailable","idle","inPresentation"]],["UnifiedCommunicationPresence",["free","busy","idle","doNotDistrub","blocked","notSet","outOfOffice"]],["FreeBusyCalendarState",["unknown","free","busy","elsewhere","tentative","outOfOffice"]],["PersonaType",["unknown","enterprise","contact","bot","phoneOnly","oneOff","distributionList","personalDistributionList","anonymous","unifiedGroup"]],["PhoneType",["workPhone","homePhone","mobilePhone","businessFax","otherPhone"]],["AddressType",["workAddress","homeAddress","otherAddress"]],["MemberType",["unknown","individual","group"]],["PersonaDataUpdated",["hostId","type","photo","personaInfo","unifiedCommunicationInfo","organization","unifiedGroupInfo","members","membership","capabilities","customizations","viewableSources","placeholder"]],["CustomizedData",["email","workPhone","workPhone2","workFax","mobilePhone","homePhone","homePhone2","otherPhone","sipAddress","profile","office","company","workAddress","homeAddress","otherAddress","birthday"]],["CommentTextFormat",["plain","markdown","delta"]],["TimeStringFormat",["shortTime","longTime","shortDate","longDate"]],["ServiceProvider",["ariaBrowserPipeUrl","ariaUploadUrl","ariaVNextUploadUrl","lokiAutoDiscoverUrl"]],["IdentityType",["organizationAccount","microsoftAccount","unsupported"]],["AugLoopEventType",[],{onHostMessageReceivedEvent:65542}],["UndoType",[],{onUndoStackChangedEvent:65543,onCopilotOperationStartedEvent:65544}],["TriStateOption",["notSet","true","false"]],["UserFeedbackType",["like","dislike","idea","unclassified"]],["UserFeedbackUIType",["modalDialog","taskpane"]],["UserFeedbackEventType",[],{onUserFeedbackUIDismissedEvent:65546,onUserFeedbackResponseEvent:65550}],["UserFeedbackScreenshotInfoSourceType",["autoCapture","autoCaptureWithHtml2Canvas","providedAtInitialization","dynamicallyProvided"]],["UserFeedbackScreenshotInfoImageFormat",[],{jpeg:"jpeg",png:"png"}],["LabelMessageContext",[],{generic:0,firstPerson:1}],["LabelResultSeverity",[],{info:0,warning:1,error:2}],["SensitivityLabelEventType",[],{onLabelChangedEvent:65549}],["EncryptionType",[],{none:0,irmtemplate:1,irmuserDefinedPermission:2,irmencryptOnly:3,irmdoNotForward:4}],["TryUpgradeLabelError",[],{s_APPLYLABEL_OK:0,e_APPLYLABEL_FAIL:2147467259,e_APPLYLABEL_UNSUPPORTED_CROSSTENANT:2147205120,e_APPLYLABEL_DOCUMENT_READONLY:2147205119,e_APPLYLABEL_INSUFFICIENTPERMISSION:2147205118,e_APPLYLABEL_LABELDISABLED:2147205117,e_APPLYLABEL_UNSUPPORTED_UDP:2147205116,e_APPLYLABEL_LABELING_DISABLED:2147205115,e_APPLYLABEL_UNSUPPORTED_CONTENTTYPE:2147205114,e_APPLYLABEL_UNSUPPORTED_DKE:2147205113,e_APPLYLABEL_LABELNOTFOUND:2147205112,e_APPLYLABEL_USERNOTFOUND:2147220727,e_APPLYLABEL_NEWLABELSENSITIVITYORDER:2147205105}],["PrivateApiEventType",[],{onPrivateEvent:65552}],["RequestMethod",["get","post","patch","delete"]],["ResultType",["executionResult","runtimeInfo","serviceResponse"]],["ErrorCategory",["other","environment","runtime","license","user","auth","billing","invalidArg","python","service","unsupported","dataUpload"]],["BusinessBarType",["info","error","blocked","severeWarning","success","warning"]],["SimpleDialogState",[],{cancel:0,confirm:1,checkedConfirm:2}],["SimpleDialogCategory",[],{information:"information",error:"error",warning:"warning",question:"question",other:"other"}],["DevicePermissionType",[],{camera:"camera",microphone:"microphone",geolocation:"geolocation"}],["DimeLaunchStatus",[],{success:0,closed:1}],["DimeShownStatus",[],{error:0,success:1}],["DimeEnvironment",[],{production:0,preProduction:1}],["DimeLicenseRefreshBehavior",[],{none:0,onTaskComplete:1,onLaunchSuccess:2}],["DimeEventType",[],{dimeShown:65558,taskComplete:65559}],["CopilotAgentEventType",[],{onCopilotAgentEvent:65556}],["UnifiedStoreEventType",[],{onRefreshedAcquisitionStateEvent:65557}]],clientObjectTypes:[[1,0,[["_Id",2]],0,[[64,0,2,0,4],["readyToShow",0,2,0,4],[65,0,2,0,4],[66,0,2,0,4],["sendMessageToHost",1,2,0,4]],0,0,0,[["OnShowEvent",0,0,"DialogPageEventType.onShow","this._Id",65,66]],"Microsoft.Office.DialogPage.DialogPage",4],[2,0,0,0,[["isFeatureEnabled",2,2,0,4],["getFeatureTier",2,2,0,4],["isFreemiumUpsellEnabled",0,2,0,4],["launchUpsellExperience",2,2,0,4],["_TestFireStateChangedEvent",1,0,0,3,0,1],["getMsaDeviceTicket",3,2,0,5],["getLicensingAndEligibilityArtifact",1,2,0,5]],[["getLicenseFeature",3,1,2,0,4]],0,0,0,"Microsoft.Office.Licensing.License",4],[3,0,[[67,3]],0,[[68,0,2,0,4],[69,0,2,0,4]],0,0,0,[["StateChanged",2,0,"LicenseEventType.featureStateChanged","this.id",68,69]]],[4,0,[["scopes",1,0,0,2,1]],0,0,0,0,0,0,"Microsoft.Office.Licensing.MsaDeviceTicketOptions",4],[5,0,0,0,[["setAppRuntimeStartState",1,0,0,2,0,2],["getAppRuntimeStartState",0,2,0,4]],0,0,0,0,"Microsoft.AppRuntime.AppRuntimePersistenceService",4],[6,0,0,0,[["setAppRuntimeState",1,0,0,2,0,2],["getAppRuntimeState",0,2,0,4],["setSnapshotEnabled",1,2,3,4],["getSnapshotEnabled",0,2,3,4],["getContentSnapshotAsBase64",0,2,3,4]],0,0,0,[["SnapshotImageReady",0,3,"65547",70,71,71],["VisibilityChanged",0,0,"65539",70,71,71]],"Microsoft.AppRuntime.AppRuntimeService",4],[7,0,0,0,[[72,0,0,0,2,0,4],[73,0,0,0,2,0,4],["getOfficeThemeDataForVisualSurface",1,2,0,5]],0,0,0,[["OfficeThemeChanged",2,0,"65548",70,72,73]],"Microsoft.Theme.ThemeService",4],[8,0,0,0,[["getEnterpriseUserInfo",0,2,0,5],["getMruFriendlyPath",1,2,0,5],["launchFileUrlInOfficeApp",2,2,0,5],["performLocalSearch",4,2,0,5],["readSearchCache",3,2,0,5],["writeSearchCache",3,2,0,5]],0,0,0,0,"Microsoft.TapRichApi.Tap",4],[9,0,[[74,3],[75,3]],0,[["items",0,2,0,4]],[["getPersonaForMember",18,1,2,0,4]]],[10,0,0,0,[["addContact",0,0,0,2,0,5],["editContact",0,0,0,2,0,5],["composeEmail",1,0,0,2,0,5],["composeInstantMessage",1,0,0,2,0,5],["callPhoneNumber",1,0,0,2,0,5],["pinPersonaToQuickContacts",0,0,0,2,0,5],["toggleTagForAlerts",0,0,0,2,0,5],["scheduleMeeting",0,0,0,2,0,5],["openLinkContactUx",0,0,0,2,0,5],["editContactByIdentifier",1,0,0,2,0,5],["showHoverCardForPersona",6,0,0,2,0,5],["hideHoverCardForPersona",0,0,0,2,0,5],["showContextMenu",6,0,0,2,0,5],["showContactCard",6,0,0,2,0,5],["showExpandedCard",6,0,0,2,0,5],["openGroupCalendar",0,0,0,2,0,5],["subscribeToGroup",0,0,0,2,0,5],["unsubscribeFromGroup",0,0,0,2,0,5],["getChangePhotoUrlAndOpenInBrowser",0,0,0,2,0,5],["startAudioCall",0,0,0,2,0,5],["startVideoCall",0,0,0,2,0,5],["openOutlookProperties",0,0,0,2,0,5],["editUnifiedGroup",0,0,0,2,0,5],["joinUnifiedGroup",0,0,0,2,0,5],["leaveUnifiedGroup",0,0,0,2,0,5]]],[11,0,[[76,3],[77,3],[78,3],[79,3],[80,3],[81,3],[82,3],[83,3],[84,3],[85,3],[86,3],[87,3],[88,3],[89,3],["phones",3],["addresses",3],[90,3],[91,3]]],[12,0,[[76,3],[77,3],[78,3],[79,3],[80,11],[81,11],[82,3],[83,3],[84,3],[85,3],[86,3],[87,3],[88,3],[89,3],[90,3],[91,3],["isPersonResolved",3]],[["sources",11,3,0,0,4]],[["getPhones",0,2,0,4],["getAddresses",0,2,0,4]]],[13,0,[["availability",3],["status",3],["isSelf",3],["isTagged",3],["customStatusString",3],["isBlocked",3],["presenceTooltip",3],["isOutOfOffice",3],["outOfOfficeNote",3],["timezone",3],["meetingLocation",3],["meetingSubject",3],["timezoneBias",3],["idleStartTime",11],["overallCapability",3],["isOnBuddyList",3],["presenceNote",3],["voiceMailUri",3],["availabilityText",3],["availabilityTooltip",3],["isDurationInAvailabilityText",3],["freeBusyStatus",3],["calendarState",3],["presence",3]]],[14,0,0,0,[[92,1,2,0,4,92],[93,1,0,0,2,93,5],[94,1,2,0,4,94],[95,1,2,0,4,95]]],[15,1,0,0,[[96,0,2,0,4]],[[97,18,1,18,0,4]],0,18],[16,0,[[74,3],[75,3]],[["hierarchy",15,18,0,0,4],["manager",18,2,0,0,4],["directReports",15,18,0,0,4]]],[17,0,[["description",1,0,0,2,5],["oneDrive",1,0,0,2,5],["oneNote",1,0,0,2,5],["isPublic",1,0,0,2,5],["amIOwner",1,0,0,2,5],["amIMember",1,0,0,2,5],["amISubscribed",1,0,0,2,5],["memberCount",1,0,0,2,5],["ownerCount",1,0,0,2,5],["hasGuests",1,0,0,2,5],["site",1,0,0,2,5],["planner",1,0,0,2,5],["classification",1,0,0,2,5],["subscriptionEnabled",1,0,0,2,5]]],[18,4,[["hostId",3],["type",3],["capabilities",3],["diagnosticId",3],[98,3]],[["photo",14,3,0,0,4],["personaInfo",12,3,0,0,4],["unifiedCommunicationInfo",13,3,0,0,4],["organization",16,3,0,0,4],["unifiedGroupInfo",17,35,0,0,4],["actions",10,2,0,0,4]],[["getCustomizations",0,2,0,4],["warmup",1,0,0,2,0,5],[99,0,0,0,2,0,5],["getViewableSources",0,2,0,4],["reportTimeForRender",2,0,0,2,0,5]],[["getMembers",9,0,2,0,4],["getMembership",9,0,2,0,4]]],[19,0,[[98,3]],0,[["getPolicies",0,2,0,4],[100,0,0,0,2,0,5],[101,0,0,0,2,0,5],["getTextScaleFactor",0,2,0,4]],[["getPersona",18,1,2,0,4],["getPersonaForOrgEntry",18,4,2,0,4],["getPersonaForOrgByEntryId",18,4,2,0,4]],0,0,[["PersonaUpdated",0,0,"MessageType.personaLifetimePersonaUpdatedEvent",102,100,101]]],[20,0,[["emailOrUpn",3],[98,3]],0,[["requestToken",0,0,0,2,0,5],[103,0,0,0,2,0,5],[104,0,0,0,2,0,5],["requestIdentityUniqueId",0,0,0,2,0,5],[105,0,0,0,2,0,5],[106,0,0,0,2,0,5],["requestClientAccessToken",0,0,0,2,0,5],[107,0,0,0,2,0,5],[108,0,0,0,2,0,5]],0,0,0,[["ClientAccessTokenAvailable",0,0,"MessageType.lokiTokenProviderClientAccessTokenAvailableEvent",102,107,108],["IdentityUniqueIdAvailable",0,0,"MessageType.lokiTokenProviderIdentityUniqueIdAvailableEvent",102,105,106],["LokiTokenAvailable",0,0,"MessageType.lokiTokenProviderLokiTokenAvailableEvent",102,103,104]]],[21,0,0,0,0,[[109,20,1,2,0,4]],0,0,0,"Microsoft.People.LokiTokenProviderFactory",4],[22,0,0,0,[[99,1,0,0,2,0,5],["accountEmailOrUpn",1,2,0,4],["getPersonaPolicies",0,2,0,4]],[[109,20,1,2,0,4],["getPersonaLifetime",19,1,2,0,4],["getInitialPersona",18,1,2,0,4]],0,0,0,"Microsoft.People.ServiceContext",4],[23,0,0,0,[["isAddChangePhotoLinkOnLpcPersonaImageFlightEnabled",0,2,0,4]],0,0,0,0,"Microsoft.People.RichapiPcxFeatureChecks",4],[24,0,[[67,3],["text",1,0,0,2,5],["created",11],["level",3],["resolved",1,0,0,2,5],["author",3],["mentions",3]],[["parent",24,2,0,0,4],["parentOrNullObject",24,2,0,0,4],["replies",25,19,0,0,4]],[["getRichText",1,2,0,4],["setRichText",2,0,0,2,0,5],["delete",0,0,0,2,0,5]],[["getParentOrSelf",24,0,2,0,4],["reply",24,2,0,0,2,0,0,5]]],[25,1,0,0,[[96,0,2,0,4]],[[97,24,1,18,0,4]],0,24],[26,0,0,0,[["launchExtensionComponent",3,2,0,5]],0,0,0,0,"Microsoft.OfficeSharedApi.ExtensionLifeCycle",4],[27,0,0,0,[["bindServiceToProfile",3,0,0,2,0,5]],0,0,0,0,"Microsoft.OfficeServicesManager.OfficeServicesManagerApi",4],[28,0,0,0,[["getLocaleDateTimeFormattingInfo",1,2,0,4],["formatDateTimeString",3,2,0,4]],0,0,0,0,"Microsoft.LocaleApi.LocaleApi",4],[29,0,0,0,[["displayDialog",2,2,0,5],[64,0,2,0,5]],0,0,0,[["DialogMessage",2,0,"65536",70,71,71]],"Microsoft.FirstPartyDialog.FirstPartyDialogService",4],[30,0,0,[["buttons",33,19,0,0,4]],[["executeRequestUpdate",1,2,0,4],["executeRequestCreate",1,2,6,4],["executeSaveState",0,2,7,4],["executeVisibilityUpdates",1,0,8,2,0,9]],[["getButton",32,1,2,0,4],["getTab",31,1,2,0,4]],0,0,0,"Microsoft.DynamicRibbon.DynamicRibbon",4],[31,0,[[67,3]],0,[["setVisibility",1,0,0,2,0,9]]],[32,0,[[67,3],["enabled",1,0,0,2,9],["label",1,0,0,2,9],["visible",1,10,0,2,9],["actionId",1,11,0,2,9],["icon",1,11,0,2,9]],0,[["setEnabled",1,0,0,2,0,9]]],[33,1,0,0,[[96,0,2,0,4]],[[97,32,1,18,0,4]],0,32],[34,0,0,0,[["getServiceUrl",2,2,0,4]],0,0,0,0,"Microsoft.DesktopCompliance.ServiceUrlProvider",4],[35,0,0,0,[["isEnabledForOffice",0,2,0,4],["recordLinkedInSettingsCompliance",2,0,0,2,0,5]],0,0,0,0,"Microsoft.DesktopCompliance.LinkedIn",4],[36,0,0,0,[["isInOnlineMode",0,2,0,4],["isInDisconnectedMode",0,2,0,4]],0,0,0,0,"Microsoft.DesktopCompliance.NetworkUsage",4],[37,0,0,0,[["enable",0,2,0,4],["disable",0,2,0,4]],0,0,0,[["BeforeCloseNotificationCancelled",0,0,"65540",70,71,71]],"Microsoft.BeforeDocumentCloseNotification.BeforeDocumentCloseNotification",4],[38,4,0,[["roamingSettings",40,2,0,0,4]],[["getAccessToken",2,2,0,5],["getPrimaryIdentityInfo",0,2,12,5],["getIdentities",0,2,13,5],[110,0,0,14,3,0,4],[111,0,0,14,3,0,4]],0,0,0,[["IdentityChanged",0,14,"65545",70,110,111],["TokenReceived",2,12,"3001","this._targetId",71,71]],"Microsoft.Authentication.AuthenticationService",4],[39,0,[[67,3],["value",1,0,0,2,4]]],[40,0,0,0,0,[[97,39,1,2,0,4],["getItemOrNullObject",39,1,2,0,4]]],[41,0,0,0,[["getVersion",0,2,0,4],["getBuildVersion",0,2,15,4]],0,0,0,0,"Microsoft.ApiVersion.ApiVersionService",4],[42,0,0,0,[["getSharedFilePickerResponse",1,2,0,4]],0,0,0,0,"Microsoft.Office.SharedFilePicker",4],[43,0,0,0,[["getShortcuts",0,2,0,4],["replaceShortcuts",1,0,0,2,0,4],["areShortcutsInUse",1,0,0,2,0,4]],0,0,0,0,"Microsoft.Office.ActionService",4],[44,0,0,0,[["getAccessTokenFirstPartyOAuth",2,2,0,5]],0,0,0,0,"Microsoft.Office.Auth",5],[45,0,0,0,[[112,1,2,0,5],[113,0,2,0,5],[114,0,2,0,5]],0,0,0,[["HostMessageReceived",0,0,"AugLoopEventType.onHostMessageReceivedEvent",70,113,114]],"Microsoft.Office.AugLoopEventService",5],[46,0,0,0,[["undo",0,0,0,3,0,5],[115,0,2,0,5],[116,0,2,0,5],["startCopilotOperation",1,0,0,3,0,5],["endCopilotOperation",1,0,0,3,0,5]],0,0,0,[["CopilotOperationStarted",0,0,"UndoType.onCopilotOperationStartedEvent",70,71,71],["UndoStackChanged",0,0,"UndoType.onUndoStackChangedEvent",70,115,116]],"Microsoft.Office.UndoService",5],[47,0,0,0,[["collectUserFeedback",4,2,0,5],[117,0,2,0,5],[118,0,2,0,5],["canCollectUserFeedback",0,2,0,5],[119,0,2,0,5],[120,0,2,0,5],["getInitializationData",0,2,0,5],["getHostScreenshot",0,2,0,5],["invokeDiagnosticsLogsUpload",1,2,0,5],["canCollectCopilotFeedback",0,2,0,5],["collectFeedbackEligibility",0,2,0,5],["checkFeedbackEligibility",1,2,0,5]],0,0,0,[["UserFeedbackResponse",0,0,"UserFeedbackEventType.onUserFeedbackResponseEvent",70,119,120],["UserFeedbackUIDismissed",0,0,"UserFeedbackEventType.onUserFeedbackUIDismissedEvent",70,117,118]],"Microsoft.Office.UserFeedbackService",5],[48,0,0,0,[["addNotification",2,0,0,3,0,1],["updateNotification",2,0,0,3,0,1],["removeNotification",1,0,0,3,0,1]],0,0,0,0,"Microsoft.Office.NotificationService",5],[49,0,0,0,[["getLabel",0,0,0,3,0,16],["tryUpgradeLabel",2,0,0,3,0,16],["getHighestSensitivityLabel",1,0,0,3,0,16],[121,0,2,0,5],[122,0,2,0,5],["getSensitivityResultDetails",2,0,17,3,0,18],["getSensitivityResultDetailsByStringErrorCode",2,0,19,3,0,20]],0,0,0,[["LabelChanged",0,0,"SensitivityLabelEventType.onLabelChangedEvent",70,121,122]],"Microsoft.Office.SensitivityService",5],[50,0,0,0,[["launchHelpPaneByQuery",1,0,0,3,0,21],["launchHelpPaneByArticleId",1,0,0,3,0,21],["launchHelpPaneByArticleIdString",1,0,0,3,0,21],["launchTaskPaneByAgentId",1,0,22,3],["getWindowClientWidth",0,0,0,3,0,21]],0,0,0,0,"Microsoft.Office.CopilotService",5],[51,0,0,0,[[123,1,0,0,3,0,23],[124,0,2,0,5],[125,0,2,0,5]],0,0,0,[["OnPrivateEvent",0,0,"PrivateApiEventType.onPrivateEvent",70,124,125]],"Microsoft.Office.PrivateApiService",5],[52,0,0,0,[["executePythonCode",1,0,0,3,0,24],["executePythonCodeAsync",1,0,0,3,0,24],[126,0,0,0,3,0,24],[127,0,0,0,3,0,24],["executePythonCodeAsync2",2,0,0,3,0,24],["sendRequestAsync",4,2,0,5],[128,0,2,0,5],[129,0,2,0,5],["getRuntimeInfoAsync",0,2,0,5],[130,0,0,0,3,0,24],[131,0,0,0,3,0,24],["getRuntimeInfoAsync2",1,2,0,5]],0,0,0,[["ExternalCodeExecutionCompleted",2,0,"65551",70,126,127],["ExternalCodeServiceRequestCompleted",2,0,"65553",70,128,129],["ExternalCodeServiceResult",2,0,"65554",70,130,131]],"Microsoft.Office.ExternalCodeService",5],[53,0,0,0,[["show",2,0,0,3,0,4],["hide",1,0,0,3,0,4]],0,0,0,0,"Microsoft.Office.BusinessBarService",5],[54,0,0,0,[["launchSimpleDialog",8,0,0,3]],0,0,0,0,"Microsoft.Office.ShowSimpleDialog",5],[55,0,0,0,[[123,2,2,0,5]],0,0,0,0,"Microsoft.Office.DispatchApiService",5],[56,0,0,0,[["requestPermissions",1,2,0,5]],0,0,0,0,"Microsoft.Office.DevicePermissionService",5],[57,0,[["dimeInstanceId",1,0,0,2]],0,[[132,0,0,0,3],[133,0,0,0,3],[134,0,0,0,3],[135,0,0,0,3]],0,0,0,[["DimeShown",0,0,"DimeEventType.dimeShown",136,132,133],["TaskComplete",0,0,"DimeEventType.taskComplete",136,134,135]],"Microsoft.Office.DimeEventHandlers",5],[58,0,0,0,[["initializeDime",1,0,0,3],["preload",2,0,0,3],[137,3,0,0,3],[99,1,0,0,3]],0,0,0,0,"Microsoft.Office.Dime",5],[59,0,0,0,[["notifyHeaderLoaded",0,0,0,3,0,25],[64,0,0,0,3,0,25],["move",0,0,0,3,0,25],["setWidth",1,0,0,2,0,25]],0,0,0,0,"Microsoft.Office.TaskpaneService",4],[60,0,0,0,[["invokeAction",4,2,0,5],[138,0,2,0,5],[139,0,2,0,5]],0,0,0,[["ReplyReceived",2,0,"65555",70,138,139]],"Microsoft.Office.AddinSkillActionService",5],[61,0,0,0,[["launchStoreDialogWithCopilotAgentPageShown",0,0,0,3],["refreshAcquisitionState",0,0,0,1],["getAcquisitionState",0,0,0,1],[140,0,2,0,5],[141,0,2,0,5],[142,0,2,0,5],[143,0,2,0,5]],0,0,0,[["CopilotAgentEvent",0,0,"CopilotAgentEventType.onCopilotAgentEvent",70,140,141],["RefreshedAcquisitionStateEvent",0,0,"UnifiedStoreEventType.onRefreshedAcquisitionStateEvent",70,142,143]],"Microsoft.Office.UnifiedStoreService",5],[62,0,0,0,[[112,2,2,0,5],["setSubscriptions",1,2,0,5],["getSubscriptions",0,2,0,5],["getSubscribers",0,2,0,5],[137,1,2,0,5],["ready",0,2,0,5],["isReady",1,2,0,5],[144,0,2,0,5],[145,0,2,0,5],[146,0,2,0,5],[147,0,2,0,5],[148,0,2,0,5],[149,0,2,0,5]],0,0,0,[["MessageReceived",0,0,"65541",70,144,145],["SdxReady",0,0,"65543",70,148,149],["SubscriberChanged",0,0,"65542",70,146,147]],"Microsoft.Office.SdxMessaging",4],[63,0,0,0,[["listServers",0,2,0,5],["executeTool",3,0,0,3]],0,0,0,0,"Microsoft.Office.HostMcpService",5]]},targetNamespaceObject:e})}(OfficeCore||(OfficeCore={})),function(e){!function(e){var t={"Office.api.getVersion":function(e){return e>=1?0:-1},"Office.api.getVersion.isSupported":function(e){return e>=1?0:-1},"Office.api.getBuildVersion":function(e){return e>=2?0:-1}};function n(){var e=new OfficeCore.RequestContext;return"web"==OSF._OfficeAppFactory.getHostInfo().hostPlatform&&(e._customData="WacPartition"),e}function r(e){return __awaiter(this,void 0,void 0,(function(){var t,n,r,i,o,a,s;return __generator(this,(function(c){switch(c.label){case 0:return t=OfficeCore.ApiVersionService.newObject(e).getBuildVersion(),[4,e.sync()];case 1:return c.sent(),n=t.value,r=n.major,i=n.minor,o=n.build,a=n.revision,s=n.text,[2,{major:r,minor:i,build:o,revision:a,text:s}]}}))}))}e.getVersion=function(){return __awaiter(this,void 0,void 0,(function(){var e,i,o,a,s,c;return __generator(this,(function(l){switch(l.label){case 0:return e=n(),i=OfficeCore.ApiVersionService.newObject(e),o=i.getVersion(),[4,e.sync()];case 1:return l.sent(),(a=o.value)>=2?[4,r(e)]:[3,3];case 2:return c=l.sent(),[3,4];case 3:c=void 0,l.label=4;case 4:return[2,{buildVersion:s=c,isSupported:function(e,n){if(void 0===n&&(n=0),"string"!=typeof e||0===e.length||"number"!=typeof n||n<0||Math.floor(n)!==n)throw OfficeExtension.Utility.createRuntimeError(OfficeExtension.ErrorCodes.invalidArgument,null,null);return!!Object.prototype.hasOwnProperty.call(t,e)&&n<=t[e](a,s)}}]}}))}))},e.getBuildVersion=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){return[2,r(n())]}))}))}}(e.api||(e.api={}))}(Office||(Office={})),function(e){var t,n;!function(e){e.hidden="Hidden",e.taskpane="Taskpane"}(t=e.VisibilityMode||(e.VisibilityMode={})),function(e){e.none="None",e.load="Load"}(n=e.StartupBehavior||(e.StartupBehavior={})),function(e){function r(e){var t=new OfficeCore.RequestContext;return t._requestFlagModifier|=64,e&&(t._customData="WacPartition"),t}function i(e){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(n){switch(n.label){case 0:return t=r(!0),OfficeCore.AppRuntimeService.newObject(t).setAppRuntimeState(e),[4,t.sync()];case 1:return n.sent(),[2]}}))}))}var o;e.setStartupBehavior=function(e){return __awaiter(this,void 0,void 0,(function(){var t,i;return __generator(this,(function(o){switch(o.label){case 0:if(e!==n.load&&e!==n.none)throw OfficeExtension.Utility.createRuntimeError(OfficeExtension.ErrorCodes.invalidArgument,null,null);return t=e==n.load?OfficeCore.AppRuntimeState.background:OfficeCore.AppRuntimeState.inactive,i=r(!1),OfficeCore.AppRuntimePersistenceService.newObject(i).setAppRuntimeStartState(t),[4,i.sync()];case 1:return o.sent(),[2]}}))}))},e.getStartupBehavior=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,i,o;return __generator(this,(function(a){switch(a.label){case 0:return e=r(!1),t=OfficeCore.AppRuntimePersistenceService.newObject(e),i=t.getAppRuntimeStartState(),[4,e.sync()];case 1:return a.sent(),o=i.value,[2,o==OfficeCore.AppRuntimeState.inactive?n.none:n.load]}}))}))},e.setSnapshotEnabled=function(e){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(n){switch(n.label){case 0:return t=r(!0),OfficeCore.AppRuntimeService.newObject(t).setSnapshotEnabled(e),[4,t.sync()];case 1:return n.sent(),[2,Promise.resolve()]}}))}))},e.getSnapshotEnabled=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,n;return __generator(this,(function(i){switch(i.label){case 0:return e=r(!0),t=OfficeCore.AppRuntimeService.newObject(e),n=t.getSnapshotEnabled(),[4,e.sync()];case 1:return i.sent(),[2,n.value]}}))}))},e.getContentSnapshotAsBase64=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){return[2,new OfficeExtension.CoreUtility.Promise((function(e,t){var n=r(!0),i=OfficeCore.AppRuntimeService.newObject(n),o=setTimeout((function(){a.remove(),n.sync().catch((function(){})),t(OfficeExtension.Utility.createRuntimeError(OfficeExtension.ErrorCodes.generalException,"timeout","getContentSnapshotAsBase64"))}),7e3),a=i.onSnapshotImageReady.add((function(r){return clearTimeout(o),a.remove(),OfficeExtension.CoreUtility.isNullOrUndefined(r)?(n.sync().catch((function(){})),t(OfficeExtension.Utility.createRuntimeError(OfficeExtension.ErrorCodes.generalException,"execution failed","getContentSnapshotAsBase64"))):(n.sync().catch((function(){})),e(r.imageBase64)),null}));n.sync().then((function(){i.getContentSnapshotAsBase64();return n.sync().then((function(){return null}))})).catch((function(e){t(e)}))}))]}))}))},e._getState=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,n;return __generator(this,(function(i){switch(i.label){case 0:return e=r(!0),t=OfficeCore.AppRuntimeService.newObject(e),n=t.getAppRuntimeState(),[4,e.sync()];case 1:return i.sent(),[2,n.value]}}))}))},e.showAsTaskpane=function(){return i(OfficeCore.AppRuntimeState.visible)},e.hide=function(){return i(OfficeCore.AppRuntimeState.background)},e.onVisibilityModeChanged=function(e){return __awaiter(this,void 0,void 0,(function(){var n,i,a=this;return __generator(this,(function(s){switch(s.label){case 0:return n=function(){if(!o){var e=r(!0);o=OfficeCore.AppRuntimeService.newObject(e)}return o}(),i=n.onVisibilityChanged.add((function(n){if(e){var r={visibilityMode:(i=n.visibility,i===OfficeCore.Visibility.visible?t.taskpane:t.hidden)};e(r)}var i;return null})),[4,n.context.sync()];case 1:return s.sent(),[2,function(){return __awaiter(a,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:return i.remove(),[4,n.context.sync()];case 1:return e.sent(),[2]}}))}))}]}}))}))},function(e){function t(e){var t=new OfficeCore.RequestContext;return t._requestFlagModifier|=64,e&&(t._customData="WacPartition"),t}e.enable=function(){return __awaiter(this,void 0,void 0,(function(){var e,n;return __generator(this,(function(r){switch(r.label){case 0:return e=!1,"web"==OSF._OfficeAppFactory.getHostInfo().hostPlatform&&(e=!0),n=t(e),OfficeCore.BeforeDocumentCloseNotification.newObject(n).enable(),[4,n.sync()];case 1:return r.sent(),[2]}}))}))},e.disable=function(){return __awaiter(this,void 0,void 0,(function(){var e,n;return __generator(this,(function(r){switch(r.label){case 0:return e=!1,"web"==OSF._OfficeAppFactory.getHostInfo().hostPlatform&&(e=!0),n=t(e),OfficeCore.BeforeDocumentCloseNotification.newObject(n).disable(),[4,n.sync()];case 1:return r.sent(),[2]}}))}))},e.onCloseActionCancelled=function(e){return __awaiter(this,void 0,void 0,(function(){var n,r,i,o,a=this;return __generator(this,(function(s){switch(s.label){case 0:return n=!1,"web"==OSF._OfficeAppFactory.getHostInfo().hostPlatform&&(n=!0),r=t(n),i=OfficeCore.BeforeDocumentCloseNotification.newObject(r),o=i.onBeforeCloseNotificationCancelled.add((function(t){return e&&e(),null})),[4,r.sync()];case 1:return s.sent(),[2,function(){return __awaiter(a,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:return o.remove(),[4,r.sync()];case 1:return e.sent(),[2]}}))}))}]}}))}))}}(e.beforeDocumentCloseNotification||(e.beforeDocumentCloseNotification={}))}(e.addin||(e.addin={}))}(Office||(Office={})),function(e){var t,n;!function(e){e.taskpane="Taskpane",e.dialog="Dialog"}(t||(t={})),function(n){function r(e){return new OfficeCore.RequestContext}!function(e){function t(){var e=new OfficeCore.RequestContext;return e._customData="WacPartition",e}e.close=function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(n){switch(n.label){case 0:return e=t(),OfficeCore.TaskpaneService.newObject(e).close(),[4,e.sync()];case 1:return n.sent(),[2]}}))}))},e.move=function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(n){switch(n.label){case 0:return e=t(),OfficeCore.TaskpaneService.newObject(e).move(),[4,e.sync()];case 1:return n.sent(),[2]}}))}))},e.notifyHeaderLoaded=function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(n){switch(n.label){case 0:return e=t(),OfficeCore.TaskpaneService.newObject(e).notifyHeaderLoaded(),[4,e.sync()];case 1:return n.sent(),[2]}}))}))},e.setWidth=function(e){return __awaiter(this,void 0,void 0,(function(){var n;return __generator(this,(function(r){switch(r.label){case 0:return n=t(),OfficeCore.TaskpaneService.newObject(n).setWidth(e),[4,n.sync()];case 1:return r.sent(),[2]}}))}))}}(n.taskpane||(n.taskpane={})),n.launchTaskpane=function(n){return __awaiter(this,void 0,void 0,(function(){var i,o,a,s,c;return __generator(this,(function(l){switch(l.label){case 0:return e.context.platform&&"OfficeOnline"===e.context.platform?(i={SharedRuntimeId:n.sharedRuntimeId,SourceLocationOverrideResourceId:n.sourceLocationOverride,TaskPaneTitle:n.taskpaneTitle,TaskPaneWidth:n.taskpaneWidth},o={OptionalProperties:i,DevProperties:n.settings},e.context.extensionLifeCycle.launchExtensionComponent(null,"Taskpane",null,null,o),[3,3]):[3,1];case 1:return a=r(),s=OfficeCore.ExtensionLifeCycle.newObject(a),c=n.settings,n.settings=c&&OSF.OUtil.serializeSettings(c),s.launchExtensionComponent("",t.taskpane,n),[4,a.sync()];case 2:l.sent(),l.label=3;case 3:return[2]}}))}))},n.launchDialog=function(n){return __awaiter(this,void 0,void 0,(function(){var i,o,a,s,c;return __generator(this,(function(l){switch(l.label){case 0:return e.context.platform&&"OfficeOnline"===e.context.platform?(i={SharedRuntimeId:n.sharedRuntimeId,SourceLocationOverrideResourceId:n.sourceLocationOverride},o={OptionalProperties:i,DevProperties:n.settings},e.context.extensionLifeCycle.launchExtensionComponent(null,"SDXDialog",null,null,o),[3,3]):[3,1];case 1:return a=r(),s=OfficeCore.ExtensionLifeCycle.newObject(a),c=n.settings,n.settings=c&&OSF.OUtil.serializeSettings(c),s.launchExtensionComponent("",t.dialog,n),[4,a.sync()];case 2:l.sent(),l.label=3;case 3:return[2]}}))}))}}(n=e.ExtensionLifeCycle||(e.ExtensionLifeCycle={})),e.extensionLifeCycle=n}(Office||(Office={})),function(e){!function(e){function t(){var e=new OfficeCore.RequestContext;return"web"==OSF._OfficeAppFactory.getHostInfo().hostPlatform&&(e._customData="WacPartition"),e}e.requestUpdate=function(e){var n=t(),r=n.ribbon;function i(e){void 0!==e.controls&&void 0!==e.controls.length&&e.controls.length&&e.controls.filter((function(e){return!!e.id})).forEach((function(e){var t=r.getButton(e.id);void 0!==e.enabled&&null!==e.enabled&&(t.enabled=e.enabled),void 0!==e.visible&&null!==e.visible&&(t.visible=e.visible),void 0!==e.label&&null!==e.label&&(t.label=e.label)}))}return e.tabs.filter((function(e){return!!e.id})).forEach((function(e){var t=r.getTab(e.id);void 0!==e.visible&&null!==e.visible&&t.setVisibility(e.visible),e.groups&&e.groups.length?e.groups.filter((function(e){return!!e.id})).forEach((function(e){void 0!==e.visible&&null!==e.visible&&(r.getButton(e.id).visible=e.visible),i(e)})):i(e)})),n.sync()},e.requestCreateControls=function(e){var n,r=t();return r.ribbon.executeRequestCreate(JSON.stringify(e)),(n=250,new Promise((function(e,t){return setTimeout((function(){return e()}),n)}))).then((function(){return r.sync()}))},e.saveState=function(){var e=t();return e.ribbon.executeSaveState(),e.sync()}}(e.ribbon||(e.ribbon={}))}(Office||(Office={})),function(e){!function(e){e.requestUpdate=function(e){if(OfficeExtension&&OfficeExtension.Utility&&!OfficeExtension.Utility.isSetSupported("ContextMenuApi","1.1"))throw OfficeExtension.Utility.createRuntimeError(OfficeCore.ErrorCodes.apiNotAvailable,null,null);var t,n=(t=new OfficeCore.RequestContext,"web"==OSF._OfficeAppFactory.getHostInfo().hostPlatform&&(t._customData="WacPartition"),t),r=n.ribbon;return e.controls.filter((function(e){return!!e.id})).forEach((function(e){var t=r.getButton(e.id);void 0!==e.enabled&&null!==e.enabled&&(t.enabled=e.enabled)})),n.sync()}}(e.contextMenu||(e.contextMenu={}))}(Office||(Office={})),function(e){var t;OfficeExtension.BatchApiHelper.createPropertyObject,OfficeExtension.BatchApiHelper.createMethodObject,OfficeExtension.BatchApiHelper.createIndexerObject,OfficeExtension.BatchApiHelper.createRootServiceObject,OfficeExtension.BatchApiHelper.createTopLevelServiceObject,OfficeExtension.BatchApiHelper.createChildItemObject,OfficeExtension.BatchApiHelper.invokeMethod,OfficeExtension.BatchApiHelper.invokeEnsureUnchanged,OfficeExtension.BatchApiHelper.invokeSetProperty,OfficeExtension.Utility.isNullOrUndefined,OfficeExtension.Utility.isUndefined,OfficeExtension.Utility.throwIfNotLoaded,OfficeExtension.Utility.throwIfApiNotSupported,OfficeExtension.Utility.load,OfficeExtension.Utility.retrieve,OfficeExtension.Utility.toJson,OfficeExtension.Utility.fixObjectPathIfNecessary,OfficeExtension.Utility._handleNavigationPropertyResults,OfficeExtension.Utility.adjustToDateTime,OfficeExtension.Utility.processRetrieveResult,OfficeExtension.Utility.setMockData,OfficeExtension.CommonUtility.calculateApiFlags;!function(e){e.generalException="GeneralException"}(t||(t={}));new OfficeExtension.LibraryBuilder({metadata:{version:"1.0.0",name:"OfficeCore",defaultApiSetName:"OfficeSharedApi",hostName:"Office",apiSets:[],strings:["AddinInternalService"],enumTypes:[],clientObjectTypes:[[1,0,0,0,[["notifyActionHandlerReady",0,2,0,4]],0,0,0,0,"Microsoft.InternalService.AddinInternalService",4]]},targetNamespaceObject:e})}(OfficeCore||(OfficeCore={})),function(e){var t;!function(t){var n,r,i=OfficeExtension.Utility.isNullOrUndefined,o="Office.Extensibility.OfficeJs.AddinSkill.ActionHandlerReady";function a(e,t){var n=e===o?{dataCategories:oteljs.DataCategories.ProductServiceUsage,diagnosticLevel:oteljs.DiagnosticLevel.NecessaryServiceDataEvent}:{dataCategories:oteljs.DataCategories.ProductServiceUsage,diagnosticLevel:oteljs.DiagnosticLevel.Optional,samplingPolicy:oteljs.SamplingPolicy.CriticalBusinessImpact};Microsoft.Office.WebExtension.sendTelemetryEvent({eventName:e,dataFields:t,eventFlags:n})}function s(e,t,n,r){try{if(!0!==window._enableActionHandlerTelemetry)return;var i=OSF._OfficeAppFactory.getHostInfo();if("powerpoint"!==i.hostType.toLowerCase()||"mac"!==i.hostPlatform.toLowerCase()||!0===i.isDialog)return;var s=[oteljs.makeStringDataField("Stage",e),oteljs.makeStringDataField("Result",t)];void 0!==n&&s.push(oteljs.makeInt64DataField("Duration",Date.now()-n)),r&&"string"==typeof r.message&&s.push(oteljs.makeStringDataField("ExceptionMessage",r.message)),a(o,s)}catch(e){}}function c(e){if(e){var t=e.toUpperCase(),r=n.mappings[t];if(!i(r)&&"function"==typeof r)return r}throw OfficeExtension.Utility.createRuntimeError("invalidOperation","sourceData","ActionProxy._getFunction")}function l(e,t,n,r){var o=OSF._OfficeAppFactory.getHostInfo();if(o&&"web"===o.hostPlatform.toLowerCase())OSF._OfficeAppFactory.getClientEndPoint().invoke("ContextActivationManager_notifyHost",null,[OSF._OfficeAppFactory.getId(),OSF.AgaveHostAction.ReportAddinSkillResult,{actionCorrelationId:e,resultCode:t,replyMessage:r}]);else{if(i(OSF.ClientHostController)||i(OSF.ClientHostController.execute))throw new OfficeExtension.Error({code:"GenericException",message:"API currently unsupported."});var s=i(OSF.MethodDispId)?OSF.DDA.MethodDispId.dispidAddinSkillActionReply:OSF.MethodDispId.dispidAddinSkillActionReply;OSF.ClientHostController.execute(s,[e,r,t],null)}a("Office.Extensibility.OfficeJs.AddinSkill.ExecuteAction",[oteljs.makeStringDataField("CorrelationId",e),oteljs.makeStringDataField("Message",n),oteljs.makeInt64DataField("ResultCode",t)])}function u(e){try{OfficeExtension.Utility.log("ActionProxy._handleMessage"),OfficeExtension.Utility.checkArgumentNull(e,"args");for(var t=e.entries,n=function(e){if(2!==t[e].messageCategory)return"continue";if("string"==typeof t[e].message&&(t[e].message=JSON.parse(t[e].message)),1e3===t[e].messageType){var n=null,r=c(a=t[e].message[0]);if(t[e].message.length>=2){var o=t[e].message[1];o&&(!function(e){if("string"==typeof e&&"{"===e[0])return!0;return!1}(o)?n=o:"autorunEventType"in(n=JSON.parse(o))&&"autorunEventHost"in n&&"autorunEventPlatform"in n&&("win32"!==n.autorunEventPlatform&&"mac"!==n.autorunEventPlatform||("word"===n.autorunEventHost?n.completed=function(e){return __awaiter(this,void 0,void 0,(function(){var t=this;return __generator(this,(function(n){switch(n.label){case 0:return e.autorunEventType=this.autorunEventType,[4,Word.run((function(n){return __awaiter(t,void 0,void 0,(function(){return __generator(this,(function(t){return n.document.autorunEventCompleted(e),[2]}))}))}))];case 1:return n.sent(),[2]}}))}))}:"excel"===n.autorunEventHost?n.completed=function(e){return __awaiter(this,void 0,void 0,(function(){var t=this;return __generator(this,(function(n){switch(n.label){case 0:return e.autorunEventType=this.autorunEventType,[4,Excel.run((function(n){return __awaiter(t,void 0,void 0,(function(){return __generator(this,(function(t){return n.workbook.autorunEventCompleted(e),[2]}))}))}))];case 1:return n.sent(),[2]}}))}))}:"powerpoint"===n.autorunEventHost&&(n.completed=function(e){return __awaiter(this,void 0,void 0,(function(){var t=this;return __generator(this,(function(n){switch(n.label){case 0:return e.autorunEventType=this.autorunEventType,[4,PowerPoint.run((function(n){return __awaiter(t,void 0,void 0,(function(){return __generator(this,(function(t){return n.presentation.autorunEventCompleted(e),[2]}))}))}))];case 1:return n.sent(),[2]}}))}))}))))}r.apply(null,[n])}else if(1001===t[e].messageType){n=null;var a=t[e].message[0],s=t[e].message[1],u=JSON.parse(s);n=u.message;var d=u.correlationId,p=OfficeFirstParty.AddinInvokeResult.AddinInvokeResultSuccess,m=null,g="";r=null;try{r=c(a)}catch(e){p=OfficeFirstParty.AddinInvokeResult.AddinInvokeResultNoActionFunctionMapping,g="ActionProxy._handleMessage failed to get function",f(e)}if(p==OfficeFirstParty.AddinInvokeResult.AddinInvokeResultSuccess&&r)try{m=r.apply(null,[n])}catch(e){p=OfficeFirstParty.AddinInvokeResult.AddinInvokeResultInvocationFailed,g="ActionProxy._handleMessage failed to execute function",f(e)}if(p==OfficeFirstParty.AddinInvokeResult.AddinInvokeResultSuccess&&i(m)?(p=OfficeFirstParty.AddinInvokeResult.AddinInvokeResultNoResultGenerated,g="No result generated"):p!=OfficeFirstParty.AddinInvokeResult.AddinInvokeResultSuccess||"object"==typeof m&&"function"==typeof m.then||(p=OfficeFirstParty.AddinInvokeResult.AddinInvokeResultInvalidResultGenerated,g="Invalid result generated"),p==OfficeFirstParty.AddinInvokeResult.AddinInvokeResultSuccess)try{m.then((function(e){g="Successfully executed function",i(e)?(e="",p=OfficeFirstParty.AddinInvokeResult.AddinInvokeResultNoResultGenerated,g="No result generated"):"string"!=typeof e&&(e="",p=OfficeFirstParty.AddinInvokeResult.AddinInvokeResultInvalidResultGenerated,g="Invalid result generated"),l(d,p,g,e)}),(function(e){var t="";p=OfficeFirstParty.AddinInvokeResult.AddinInvokeResultInvocationFailed,g="Failed to execute function","string"==typeof e?t=e:f(e),l(d,p,g,t)}))}catch(e){p=OfficeFirstParty.AddinInvokeResult.AddinInvokeResultInvalidResultGenerated,g="Invalid result generated",f(e),l(d,p,g,"")}else try{l(d,p,g,"")}catch(e){f(e)}}else OfficeExtension.Utility.log("ActionProxy._handleMessage unknown message type "+t[e].messageType)},r=0;r<t.length;r++)n(r)}catch(e){throw f(e),e}return OfficeExtension.Utility._createPromiseFromResult(null)}function f(e){var t=function(e){var t="Unknown Error";if(e)try{e.toString&&(t=e.toString()),t=t+" "+JSON.stringify(e)}catch(e){t="Unexpected Error"}return t}(e);OfficeExtension.Utility.log(t)}function d(){var e,t,n=Date.now(),r="OfficeOnReady",i=n,o=!1,a=!1;s("OfficeOnReady","Started");try{Microsoft.Office.WebExtension.onReadyInternal().then((function(){return s("OfficeOnReady","Completed",n),void 0!==OSF&&OSF.DDA&&OSF.DDA.RichApi&&OSF.DDA.RichApi.richApiMessageManager?(r="RichApiMessageHandlerRegistration",i=Date.now(),e=i,s("RichApiMessageHandlerRegistration","Started")):(o=!0,s("RichApiMessageHandlerRegistration","Skipped")),function(){if(void 0!==OSF&&OSF.DDA&&OSF.DDA.RichApi&&OSF.DDA.RichApi.richApiMessageManager)return(new OfficeExtension.ClientRequestContext).eventRegistration.register(5,"",u)}()})).then((function(){o||void 0===e||s("RichApiMessageHandlerRegistration","Completed",e);var n,c,l=OSF._OfficeAppFactory.getHostInfo();return!0===l.isDialog||"web"===l.hostPlatform.toLowerCase()&&"word"!==l.hostType&&"excel"!==l.hostType&&"powerpoint"!==l.hostType?(a=!0,void s("NotifyActionHandlerReady","Skipped")):(r="NotifyActionHandlerReady",i=Date.now(),t=i,s("NotifyActionHandlerReady","Started"),n=new OfficeExtension.ClientRequestContext,c=OfficeCore.AddinInternalService.newObject(n),n._customData="WacPartition",c.notifyActionHandlerReady(),n.sync())})).then((function(){a||void 0===t||s("NotifyActionHandlerReady","Completed",t)}),(function(e){throw s(r,"Failed",i,e),e}))}catch(e){s(r,"Failed",i,e)}}OfficeExtension.Utility.log("ActionProxy.initOnce"),void 0!==e.actions&&(r=e.actions._association,n=r),"undefined"!=typeof document&&(document.readyState&&"loading"!==document.readyState?(OfficeExtension.Utility.log("ActionProxy.initOnce: document.readyState is not loading state"),d()):document.addEventListener&&document.addEventListener("DOMContentLoaded",(function(){OfficeExtension.Utility.log("ActionProxy.initOnce: DOMContentLoaded event triggered"),d()}))),OfficeExtension.HostBridge.onInited((function(e){!function(e){e.addHostMessageHandler((function(e){3===e.type&&u(e.message)}))}(e)}))}(t||(t={}))}(Office||(Office={})),function(e){!function(e){function t(e){var t=new OfficeCore.RequestContext;return e&&e.controlId&&(t.requestHeaders[OfficeExtension.Constants.officeControlId]=e.controlId),t._customData="WacPartition",t}e.SendMessage=function(e,n){return __awaiter(this,void 0,void 0,(function(){var r,i;return __generator(this,(function(o){switch(o.label){case 0:return r=void 0!==n?n:e,i=t(void 0!==n?e:void 0),OfficeCore.AugLoopEventService.newObject(i).sendMessage(r),[4,i.sync()];case 1:return o.sent(),[2]}}))}))},e.onHostMessageReceived=function(e,n){return __awaiter(this,void 0,void 0,(function(){var r,i,o,a,s=this;return __generator(this,(function(c){switch(c.label){case 0:return r=void 0!==n?n:e,i=t(void 0!==n?e:void 0),o=OfficeCore.AugLoopEventService.newObject(i),a=function(e){if(r){var t=e.data;r(t)}return null},o.onHostMessageReceived.add(a),[4,o.context.sync()];case 1:return c.sent(),[2,function(){return __awaiter(s,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:return o.onHostMessageReceived.remove(a),[4,i.sync()];case 1:return e.sent(),[2]}}))}))}]}}))}))}}(e.AugLoop||(e.AugLoop={}))}(OfficeFirstParty||(OfficeFirstParty={})),function(e){!function(e){function t(e){return"object"==typeof e&&"string"==typeof e.controlId?e.controlId:void 0}function n(e){var t=new OfficeCore.RequestContext;return e&&(t.requestHeaders[OfficeExtension.Constants.officeControlId]=e),t._customData="SkipUndoRecording",t}var r,i={};e.undo=function(e){return __awaiter(this,void 0,void 0,(function(){var r,i,o;return __generator(this,(function(a){switch(a.label){case 0:return r=n(t(e)),i=OfficeCore.UndoService.newObject(r),o=i.undo(),[4,r.sync()];case 1:return a.sent(),[2,o.value]}}))}))},e.onUndoStackChanged=function(e,r){return __awaiter(this,void 0,void 0,(function(){var i,o,a,s=this;return __generator(this,(function(c){switch(c.label){case 0:return i=r||e,o=n(t(r?e:void 0)),(a=OfficeCore.UndoService.newObject(o)).onUndoStackChanged.add(i),[4,o.sync()];case 1:return c.sent(),[2,function(){return __awaiter(s,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:return a.onUndoStackChanged.remove(i),[4,o.sync()];case 1:return e.sent(),[2]}}))}))}]}}))}))},e.startCopilotOperation=function(e){return __awaiter(this,void 0,void 0,(function(){var o,a,s,c,l,u,f,d;return __generator(this,(function(p){switch(p.label){case 0:if(void 0===(o=t(e))){if(void 0!==r)throw new Error("startCopilotOperation is already inprogress")}else if(i[o])throw new Error("startCopilotOperation is already in progress");a=function(){},s=new Promise((function(e){void 0===o?r=e:i[o]=e})),p.label=1;case 1:return p.trys.push([1,4,,5]),c=n(o),l=OfficeCore.UndoService.newObject(c),u=function(){return function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return void 0===e?void 0!==r&&(r(),r=void 0):i[e]&&(i[e](),delete i[e]),[2]}))}))}(o)},a=function(){try{l.onCopilotOperationStarted.remove(u),c.sync()}catch(e){}},l.onCopilotOperationStarted.add(u),[4,c.sync()];case 2:return p.sent(),f=l.startCopilotOperation(""),[4,c.sync()];case 3:return p.sent(),f.value?(void 0!==o&&s.then((function(){a()})),[2,s]):(void 0===o?r=void 0:(a(),delete i[o]),[3,5]);case 4:throw d=p.sent(),void 0===o?r=void 0:(a(),delete i[o]),d;case 5:return[2]}}))}))},e.endCopilotOperation=function(e){return __awaiter(this,void 0,void 0,(function(){var r;return __generator(this,(function(i){switch(i.label){case 0:return r=n(t(e)),OfficeCore.UndoService.newObject(r).endCopilotOperation(""),[4,r.sync()];case 1:return i.sent(),[2]}}))}))}}(e.Undo||(e.Undo={}))}(OfficeFirstParty||(OfficeFirstParty={})),function(e){var t;(t=e.dialogPage||(e.dialogPage={})).close=function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(t){switch(t.label){case 0:return e=new OfficeCore.RequestContext,OfficeCore.DialogPage.newObject(e).close(),[4,e.sync()];case 1:return t.sent(),[2]}}))}))},t.readyToShow=function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(t){switch(t.label){case 0:return e=new OfficeCore.RequestContext,OfficeCore.DialogPage.newObject(e).readyToShow(),[4,e.sync()];case 1:return t.sent(),[2]}}))}))},t.onShow=function(e){return __awaiter(this,void 0,void 0,(function(){var t,n,r;return __generator(this,(function(i){switch(i.label){case 0:return t=new OfficeCore.RequestContext,(n=OfficeCore.DialogPage.newObject(t)).onOnShowEvent.add(e),r=function(){return n.onOnShowEvent.remove(e),null},[4,t.sync()];case 1:return i.sent(),[2,r]}}))}))},t.sendMessageToHost=function(e){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(n){switch(n.label){case 0:return t=new OfficeCore.RequestContext,OfficeCore.DialogPage.newObject(t).sendMessageToHost(e),[4,t.sync()];case 1:return n.sent(),[2]}}))}))}}(Office||(Office={})),function(e){!function(e){function t(e){var t=new OfficeCore.RequestContext;return t._customData="WacPartition",t}e.CollectUserFeedback=function(e,n,r,i){return __awaiter(this,void 0,void 0,(function(){var o;return __generator(this,(function(a){switch(a.label){case 0:return o=t(),OfficeCore.UserFeedbackService.newObject(o).collectUserFeedback(e,n,r,i),[4,o.sync()];case 1:return a.sent(),[2]}}))}))},e.onUserFeedbackUIDismissed=function(e){return __awaiter(this,void 0,void 0,(function(){var n,r,i,o=this;return __generator(this,(function(a){switch(a.label){case 0:return n=function(t){if(e){var n=t.isFeedbackSent;e(n)}return null},r=t(),(i=OfficeCore.UserFeedbackService.newObject(r)).onUserFeedbackUIDismissed.add(n),[4,i.context.sync()];case 1:return a.sent(),[2,function(){return __awaiter(o,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:return i.onUserFeedbackUIDismissed.remove(n),[4,r.sync()];case 1:return e.sent(),[2]}}))}))}]}}))}))},e.CanCollectUserFeedback=function(){return __awaiter(this,void 0,void 0,(function(){var e,n,r;return __generator(this,(function(i){switch(i.label){case 0:return e=t(),n=OfficeCore.UserFeedbackService.newObject(e),r=n.canCollectUserFeedback(),[4,e.sync()];case 1:return i.sent(),[2,r.value]}}))}))},e.onUserFeedbackResponse=function(e){return __awaiter(this,void 0,void 0,(function(){var n,r,i,o=this;return __generator(this,(function(a){switch(a.label){case 0:return n=function(t){if(e){var n=t.responseData;e(n)}return null},r=t(),(i=OfficeCore.UserFeedbackService.newObject(r)).onUserFeedbackResponse.add(n),[4,i.context.sync()];case 1:return a.sent(),[2,function(){return __awaiter(o,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:return i.onUserFeedbackResponse.remove(n),[4,r.sync()];case 1:return e.sent(),[2]}}))}))}]}}))}))},e.InvokeDiagnosticsLogsUpload=function(e){return __awaiter(this,void 0,void 0,(function(){var n;return __generator(this,(function(r){switch(r.label){case 0:return n=t(),OfficeCore.UserFeedbackService.newObject(n).invokeDiagnosticsLogsUpload(e),[4,n.sync()];case 1:return r.sent(),[2]}}))}))},e.GetInitializationData=function(){return __awaiter(this,void 0,void 0,(function(){var e,n,r;return __generator(this,(function(i){switch(i.label){case 0:return e=t(),n=OfficeCore.UserFeedbackService.newObject(e),r=n.getInitializationData(),[4,e.sync()];case 1:return i.sent(),[2,r.value]}}))}))},e.GetHostScreenshot=function(){return __awaiter(this,void 0,void 0,(function(){var e,n,r;return __generator(this,(function(i){switch(i.label){case 0:return e=t(),n=OfficeCore.UserFeedbackService.newObject(e),r=n.getHostScreenshot(),[4,e.sync()];case 1:return i.sent(),[2,r.value]}}))}))},e.CanCollectCopilotFeedback=function(){return __awaiter(this,void 0,void 0,(function(){var e,n,r;return __generator(this,(function(i){switch(i.label){case 0:return e=t(),n=OfficeCore.UserFeedbackService.newObject(e),r=n.canCollectCopilotFeedback(),[4,e.sync()];case 1:return i.sent(),[2,r.value]}}))}))},e.CollectFeedbackEligibility=function(){return __awaiter(this,void 0,void 0,(function(){var e,n,r;return __generator(this,(function(i){switch(i.label){case 0:return e=t(),n=OfficeCore.UserFeedbackService.newObject(e),r=n.collectFeedbackEligibility(),[4,e.sync()];case 1:return i.sent(),[2,r.value]}}))}))},e.CheckFeedbackEligibility=function(e){return __awaiter(this,void 0,void 0,(function(){var n,r,i;return __generator(this,(function(o){switch(o.label){case 0:return n=t(),r=OfficeCore.UserFeedbackService.newObject(n),i=r.checkFeedbackEligibility(e),[4,n.sync()];case 1:return o.sent(),[2,i.value]}}))}))}}(e.UserFeedback||(e.UserFeedback={}))}(OfficeFirstParty||(OfficeFirstParty={})),function(e){!function(e){var t=function(){};function n(){var e=new OfficeCore.RequestContext;return e._customData="WacPartition",e}function r(e){return JSON.stringify(e instanceof t?{type:"callout",params:e.params}:{type:"custom",props:e})}e.callout=function(e){var n=new t;return n.params=e,n},e.addNotification=function(e,t){return __awaiter(this,void 0,void 0,(function(){var i,o,a;return __generator(this,(function(s){switch(s.label){case 0:return i=n(),o=OfficeCore.NotificationService.newObject(i),a=o.addNotification(r(e),function(e){return JSON.stringify(e)}(t)),[4,i.sync()];case 1:return s.sent(),[2,a.value]}}))}))},e.updateNotification=function(e,t){return __awaiter(this,void 0,void 0,(function(){var i;return __generator(this,(function(o){switch(o.label){case 0:return i=n(),OfficeCore.NotificationService.newObject(i).updateNotification(e,r(t)),[4,i.sync()];case 1:return o.sent(),[2]}}))}))},e.removeNotification=function(e){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(r){switch(r.label){case 0:return t=n(),OfficeCore.NotificationService.newObject(t).removeNotification(e),[4,t.sync()];case 1:return r.sent(),[2]}}))}))}}(e.Notification||(e.Notification={}))}(OfficeFirstParty||(OfficeFirstParty={})),function(e){!function(e){function t(e){var t=new OfficeCore.RequestContext;return e&&e.controlId&&(t.requestHeaders[OfficeExtension.Constants.officeControlId]=e.controlId),t._customData="WacPartition",t}e.getLabel=function(e){return __awaiter(this,void 0,void 0,(function(){var n,r,i;return __generator(this,(function(o){switch(o.label){case 0:return n=t(e),r=OfficeCore.SensitivityService.newObject(n),i=r.getLabel(),[4,n.sync()];case 1:return o.sent(),[2,i.value]}}))}))},e.tryUpgradeLabel=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return __awaiter(this,void 0,void 0,(function(){var n,r,i,o,a;return __generator(this,(function(s){switch(s.label){case 0:if(n=3===e.length,2!==e.length&&3!==e.length)throw new Error("tryUpgradeLabel: Invalid number of parameters ("+e.length+")");return r=n?e[0]:void 0,i=n?e[1]:e[0],o=n?e[2]:e[1],a=t(r),OfficeCore.SensitivityService.newObject(a).tryUpgradeLabel(i,o),[4,a.sync()];case 1:return s.sent(),[2]}}))}))},e.getHighestSensitivityLabel=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return __awaiter(this,void 0,void 0,(function(){var n,r,i,o,a,s;return __generator(this,(function(c){switch(c.label){case 0:if(n=2===e.length,1!==e.length&&2!==e.length)throw new Error("getHighestSensitivityLabel: Invalid number of parameters ("+e.length+")");return r=n?e[0]:void 0,i=n?e[1]:e[0],o=t(r),a=OfficeCore.SensitivityService.newObject(o),s=a.getHighestSensitivityLabel(i),[4,o.sync()];case 1:return c.sent(),[2,s.value]}}))}))},e.getSensitivityResultDetails=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return __awaiter(this,void 0,void 0,(function(){var n,r,i,o,a,s,c;return __generator(this,(function(l){switch(l.label){case 0:if(n=3===e.length,2!==e.length&&3!==e.length)throw new Error("getSensitivityResultDetails: Invalid number of parameters ("+e.length+")");return r=n?e[0]:void 0,i=n?e[1]:e[0],o=n?e[2]:e[1],a=t(r),s=OfficeCore.SensitivityService.newObject(a),c=s.getSensitivityResultDetails(i,o),[4,a.sync()];case 1:return l.sent(),[2,c.value]}}))}))},e.getSensitivityResultDetailsByStringErrorCode=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return __awaiter(this,void 0,void 0,(function(){var n,r,i,o,a,s,c;return __generator(this,(function(l){switch(l.label){case 0:if(n=3===e.length,2!==e.length&&3!==e.length)throw new Error("getSensitivityResultDetails: Invalid number of parameters ("+e.length+")");return r=n?e[0]:void 0,i=n?e[1]:e[0],o=n?e[2]:e[1],a=t(r),s=OfficeCore.SensitivityService.newObject(a),c=s.getSensitivityResultDetailsByStringErrorCode(i,o),[4,a.sync()];case 1:return l.sent(),[2,c.value]}}))}))},e.onLabelChangedEvent=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return __awaiter(this,void 0,void 0,(function(){var n,r,i,o,a,s,c=this;return __generator(this,(function(l){switch(l.label){case 0:if(n=2===e.length,1!==e.length&&2!==e.length)throw new Error("onLabelChangedEvent: Invalid number of parameters ("+e.length+")");return r=n?e[0]:void 0,i=n?e[1]:e[0],o=function(e){if(i){var t=e.previousLabel,n=e.newLabel,r=e.context,o=e.error;i(t,n,r,o)}return null},a=t(r),(s=OfficeCore.SensitivityService.newObject(a)).onLabelChanged.add(o),[4,s.context.sync()];case 1:return l.sent(),[2,function(){return __awaiter(c,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:return s.onLabelChanged.remove(o),[4,a.sync()];case 1:return e.sent(),[2]}}))}))}]}}))}))}}(e.Sensitivity||(e.Sensitivity={}))}(OfficeFirstParty||(OfficeFirstParty={})),function(e){!function(e){function t(e){var t=new OfficeCore.RequestContext;return t._customData="WacPartition",t}e.launchHelpPaneByQuery=function(e){return __awaiter(this,void 0,void 0,(function(){var n,r;return __generator(this,(function(i){switch(i.label){case 0:return n=t(),r=OfficeCore.CopilotService.newObject(n),r.launchHelpPaneByQuery(e),[4,n.sync()];case 1:return i.sent(),[2]}}))}))},e.launchHelpPaneByArticleId=function(e){return __awaiter(this,void 0,void 0,(function(){var n,r;return __generator(this,(function(i){switch(i.label){case 0:return n=t(),r=OfficeCore.CopilotService.newObject(n),r.launchHelpPaneByArticleId(e),[4,n.sync()];case 1:return i.sent(),[2]}}))}))},e.launchHelpPaneByArticleIdString=function(e){return __awaiter(this,void 0,void 0,(function(){var n,r;return __generator(this,(function(i){switch(i.label){case 0:return n=t(),r=OfficeCore.CopilotService.newObject(n),r.launchHelpPaneByArticleIdString(e),[4,n.sync()];case 1:return i.sent(),[2]}}))}))},e.launchTaskPaneByAgentId=function(e){return __awaiter(this,void 0,void 0,(function(){var n,r;return __generator(this,(function(i){switch(i.label){case 0:return n=t(),r=OfficeCore.CopilotService.newObject(n),r.launchTaskPaneByAgentId(e),[4,n.sync()];case 1:return i.sent(),[2]}}))}))},e.getWindowClientWidth=function(){return __awaiter(this,void 0,void 0,(function(){var e,n,r;return __generator(this,(function(i){switch(i.label){case 0:return e=t(),n=OfficeCore.CopilotService.newObject(e),r=n.getWindowClientWidth(),[4,e.sync()];case 1:return i.sent(),[2,r.value]}}))}))}}(e.Copilot||(e.Copilot={}))}(OfficeFirstParty||(OfficeFirstParty={})),function(e){!function(e){function t(e){var t=new OfficeCore.RequestContext;return e&&e.controlId&&(t.requestHeaders[OfficeExtension.Constants.officeControlId]=e.controlId),t._customData="WacPartition",t}e.execute=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return __awaiter(this,void 0,void 0,(function(){var n,r,i,o,a,s;return __generator(this,(function(c){switch(c.label){case 0:return n=e.length>=2,r=n?e[0]:void 0,i=n?e[1]:e[0],o=t(r),a=OfficeCore.PrivateApiService.newObject(o),s=a.execute(i),[4,o.sync()];case 1:return c.sent(),[2,s.value]}}))}))},e.onPrivateEvent=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return __awaiter(this,void 0,void 0,(function(){var n,r,i,o,a,s,c=this;return __generator(this,(function(l){switch(l.label){case 0:return n=e.length>=2,r=n?e[0]:void 0,i=n?e[1]:e[0],o=function(e){if(i){var t=e.messageData;i(t)}return null},a=t(r),(s=OfficeCore.PrivateApiService.newObject(a)).onOnPrivateEvent.add(o),[4,s.context.sync()];case 1:return l.sent(),[2,function(){return __awaiter(c,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:return s.onOnPrivateEvent.remove(o),[4,a.sync()];case 1:return e.sent(),[2]}}))}))}]}}))}))}}(e.PrivateApi||(e.PrivateApi={}))}(OfficeFirstParty||(OfficeFirstParty={})),function(e){!function(e){var t;function n(e){var t=new OfficeCore.RequestContext;return t._customData="WacPartition",t}!function(e){e.copilotAgentsPage="CopilotAgentsPage"}(t=e.DefaultPageType||(e.DefaultPageType={})),function(e){e.activated="Activated",e.removed="Removed"}(e.CopilotAgentActionType||(e.CopilotAgentActionType={})),function(e){e.host="Host",e.api="Api"}(e.RefreshAcquisitionStateTriggerType||(e.RefreshAcquisitionStateTriggerType={})),e.launchStore=function(e){return __awaiter(this,void 0,void 0,(function(){var r,i,o;return __generator(this,(function(a){switch(a.label){case 0:if(e!==t.copilotAgentsPage)throw OfficeExtension.Utility.createRuntimeError(OfficeExtension.ErrorCodes.invalidArgument,null,null);return r=n(),i=OfficeCore.UnifiedStoreService.newObject(r),e!=t.copilotAgentsPage?[3,2]:(o=i.launchStoreDialogWithCopilotAgentPageShown(),[4,r.sync()]);case 1:return a.sent(),[2,o];case 2:return[2]}}))}))},e.refreshAcquisitionState=function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,i;return __generator(this,(function(o){return t=n(),r=OfficeCore.UnifiedStoreService.newObject(t),i=r.refreshAcquisitionState(),t.sync().then((function(){var t=JSON.parse(i.value);e(t)})),[2,null]}))}))},e.getAcquisitionState=function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,i;return __generator(this,(function(o){return t=n(),r=OfficeCore.UnifiedStoreService.newObject(t),i=r.getAcquisitionState(),t.sync().then((function(){var t=JSON.parse(i.value);e(t)})),[2,null]}))}))},e.onCopilotAgentEvent=function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,i,o=this;return __generator(this,(function(a){switch(a.label){case 0:return t=function(t){if(e){var n=JSON.parse(t.messageData),r=n.actionType,i=n.titleId;e({actionType:r,titleId:i})}return null},r=n(),(i=OfficeCore.UnifiedStoreService.newObject(r)).onCopilotAgentEvent.add(t),[4,i.context.sync()];case 1:return a.sent(),[2,function(){return __awaiter(o,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:return i.onCopilotAgentEvent.remove(t),[4,r.sync()];case 1:return e.sent(),[2]}}))}))}]}}))}))},e.onRefreshedAcquisitionState=function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,i,o=this;return __generator(this,(function(a){switch(a.label){case 0:return t=function(t){if(e){var n=JSON.parse(t.messageData);e(n)}return null},r=n(),(i=OfficeCore.UnifiedStoreService.newObject(r)).onRefreshedAcquisitionStateEvent.add(t),[4,i.context.sync()];case 1:return a.sent(),[2,function(){return __awaiter(o,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:return i.onRefreshedAcquisitionStateEvent.remove(t),[4,r.sync()];case 1:return e.sent(),[2]}}))}))}]}}))}))}}(e.UnifiedStore||(e.UnifiedStore={}))}(OfficeFirstParty||(OfficeFirstParty={})),function(e){!function(e){function t(){var e=new OfficeCore.RequestContext;return e._customData="WacPartition",e}e.hide=function(e){return __awaiter(this,void 0,void 0,(function(){var n,r;return __generator(this,(function(i){switch(i.label){case 0:return n=t(),r=OfficeCore.BusinessBarService.newObject(n),r.hide(e),[4,n.sync()];case 1:return i.sent(),[2]}}))}))},e.show=function(e,n){return __awaiter(this,void 0,void 0,(function(){var r;return __generator(this,(function(i){switch(i.label){case 0:return r=t(),OfficeCore.BusinessBarService.newObject(r).show(e,n),[4,r.sync()];case 1:return i.sent(),[2]}}))}))}}(e.BusinessBar||(e.BusinessBar={}))}(OfficeFirstParty||(OfficeFirstParty={})),function(e){!function(e){e.launchSimpleDialog=function(e){return __awaiter(this,void 0,void 0,(function(){var t,n,r;return __generator(this,(function(i){switch(i.label){case 0:return t=function(){var e=new OfficeCore.RequestContext;return e._customData="WacPartition",e}(),n=OfficeCore.ShowSimpleDialog.newObject(t),r=n.launchSimpleDialog(e.title,e.description,e.telemetryid,e.category,e.hasButton,e.buttonLabel,e.hasCheckbox,e.checkboxLabel),[4,t.sync()];case 1:return i.sent(),[2,r.value]}}))}))}}(e.SimpleDialog||(e.SimpleDialog={}))}(OfficeFirstParty||(OfficeFirstParty={})),function(e){!function(e){e.execute=function(e,t){return __awaiter(this,void 0,void 0,(function(){var n,r,i;return __generator(this,(function(o){switch(o.label){case 0:return n=function(e){var t=new OfficeCore.RequestContext;return t._customData="WacPartition",t}(),r=OfficeCore.DispatchApiService.newObject(n),i=r.execute(e,t),[4,n.sync()];case 1:return o.sent(),[2,i.value]}}))}))}}(e.DispatchApi||(e.DispatchApi={}))}(OfficeFirstParty||(OfficeFirstParty={})),function(e){!function(e){e.camera="camera",e.microphone="microphone",e.geolocation="geolocation"}(e.DevicePermissionType||(e.DevicePermissionType={})),function(e){e.requestPermissions=function(e){return __awaiter(this,void 0,void 0,(function(){var t,n,r;return __generator(this,(function(i){switch(i.label){case 0:return t=function(){var e=new OfficeCore.RequestContext;return e._customData="WacPartition",e}(),n=OfficeCore.DevicePermissionService.newObject(t),r=n.requestPermissions(e),[4,t.sync()];case 1:return i.sent(),[2,r.value]}}))}))}}(e.devicePermission||(e.devicePermission={}))}(Office||(Office={})),function(e){var t;!function(e){e[e.AddinInvokeResultNotInstalled=-1]="AddinInvokeResultNotInstalled",e[e.AddinInvokeResultSkillNotFound=-2]="AddinInvokeResultSkillNotFound",e[e.AddinInvokeResultLaunchFailed=-3]="AddinInvokeResultLaunchFailed",e[e.AddinInvokeResultSuccess=0]="AddinInvokeResultSuccess",e[e.AddinInvokeResultInvocationFailed=1]="AddinInvokeResultInvocationFailed",e[e.AddinInvokeResultNoResultGenerated=2]="AddinInvokeResultNoResultGenerated",e[e.AddinInvokeResultInvalidResultGenerated=3]="AddinInvokeResultInvalidResultGenerated",e[e.AddinInvokeResultNoActionFunctionMapping=4]="AddinInvokeResultNoActionFunctionMapping"}(t=e.AddinInvokeResult||(e.AddinInvokeResult={})),function(e){var n={},r=null;function i(){var e=new OfficeCore.RequestContext;return e._customData="WacPartition",e}function o(e){!function(){if(null==r){r=function(e){var t=e.actionCorrelationId,r=(e.replyMessage,e.resultCode,n[t]);return null!=r&&(r.replyMessage=e.replyMessage,r.resultCode=e.resultCode,r.replyPromiseResolver()),null};var e=i();OfficeCore.AddinSkillActionService.newObject(e).onReplyReceived.add(r),e.sync().then(null,(function(e){console.log("There was an error registering the reply event listener!")}))}}();var t={correlationId:e,replyPromise:null,replyPromiseResolver:null,replyMessage:null,resultCode:0};return t.replyPromise=new Promise((function(e){t.replyPromiseResolver=e})),n[e]=t,t}e.InvokeAction=function(e,r,a){return __awaiter(this,void 0,void 0,(function(){var s,c,l,u;return __generator(this,(function(f){switch(f.label){case 0:s=i(),c=OfficeCore.AddinSkillActionService.newObject(s),l=OSF.OUtil.Guid.generateNewGuid(),u=o(l),f.label=1;case 1:return f.trys.push([1,,4,5]),c.invokeAction(e,r,a,l),[4,s.sync()];case 2:return f.sent(),[4,u.replyPromise];case 3:return f.sent(),[3,5];case 4:return function(e){delete n[e]}(l),[7];case 5:if(u.resultCode==t.AddinInvokeResultSuccess){if("string"==typeof u.replyMessage)return[2,u.replyMessage];u.resultCode=t.AddinInvokeResultInvalidResultGenerated}switch(u.resultCode){case t.AddinInvokeResultNotInstalled:throw new OfficeExtension.Error({code:"AddinNotInstalled",message:"Add-in not installed."});case t.AddinInvokeResultSkillNotFound:throw new OfficeExtension.Error({code:"SkillNotFound",message:"Skill not found in the add-in manifest."});case t.AddinInvokeResultLaunchFailed:throw new OfficeExtension.Error({code:"LaunchFailed",message:"Add-in launch failed."});case t.AddinInvokeResultInvocationFailed:throw new OfficeExtension.Error({code:"InvocationFailed",message:"Skill invocation failed."});case t.AddinInvokeResultNoResultGenerated:throw new OfficeExtension.Error({code:"NoResultGenerated",message:"No result generated."});case t.AddinInvokeResultInvalidResultGenerated:throw new OfficeExtension.Error({code:"InvalidResultGenerated",message:"Invalid result generated."});case t.AddinInvokeResultNoActionFunctionMapping:throw new OfficeExtension.Error({code:"NoActionFunctionMapping",message:"No action function mapping."});default:throw new OfficeExtension.Error({code:"UnknownError",message:"Unknown error (code = "+u.resultCode+")."})}return[2]}}))}))}}(e.AddinSkillAction||(e.AddinSkillAction={}))}(OfficeFirstParty||(OfficeFirstParty={})),function(e){!function(e){e.getofficethemedataforvisualsurface=function(e){return __awaiter(this,void 0,void 0,(function(){var t,n,r;return __generator(this,(function(i){switch(i.label){case 0:return t=function(e){var t=new OfficeCore.RequestContext;return t._customData="WacPartition",t}(),n=OfficeCore.ThemeService.newObject(t),r=n.getOfficeThemeDataForVisualSurface(e),[4,t.sync()];case 1:return i.sent(),[2,JSON.parse(r.value)]}}))}))}}(e.ThemeService||(e.ThemeService={}))}(OfficeFirstParty||(OfficeFirstParty={})),function(e){!function(t){function n(){var t=new e.RequestContext;return t._customData="WacPartition",t}t.initializeDime=function(t){return __awaiter(this,void 0,void 0,(function(){var r,i,o;return __generator(this,(function(a){switch(a.label){case 0:return r=n(),i=e.Dime.newObject(r),o=i.initializeDime(t),[4,r.sync()];case 1:return a.sent(),[2,o]}}))}))},t.preload=function(t,r){return __awaiter(this,void 0,void 0,(function(){var i,o,a;return __generator(this,(function(s){switch(s.label){case 0:return i=n(),o=e.Dime.newObject(i),a=o.preload(t,r),[4,i.sync()];case 1:return s.sent(),[2,a]}}))}))},t.launch=function(t,r,i,o){return __awaiter(this,void 0,void 0,(function(){var a,s,c,l,u,f,d,p,m,g=this;return __generator(this,(function(h){switch(h.label){case 0:a=n(),(s=e.DimeEventHandlers.newObject(a)).dimeInstanceId=t.dimeInstanceId,c=!1,l=!i,u=!o,f=function(e){return __awaiter(g,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:if(l||c)return[2];l=!0,t.label=1;case 1:return t.trys.push([1,,3,5]),[4,i(e.status)];case 2:return t.sent(),[3,5];case 3:return s.onDimeShown.remove(f),[4,a.sync()];case 4:return t.sent(),[7];case 5:return[2]}}))}))},d=function(){return __awaiter(g,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:if(u||c)return[2];u=!0,e.label=1;case 1:return e.trys.push([1,,3,5]),[4,o()];case 2:return e.sent(),[3,5];case 3:return s.onTaskComplete.remove(d),[4,a.sync()];case 4:return e.sent(),[7];case 5:return[2]}}))}))},i&&s.onDimeShown.add(f),o&&s.onTaskComplete.add(d),h.label=1;case 1:return h.trys.push([1,,5,10]),i||o?[4,a.sync()]:[3,3];case 2:h.sent(),s.dimeInstanceId=t.dimeInstanceId,i&&s._RegisterOnDimeShown(),o&&s._RegisterOnTaskComplete(),h.label=3;case 3:return p=e.Dime.newObject(a),m=p.launch(t,r,s),[4,a.sync()];case 4:return h.sent(),[2,m];case 5:if(c=!0,l&&u)return[3,9];h.label=6;case 6:return h.trys.push([6,8,,9]),l||s.onDimeShown.remove(f),u||s.onTaskComplete.remove(d),[4,a.sync()];case 7:return h.sent(),[3,9];case 8:return h.sent(),[3,9];case 9:return[7];case 10:return[2]}}))}))},t.dispose=function(t){return __awaiter(this,void 0,void 0,(function(){var r,i,o;return __generator(this,(function(a){switch(a.label){case 0:return r=n(),i=e.Dime.newObject(r),o=i.dispose(t),[4,r.sync()];case 1:return a.sent(),[2,o]}}))}))}}(e.DimeApi||(e.DimeApi={}))}(OfficeCore||(OfficeCore={})),function(e){var t=function(){function t(e){this.m_activeView=e}return Object.defineProperty(t.prototype,"type",{get:function(){return e.EventType.ActiveViewChanged},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"activeView",{get:function(){return this.m_activeView.activeView},enumerable:!0,configurable:!0}),t}();e.ActiveViewChangedEventArgs=t}(OSF||(OSF={})),function(e){var t=function(){function t(e,t,n,r,i){this._requiredParameters=e,this._supportedOptions=t,this._privateStateCallbacks=n,this._checkCallArgs=r,this._displayName=i,this._requiredCount=e.length}return t.prototype.verifyArguments=function(t,n){for(var r in t){var i=t[r],o=n[r];if(i.enum)switch(typeof o){case"string":if(e.OUtil.listContainsValue(i.enum,o))break;case"undefined":throw 5007;default:throw e.Utility.createArgumentException(this._displayName)}if(i.types&&!e.OUtil.listContainsValue(i.types,typeof o))throw e.Utility.createArgumentException(this._displayName)}},t.prototype.extractRequiredArguments=function(t,n,r){if(t.length<this._requiredCount)throw e.Utility.createParameterException(e.ErrorNames.MissingRequiredArguments);var i,o=[];for(i=0;i<this._requiredCount;i++)o.push(t[i]);this.verifyArguments(this._requiredParameters,o);var a={};for(i=0;i<this._requiredCount;i++){var s=this._requiredParameters[i],c=o[i];if(s.verify)if(!s.verify(c,n,r))throw e.Utility.createArgumentException(this._displayName);a[s.name]=c}return a},t.prototype.fillOptions=function(t,n,r,i){for(var o in t=t||{},this._supportedOptions)if(!e.OUtil.listContainsKey(t,o)){var a=void 0,s=this._supportedOptions[o];s.calculate&&n&&(a=s.calculate(n,r,i)),a||void 0===s.defaultValue||(a=s.defaultValue),t[o]=a}return t},t.prototype.constructCallArgs=function(e,t,n,r){var i={};for(var o in e)i[o]=e[o];for(var a in t)i[a]=t[a];for(var s in this._privateStateCallbacks)i[s]=this._privateStateCallbacks[s](n,r);return this._checkCallArgs&&(i=this._checkCallArgs(i,n,r)),i},t}();e.ApiMethodCall=t}(OSF||(OSF={})),function(e){var t=function(){function t(t,n,r,i,o,a,s){this._requiredParameters=t,this._supportedOptions=n,this._privateStateCallbacks=r,this._onSucceeded=i,this._onFailed=o,this._displayName=s,this._checkCallArgs=a,this._requiredCount=t.length,this._apiMethods=new e.ApiMethodCall(t,n,r,a,s)}return t.prototype.verifyAndExtractCall=function(e,t,n){var r=this._apiMethods.extractRequiredArguments(e,t,n),i=this.extractOptions(e,r,t,n);return this._apiMethods.constructCallArgs(r,i,t,n)},t.prototype.processResponse=function(t,n,r,i){return 0==t?this._onSucceeded?this._onSucceeded(n,r,i):n:this._onFailed?this._onFailed(t,n):e.DDA.ErrorCodeManager.getErrorArgs(t)},t.prototype.getCallArgs=function(t){for(var n,r,i=t.length-1;i>=this._requiredCount;i--){var o=t[i];switch(typeof o){case"object":n=o;break;case"function":r=o}}return n=n||{},r&&(n[e.ParameterNames.Callback]=r),n},t.prototype.extractOptions=function(t,n,r,i){if(t.length>this._requiredCount+2)throw e.Utility.createParameterException(e.ErrorNames.TooManyArguments);for(var o,a,s=t.length-1;s>=this._requiredCount;s--){var c=t[s];switch(typeof c){case"object":if(o)throw e.Utility.createParameterException(e.ErrorNames.TooManyOptionalObjects);o=c;break;case"function":if(a)throw e.Utility.createParameterException(e.ErrorNames.TooManyOptionalFunctions);a=c;break;default:throw e.Utility.createArgumentException(e.ErrorNames.InvalidValue)}}if(o=this._apiMethods.fillOptions(o,n,r,i),a){if(o[e.ParameterNames.Callback])throw e.ErrorNames.RedundantCallbackSpecification;o[e.ParameterNames.Callback]=a}return this._apiMethods.verifyArguments(this._supportedOptions,o),o},t}();e.AsyncMethodCall=t}(OSF||(OSF={})),function(e){!function(t){var n={};t.define=function(t){var r,i,o;n[t.method]=(i=(r=t).supportedOptions?e.OUtil.createObject(r.supportedOptions):[],o=r.privateStateCallbacks?e.OUtil.createObject(r.privateStateCallbacks):[],new e.AsyncMethodCall(r.requiredArguments||[],i,o,r.onSucceeded,r.onFailed,r.checkCallArgs,r.method))},t.get=function(e){return n[e]}}(e.AsyncMethodCalls||(e.AsyncMethodCalls={}))}(OSF||(OSF={})),function(e){e.AsyncMethods={AddColumnsAsync:"addColumnsAsync",AddFromSelectionAsync:"addFromSelectionAsync",AddFromNamedItemAsync:"addFromNamedItemAsync",AddFromPromptAsync:"addFromPromptAsync",AddHandlerAsync:"addHandlerAsync",AddRowsAsync:"addRowsAsync",BindingSelectionChanged:"bindingSelectionChanged",BindingDataChanged:"bindingDataChanged",ClearFormatsAsync:"clearFormatsAsync",CloseAsync:"close",CloseContainerAsync:"closeContainer",DeleteAllDataValuesAsync:"deleteAllDataValuesAsync",DisplayDialogAsync:"displayDialogAsync",ExecuteFeature:"executeFeature",ExecuteRichApiRequestAsync:"executeRichApiRequestAsync",GetAllAsync:"getAllAsync",GetAccessTokenAsync:"getAccessTokenAsync",GetByIdAsync:"getByIdAsync",GetDataAsync:"getDataAsync",GetDocumentCopyAsync:"getFileAsync",GetDocumentCopyChunkAsync:"getSliceAsync",GetFilePropertiesAsync:"getFilePropertiesAsync",GetSelectedDataAsync:"getSelectedDataAsync",GoToByIdAsync:"goToByIdAsync",OpenBrowserWindow:"openBrowserWindow",QueryFeature:"queryFeature",ReleaseByIdAsync:"releaseByIdAsync",RemoveHandlerAsync:"removeHandlerAsync",ReleaseDocumentCopyAsync:"closeAsync",SetDataAsync:"setDataAsync",SetFormatsAsync:"setFormatsAsync",SetSelectedDataAsync:"setSelectedDataAsync",SetTableOptionsAsync:"setTableOptionsAsync",GetOfficeThemeAsync:"getOfficeThemeAsync",GetDocumentThemeAsync:"getDocumentThemeAsync"}}(OSF||(OSF={})),function(e){!function(e){e.Subset="subset",e.BindingProperties="BindingProperties"}(e.PropertyDescriptors||(e.PropertyDescriptors={}));var t=function(){function t(e,t){this.m_bindingInstance=e,this.m_subset=t}return Object.defineProperty(t.prototype,"startRow",{get:function(){return this.m_subset.startRow},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"startColumn",{get:function(){return this.m_subset.startColumn},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"rowCount",{get:function(){return this.m_subset.rowCount},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"columnCount",{get:function(){return this.m_subset.columnCount},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"type",{get:function(){return e.EventType.BindingSelectionChanged},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"binding",{get:function(){return this.m_bindingInstance},enumerable:!0,configurable:!0}),t}();e.BindingSelectionChangedEventArgs=t;var n=function(){function t(e){this.m_bindingInstance=e}return Object.defineProperty(t.prototype,"type",{get:function(){return e.EventType.BindingDataChanged},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"binding",{get:function(){return this.m_bindingInstance},enumerable:!0,configurable:!0}),t}();e.BindingDataChangedEventArgs=n}(OSF||(OSF={})),function(e){!function(e){e.DataPartProperties="DataPartProperties",e.DataNodeProperties="DataNodeProperties"}(e.PropertyDescriptors||(e.PropertyDescriptors={})),function(e){!function(e){!function(e){e.OldNode="OldNode",e.NewNode="NewNode",e.NextSiblingNode="NextSiblingNode",e.InUndoRedo="InUndoRedo"}(e.DataNodeEventProperties||(e.DataNodeEventProperties={}))}(e.Customxml||(e.Customxml={}))}(e.Marshaling||(e.Marshaling={})),function(e){e.DataNodeInsertedEvent="DataNodeInsertedEvent",e.DataNodeReplacedEvent="DataNodeReplacedEvent",e.DataNodeDeletedEvent="DataNodeDeletedEvent"}(e.EventDescriptors||(e.EventDescriptors={})),function(e){e.OldNode="OldNode",e.NewNode="NewNode",e.NextSiblingNode="NextSiblingNode",e.InUndoRedo="InUndoRedo"}(e.DataNodeEventProperties||(e.DataNodeEventProperties={}));var t=function(){function t(e,t){this.m_newNode=e,this.m_inUndoRedo=t}return Object.defineProperty(t.prototype,"type",{get:function(){return e.EventType.DataNodeInserted},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"newNode",{get:function(){return this.m_newNode},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"inUndoRedo",{get:function(){return this.m_inUndoRedo},enumerable:!0,configurable:!0}),t}();e.NodeInsertedEventArgs=t;var n=function(){function t(e,t,n){this.m_oldNode=e,this.m_newNode=t,this.m_inUndoRedo=n}return Object.defineProperty(t.prototype,"type",{get:function(){return e.EventType.DataNodeReplaced},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"oldNode",{get:function(){return this.m_oldNode},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"newNode",{get:function(){return this.m_newNode},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"inUndoRedo",{get:function(){return this.m_inUndoRedo},enumerable:!0,configurable:!0}),t}();e.NodeReplacedEventArgs=n;var r=function(){function t(e,t,n){this.m_oldNode=e,this.m_oldNextSibling=t,this.m_inUndoRedo=n}return Object.defineProperty(t.prototype,"type",{get:function(){return e.EventType.DataNodeDeleted},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"oldNode",{get:function(){return this.m_oldNode},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"oldNextSibling",{get:function(){return this.m_oldNextSibling},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"inUndoRedo",{get:function(){return this.m_inUndoRedo},enumerable:!0,configurable:!0}),t}();e.NodeDeletedEventArgs=r}(OSF||(OSF={})),function(e){var t=function(t){0==t[e.PropertyDescriptors.MessageType]?e.OUtil.defineEnumerableProperties(this,{type:{value:e.EventType.DialogMessageReceived},message:{value:t[e.PropertyDescriptors.MessageContent]},origin:{value:t[e.PropertyDescriptors.MessageOrigin]}}):e.OUtil.defineEnumerableProperties(this,{type:{value:e.EventType.DialogEventReceived},error:{value:t[e.PropertyDescriptors.MessageType]}})};e.DialogEventArgs=t,function(e){e.MessageType="messageType",e.MessageContent="messageContent",e.MessageOrigin="messageOrigin"}(e.PropertyDescriptors||(e.PropertyDescriptors={}))}(OSF||(OSF={})),function(e){var t=function(){function t(e){this.m_docInstance=e}return Object.defineProperty(t.prototype,"type",{get:function(){return e.EventType.DocumentSelectionChanged},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"document",{get:function(){return this.m_docInstance},enumerable:!0,configurable:!0}),t}();e.DocumentSelectionChangedEventArgs=t}(OSF||(OSF={})),function(e){var t=function(t){e.OUtil.defineEnumerableProperties(this,{type:{value:e.EventType.DialogParentMessageReceived},message:{value:t[e.PropertyDescriptors.MessageContent]},origin:{value:t[e.PropertyDescriptors.MessageOrigin]}})};e.DialogParentEventArgs=t}(OSF||(OSF={})),function(e){e.DialogShownStatus={hasDialogShown:!1,isWindowDialog:!1},function(t){var n;function r(t){return t==e.EventDispId.dispidObjectDeletedEvent||t==e.EventDispId.dispidObjectSelectionChangedEvent||t==e.EventDispId.dispidObjectDataChangedEvent||t==e.EventDispId.dispidContentControlAddedEvent}function i(t,n,r,i){if("number"!=typeof t)throw t;i||(i=n.getCallArgs(r)),s(i,t,e.DDA.ErrorCodeManager.getErrorArgs(t))}function o(t){return(e._OfficeAppFactory.getHostInfo().hostPlatform==e.HostInfoPlatform.web?e.WACDelegate:e.SafeArrayDelegate)[t]}function a(){return n||function(){n={};var t={GoToByIdAsync:82,GetSelectedDataAsync:64,SetSelectedDataAsync:65,GetDocumentCopyChunkAsync:80,ReleaseDocumentCopyAsync:81,GetDocumentCopyAsync:77,AddFromSelectionAsync:66,AddFromPromptAsync:67,AddFromNamedItemAsync:78,GetAllAsync:74,GetByIdAsync:68,ReleaseByIdAsync:69,GetDataAsync:70,SetDataAsync:71,AddRowsAsync:72,AddColumnsAsync:79,DeleteAllDataValuesAsync:73,RefreshAsync:75,SaveAsync:76,GetActiveViewAsync:83,GetFilePropertiesAsync:86,GetOfficeThemeAsync:85,GetDocumentThemeAsync:84,ClearFormatsAsync:87,SetTableOptionsAsync:88,SetFormatsAsync:89,GetUserIdentityInfoAsync:92,GetAccessTokenAsync:98,GetAuthContextAsync:99,ExecuteRichApiRequestAsync:93,AppCommandInvocationCompletedAsync:94,CloseContainerAsync:97,OpenBrowserWindow:102,CreateDocumentAsync:105,InsertFormAsync:106,ExecuteFeature:146,QueryFeature:147,AddDataPartAsync:128,GetDataPartByIdAsync:129,GetDataPartsByNameSpaceAsync:130,GetPartXmlAsync:131,GetPartNodesAsync:132,DeleteDataPartAsync:133,GetNodeValueAsync:134,GetNodeXmlAsync:135,GetRelativeNodesAsync:136,SetNodeValueAsync:137,SetNodeXmlAsync:138,AddDataPartNamespaceAsync:139,GetDataPartNamespaceAsync:140,GetDataPartPrefixAsync:141,GetNodeTextAsync:142,SetNodeTextAsync:143,GetSelectedTask:110,GetTask:112,GetWSSUrl:114,GetTaskField:115,GetSelectedResource:111,GetResourceField:113,GetProjectField:116,GetSelectedView:117,GetTaskByIndex:118,GetResourceByIndex:119,SetTaskField:120,SetResourceField:121,GetMaxTaskIndex:122,GetMaxResourceIndex:123,CreateTask:124};for(var r in t)e.AsyncMethods[r]&&(n[e.AsyncMethods[r]]=t[r]);var i={MessageParent:144,SendMessage:145};for(var r in i)e.SyncMethods[r]&&(n[e.SyncMethods[r]]=i[r]);var o={SettingsChanged:e.EventDispId.dispidSettingsChangedEvent,DocumentSelectionChanged:e.EventDispId.dispidDocumentSelectionChangedEvent,BindingSelectionChanged:e.EventDispId.dispidBindingSelectionChangedEvent,BindingDataChanged:e.EventDispId.dispidBindingDataChangedEvent,ActiveViewChanged:e.EventDispId.dispidActiveViewChangedEvent,OfficeThemeChanged:e.EventDispId.dispidOfficeThemeChangedEvent,DocumentThemeChanged:e.EventDispId.dispidDocumentThemeChangedEvent,AppCommandInvoked:e.EventDispId.dispidAppCommandInvokedEvent,DialogMessageReceived:e.EventDispId.dispidDialogMessageReceivedEvent,DialogParentMessageReceived:e.EventDispId.dispidDialogParentMessageReceivedEvent,ObjectDeleted:e.EventDispId.dispidObjectDeletedEvent,ObjectSelectionChanged:e.EventDispId.dispidObjectSelectionChangedEvent,ObjectDataChanged:e.EventDispId.dispidObjectDataChangedEvent,ContentControlAdded:e.EventDispId.dispidContentControlAddedEvent,LiveShareStateChanged:e.EventDispId.dispidLiveShareStateChangedEvent,RichApiMessage:e.EventDispId.dispidRichApiMessageEvent,DataNodeInserted:e.EventDispId.dispidDataNodeAddedEvent,DataNodeReplaced:e.EventDispId.dispidDataNodeReplacedEvent,DataNodeDeleted:e.EventDispId.dispidDataNodeDeletedEvent};for(var a in o)e.EventType[a]&&(n[e.EventType[a]]=o[a])}(),n}function s(t,n,r){var i=t[e.ParameterNames.Callback];if(i){var o,a={};a[e.DDA.AsyncResultEnum.Properties.Context]=t[e.ParameterNames.AsyncContext],0==n?a[e.DDA.AsyncResultEnum.Properties.Value]=r:(o={},r=r||e.DDA.ErrorCodeManager.getErrorArgs(5001),o[e.DDA.AsyncResultEnum.ErrorProperties.Code]=n||5001,o[e.DDA.AsyncResultEnum.ErrorProperties.Name]=r.name||r,o[e.DDA.AsyncResultEnum.ErrorProperties.Message]=r.message||r),i(new e.DDA.AsyncResult(a,o))}}t.InvokeMethod=function(t,n,r,c){var l,u;try{var f=e.AsyncMethodCalls.get(t);u=f.verifyAndExtractCall(n,r,c);var d=a()[t],p=o("executeAsync"),m=null,g=!1,h=void 0;if(window.Excel&&window.Office.context.requirements.isSetSupported("RedirectV1Api")&&(window.Excel._RedirectV1APIs=!0,l=function(t){var n=!1,r=void 0;if(void 0!==e&&e._OfficeAppFactory&&"function"==typeof e._OfficeAppFactory.getHostInfo&&e.HostInfoPlatform&&e.HostInfoPlatform.ios){var i=e._OfficeAppFactory.getHostInfo();if(i&&i.hostPlatform&&(n=i.hostPlatform===e.HostInfoPlatform.ios)&&e.AsyncMethods)for(var o=Object.keys(e.AsyncMethods),a=0;a<o.length;a++){var s=o[a];if(e.AsyncMethods[s]===t){r=s;break}}}return{isIOSPlatformDetected:n,methodId:r}}(t),g=l.isIOSPlatformDetected,h=l.methodId),window.Excel&&window.Excel._RedirectV1APIs&&(m=window.Excel._V1APIMap[g&&void 0!==h?h:t])){var y=e.OUtil.shallowCopy(u);delete y[e.ParameterNames.AsyncContext],m.preprocess&&(y=m.preprocess(y));var v=new window.Excel.RequestContext,O=m.call(v,y);v.sync().then((function(){var t=O.value,n=t.status;delete t.status,delete t["@odata.type"],m.postprocess&&(t=m.postprocess(t,y)),0!=n&&(t=e.DDA.ErrorCodeManager.getErrorArgs(n)),s(u,n,t)})).catch((function(e){s(u,13991,null)}))}else{var S;S=e.HostParameterMap.toHost(d,u);var b=(new Date).getTime();p({dispId:d,hostCallArgs:S,onCalling:function(){},onReceiving:function(){},onComplete:function(t,n){var i;i=0==t?e.HostParameterMap.fromHost(d,n):n;var o=f.processResponse(t,i,r,u);s(u,t,o),e.AppTelemetry&&e.AppTelemetry.onMethodDone(d,S,Math.abs((new Date).getTime()-b),t)}})}}catch(e){i(e,f,n,u)}},t.AddEventHandler=function(t,n,c,l){var u,f,d,p=!1;function m(t){var r;0==t&&((p?n.addObjectEventHandler(f,u[e.ParameterNames.Id],d):n.addEventHandler(f,d))||(t=13991));0!=t&&(r=e.DDA.ErrorCodeManager.getErrorArgs(t)),s(u,t,r)}try{var g=e.AsyncMethodCalls.get(e.AsyncMethods.AddHandlerAsync);if(u=g.verifyAndExtractCall(t,c,n),f=u[e.ParameterNames.EventType],d=u[e.ParameterNames.Handler],l)return void m(0);var h=a()[f],y=(p=r(h))?u[e.ParameterNames.Id]:c.id||"";if(0==(p?n.getObjectEventHandlerCount(f,y):n.getEventHandlerCount(f)))o("registerEventAsync")({eventType:f,dispId:h,targetId:y,onCalling:function(){},onReceiving:function(){},onComplete:m,onEvent:function(t){var r=e.HostParameterMap.fromHost(h,t);p?n.fireObjectEvent(y,e.manufactureEventArgs(f,y,r)):n.fireEvent(e.manufactureEventArgs(f,c,r))}});else m(0)}catch(e){i(e,g,t,u)}},t.RemoveEventHandler=function(t,n,c){var l,u,f,d=!1;function p(t){var n;0!=t&&(n=e.DDA.ErrorCodeManager.getErrorArgs(t)),s(l,t,n)}try{var m=e.AsyncMethodCalls.get(e.AsyncMethods.RemoveHandlerAsync);u=(l=m.verifyAndExtractCall(t,c,n))[e.ParameterNames.EventType],f=l[e.ParameterNames.Handler];var g,h,y=a()[u],v=(d=r(y))?l[e.ParameterNames.Id]:c.id||"";null===f?(h=d?n.clearObjectEventHandlers(u,v):n.clearEventHandlers(u),g=0):g=(h=d?n.removeObjectEventHandler(u,v,f):n.removeEventHandler(u,f))?0:5003;var O=d?n.getObjectEventHandlerCount(u,v):n.getEventHandlerCount(u);if(h&&0==O)o("unregisterEventAsync")({eventType:u,dispId:y,targetId:v,onCalling:function(){},onReceiving:function(){},onComplete:p});else p(g)}catch(e){i(e,m,t,l)}},t.OpenDialog=function(t,n,r){var c,l,u=e.EventType.DialogMessageReceived,f=e.EventType.DialogEventReceived;function d(t){if(0!=t)o=e.DDA.ErrorCodeManager.getErrorArgs(t);else{var i={};i.id=l,i.data=n;var o=p.processResponse(t,i,r,c);e.DialogShownStatus.hasDialogShown=!0,n.clearEventHandlers(u),n.clearEventHandlers(f)}s(c,t,o)}try{if(null!=u&&null!=f||d(5e3),null==e.AsyncMethods.DisplayDialogAsync)return void d(5001);var p=e.AsyncMethodCalls.get(e.AsyncMethods.DisplayDialogAsync);c=p.verifyAndExtractCall(t,r,n);var m=a()[u],g=o("openDialog");l=JSON.stringify(c),e.DialogShownStatus.hasDialogShown||(n.clearQueuedEvent(u),n.clearQueuedEvent(f),n.clearQueuedEvent(e.EventType.DialogParentMessageReceived)),g({eventType:u,dispId:m,targetId:l,onCalling:function(){},onReceiving:function(){},onComplete:d,onEvent:function(t){var i=e.HostParameterMap.fromHost(m,t),o=e.manufactureEventArgs(u,r,i);if(o.type==f){e.DDA.ErrorCodeManager.getErrorArgs(o.error);var a={};a.code=status||5001,o.error=new e.DDA.Error(a[e.DDA.AsyncResultEnum.ErrorProperties.Name],a[e.DDA.AsyncResultEnum.ErrorProperties.Message],a[e.DDA.AsyncResultEnum.ErrorProperties.Code])}n.fireOrQueueEvent(o),12006==i.messageType&&(n.clearEventHandlers(u),n.clearEventHandlers(f),n.clearEventHandlers(e.EventType.DialogParentMessageReceived),e.DialogShownStatus.hasDialogShown=!1)}})}catch(e){i(e,p,t,c)}},t.CloseDialog=function(t,n,r,s){var c,l,u;try{var f=e.AsyncMethodCalls.get(e.AsyncMethods.CloseAsync);c=f.verifyAndExtractCall(t,s,r),l=e.EventType.DialogMessageReceived,u=e.EventType.DialogEventReceived,r.clearEventHandlers(l),r.clearEventHandlers(u);var d=a()[l];o("closeDialog")({eventType:l,dispId:d,targetId:n,onCalling:function(){},onReceiving:function(){},onComplete:function(t){t,e.DialogShownStatus.hasDialogShown=!1}})}catch(e){i(e,f,t,c)}},t.MessageParent=function(t,n){var r=e.SyncMethodCalls.get(e.SyncMethods.MessageParent).verifyAndExtractCall(t,n,{});return o("messageParent")({dispId:a()[e.SyncMethods.MessageParent],hostCallArgs:r,onCalling:function(){},onReceiving:function(){}})},t.SendMessage=function(t,n,r){var i=e.SyncMethodCalls.get(e.SyncMethods.SendMessage).verifyAndExtractCall(t,r,{});return o("sendMessage")({dispId:a()[e.SyncMethods.SendMessage],hostCallArgs:i,onCalling:function(){},onReceiving:function(){}})},t.addAsyncMethods=function(t,n,r){for(var i in n){var o=n[i];t[o]||e.OUtil.defineEnumerableProperty(t,o,{value:function(n){return function(){var i=e.DispIdHost.InvokeMethod;i(n,arguments,t,r)}}(o)})}},t.addEventSupport=function(t,n,r){var i=e.AsyncMethods.AddHandlerAsync,o=e.AsyncMethods.RemoveHandlerAsync;t[i]||e.OUtil.defineEnumerableProperty(t,i,{value:function(){var i=e.DispIdHost.AddEventHandler;i(arguments,n,t,r)}}),t[o]||e.OUtil.defineEnumerableProperty(t,o,{value:function(){var r=e.DispIdHost.RemoveEventHandler;r(arguments,n,t)}})},t.issueAsyncResult=s}(e.DispIdHost||(e.DispIdHost={}))}(OSF||(OSF={})),function(e){e.manufactureEventArgs=function(t,n,r){var i;switch(t){case e.EventType.DocumentSelectionChanged:i=new e.DocumentSelectionChangedEventArgs(n);break;case e.EventType.BindingSelectionChanged:i=new e.BindingSelectionChangedEventArgs(e.manufactureBinding(r,n.document),r[e.PropertyDescriptors.Subset]);break;case e.EventType.BindingDataChanged:i=new e.BindingDataChangedEventArgs(e.manufactureBinding(r,n.document));break;case e.EventType.SettingsChanged:i=new e.SettingsChangedEventArgs(n);break;case e.EventType.ActiveViewChanged:i=new e.ActiveViewChangedEventArgs(r);break;case e.EventType.LiveShareStateChanged:i=new e.LiveShareStateChangedEventArgs(r);break;case e.EventType.OfficeThemeChanged:i=new e.DDA.Theming.OfficeThemeChangedEventArgs(r);break;case e.EventType.DocumentThemeChanged:i=new e.DDA.Theming.DocumentThemeChangedEventArgs(r);break;case e.EventType.DataNodeInserted:i=new e.NodeInsertedEventArgs(e.manufactureDataNode(r[e.DataNodeEventProperties.NewNode]),r[e.DataNodeEventProperties.InUndoRedo]);break;case e.EventType.DataNodeReplaced:i=new e.NodeReplacedEventArgs(e.manufactureDataNode(r[e.DataNodeEventProperties.OldNode]),e.manufactureDataNode(r[e.DataNodeEventProperties.NewNode]),r[e.DataNodeEventProperties.InUndoRedo]);break;case e.EventType.DataNodeDeleted:i=new e.NodeDeletedEventArgs(e.manufactureDataNode(r[e.DataNodeEventProperties.OldNode]),e.manufactureDataNode(r[e.DataNodeEventProperties.NextSiblingNode]),r[e.DataNodeEventProperties.InUndoRedo]);break;case e.EventType.DialogMessageReceived:i=new e.DialogEventArgs(r);break;case e.EventType.DialogParentMessageReceived:i=new e.DialogParentEventArgs(r)}return i}}(OSF||(OSF={})),function(e){var t="toHost",n="fromHost";!function(r){var i;r.self="self",r.dynamicTypes={},r.dynamicTypes[e.ParameterNames.Data]={toHost:function(t){if(null!=t&&void 0!==t.rows){var n={};n[e.TableDataProperties.TableRows]=t.rows,n[e.TableDataProperties.TableHeaders]=t.headers,t=n}return t},fromHost:function(e){return e}},r.dynamicTypes.sampleData=r.dynamicTypes.data;var o={};function a(e,t){var n,i;if(t.map)for(var a in i={},n=t.map){var s=n[a];s==r.self&&(s=a),i[s]=a}else n=t.toHost,i=t.fromHost;var c=o[e];if(c){var l=c.toHost;for(var u in l)n[u]=l[u];for(var f in l=c.fromHost)i[f]=l[f]}else c=o[e]={};c.toHost=n,c.fromHost=i}function s(e){u().addComplexType(e)}function c(t,i){var a=t?{}:void 0;for(var s in t){var l,f=t[s];if(e.ListType.isListType(s))for(var d in l=[],f)l.push(c(f[d],i));else if(e.OUtil.listContainsKey(r.dynamicTypes,s))l=r.dynamicTypes[s][i](f);else if(i==n&&u().preserveNesting(s))l=c(f,i);else{var p=o[s];if(p){var m=p[i];m&&void 0===(l=m[f])&&(l=f)}else l=f}a[s]=l}return a}function l(t,n,i){var a,s=o[t][i];if("toHost"==i)a=function e(t,n){var i;for(var a in n){var s;if(null!=(s=u().isComplexType(a)?e(t,o[a].toHost):t[a])){i||(i={});var c=n[a];c==r.self&&(c=a),i[c]=u().pack(a,s)}}return i}(c(n,i),s);else if("fromHost"==i){a=c(function t(n,i,a){for(var s in a||(a={}),i){var c,l,f=i[s];if(f==r.self)c=n;else{if("sourceData"==f){a[s]=n.toArray();continue}c=n[f]}if(null==c)a[s]=void 0;else if(c=u().unpack(s,c),u().isComplexType(s))l=o[s].fromHost,u().preserveNesting(s)?a[s]=t(c,l):t(c,l,a);else if(e.ListType.isListType(s)){(l={})[e.ListType.getDescriptor(s)]=r.self;var d=new Array(c.length);for(var p in c)d[p]=t(c[p],l);a[s]=d}else a[s]=c}return a}(n,s),i)}return a}function u(){if(!i){var t=e._OfficeAppFactory.getHostInfo();i=t.hostPlatform==e.HostInfoPlatform.web?new e.WebSpecialProcessor:new e.SafeArraySpecialProcessor}return i}function f(e){var t=null;if(e){t={};for(var n=e.length,r=0;r<n;r++)t[e[r].name]=e[r].value}return t}r.define=function(e){var t={},n=f(e.toHost);e.invertible?t.map=n:e.canonical?t.toHost=t.fromHost=n:(t.toHost=n,t.fromHost=f(e.fromHost)),a(e.type,t),e.isComplexType&&s(e.type)},r.toHost=function(e,n){return l(e,n,t)},r.fromHost=function(e,t){return l(e,t,n)},r.addMapping=a,r.addComplexType=s,r.getDynamicType=function(e){return u().getDynamicType(e)},r.setDynamicType=function(e,t){u().setDynamicType(e,t)},r.doMapValues=function(e,t){return c(e,t)}}(e.HostParameterMap||(e.HostParameterMap={}))}(OSF||(OSF={})),function(e){!function(t){var n={};t.setListType=function(e,t){n[e]=t},t.isListType=function(t){return e.OUtil.listContainsKey(n,t)},t.getDescriptor=function(e){return n[e]}}(e.ListType||(e.ListType={}))}(OSF||(OSF={})),function(e){var t=function(){function t(e){this.m_liveShareStateInstance=e}return Object.defineProperty(t.prototype,"type",{get:function(){return e.EventType.LiveShareStateChanged},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"liveShareState",{get:function(){return this.m_liveShareStateInstance},enumerable:!0,configurable:!0}),t}();e.LiveShareStateChangedEventArgs=t}(OSF||(OSF={})),function(e){!function(e){e.ActiveViewChanged="activeViewChanged",e.DialogMessageReceived="dialogMessageReceived",e.DialogParentMessageReceived="dialogParentMessageReceived",e.DialogParentEventReceived="dialogParentEventReceived",e.DialogEventReceived="dialogEventReceived",e.BindingDataChanged="bindingDataChanged",e.BindingSelectionChanged="bindingSelectionChanged",e.OfficeThemeChanged="officeThemeChanged",e.DocumentThemeChanged="documentThemeChanged",e.DataNodeDeleted="nodeDeleted",e.DataNodeInserted="nodeInserted",e.DataNodeReplaced="nodeReplaced",e.DocumentSelectionChanged="documentSelectionChanged",e.LiveShareStateChanged="liveShareStateChanged",e.NodeDeleted="nodeDeleted",e.NodeInserted="nodeInserted",e.NodeReplaced="nodeReplaced",e.SettingsChanged="settingsChanged"}(e.EventType||(e.EventType={}))}(Office||(Office={})),function(e){!function(e){e.TableRows="TableRows",e.TableHeaders="TableHeaders"}(e.TableDataProperties||(e.TableDataProperties={}))}(OSF||(OSF={})),function(e){!function(t){var n,r,i;function o(){try{var e=window.navigator.userAgent;return e.indexOf("MSIE ")>-1||e.indexOf("Trident/")>-1||e.indexOf("Edge/")>-1}catch(e){return l("Error happens in isInternetExplorer.",e),!1}}function a(e){if("undefined"!=typeof JSON)try{return JSON.stringify(e)}catch(e){}return""}!function(e){e.ButtonBorderColor="buttonBorderColor",e.ButtonBackgroundColor="buttonBackgroundColor"}(t.HostThemeButtonStyleKeys||(t.HostThemeButtonStyleKeys={})),function(e){e.HostButtonBorderColor="#86bfa0",e.HostButtonBackgroundColor="#d3f0e0"}(n||(n={})),function(e){e.HostButtonBorderColor="#a3bde3",e.HostButtonBackgroundColor="#d5e1f2"}(r||(r={})),function(e){e.HostButtonBorderColor="#f5ba9d",e.HostButtonBackgroundColor="#fcf0ed"}(i||(i={})),t.finalizeProperties=function(e,t){t=t||{};for(var n=Object.getOwnPropertyNames(e),r=n.length,i=0;i<r;i++){var o=n[i],a=Object.getOwnPropertyDescriptor(e,o);a.get||a.set||(a.writable=t.writable||!1),a.configurable=t.configurable||!1,a.enumerable=t.enumerable||!0,Object.defineProperty(e,o,a)}return e},t.defineEnumerableProperties=function(e,t){return function(e,t,n){for(var r in t=t||{})c(e,r,t[r],n);return e}(e,t,["enumerable"])},t.defineEnumerableProperty=function(e,t,n){return c(e,t,n,["enumerable"])},t.listContainsKey=function(e,t){for(var n in e)if(t==n)return!0;return!1},t.augmentList=function(e,t){var n=e.push?function(t,n){e.push(n)}:function(t,n){e[t]=n};for(var r in t)n(r,t[r])},t.createObject=function(e){var t=null;if(e){t={};for(var n=e.length,r=0;r<n;r++)t[e[r].name]=e[r].value}return t},t.listContainsValue=function(e,t){for(var n in e)if(t==e[n])return!0;return!1},t.shouldUseLocalStorageToPassMessage=function(){try{for(var e=["Windows NT 6.1","Windows NT 6.2","Windows NT 6.3","Windows NT 10.0"],t=window.navigator.userAgent,n=0,r=e.length;n<r;n++)if(t.indexOf(e[n])>-1)return o();return!1}catch(e){return l("Error happens in shouldUseLocalStorageToPassMessage.",e),!1}},t.isInternetExplorer=o,t.serializeObjectToString=a,t.formatString=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=e,r=n[0];return r.replace(/{(\d+)}/gm,(function(e,t){var r=parseInt(t,10)+1;return void 0===n[r]?"{"+t+"}":n[r]}))},t.addHostInfoAsQueryParam=function(e,t){if(!e)return null;var n,r="#",i=(e=e.trim()||"").split(r),o=i.shift(),a=i.join(r),s=o.split("?");return s.length>1?n=o+"&_host_Info="+t:s.length>0&&(n=o+"?_host_Info="+t),a?[n,r,a].join(""):n},t.getHostnamePortionForLogging=function(e){var t=e.split("."),n=t.length;return n>=2?t[n-2]+"."+t[n-1]:1==n?t[0]:void 0},t.shallowCopy=function(e){if(null==e)return null;if(e instanceof Object){if(Array.isArray(e)){for(var t=[],n=0;n<e.length;n++)t.push(e[n]);return t}var r=e.constructor();for(var i in e)e.hasOwnProperty(i)&&(r[i]=e[i]);return r}return e},t.getXdmEventName=function(t,n){return n==e.EventType.BindingSelectionChanged||n==e.EventType.BindingDataChanged||n==e.EventType.DataNodeDeleted||n==e.EventType.DataNodeInserted||n==e.EventType.DataNodeReplaced?t+"_"+n:n},t.getCommonUI=function(){switch(Office.context.host){case Office.HostType.Excel:return n;case Office.HostType.Word:return r;case Office.HostType.PowerPoint:return i}return null},t.getDomainForUrl=function(e){if(!e)return null;var t=document.createElement("a");return t.href=e,t.protocol+"//"+t.host};var s=-1;function c(e,t,n,r){for(var i in n=n||{},r){var o=r[i];null==n[o]&&(n[o]=!0)}return Object.defineProperty(e,t,n),e}function l(t,n){e.Utility.trace(t+" Exception details: "+a(n))}t.getUniqueId=function(){return(s+=1).toString()}}(e.OUtil||(e.OUtil={}))}(OSF||(OSF={})),function(e){!function(e){e.BindingType="bindingType",e.CoercionType="coercionType",e.ValueFormat="valueFormat",e.FilterType="filterType",e.Columns="columns",e.SampleData="sampleData",e.GoToType="goToType",e.SelectionMode="selectionMode",e.Id="id",e.PromptText="promptText",e.ItemName="itemName",e.FailOnCollision="failOnCollision",e.StartRow="startRow",e.StartColumn="startColumn",e.RowCount="rowCount",e.ColumnCount="columnCount",e.Rows="rows",e.OverwriteIfStale="overwriteIfStale",e.FileType="fileType",e.EventType="eventType",e.Handler="handler",e.SliceSize="sliceSize",e.SliceIndex="sliceIndex",e.ActiveView="activeView",e.Status="status",e.PlatformType="platformType",e.HostType="hostType",e.Email="email",e.OfficeTheme="officeTheme",e.DocumentTheme="documentTheme",e.ForceConsent="forceConsent",e.ForceAddAccount="forceAddAccount",e.AuthChallenge="authChallenge",e.AllowConsentPrompt="allowConsentPrompt",e.ForMSGraphAccess="forMSGraphAccess",e.AllowSignInPrompt="allowSignInPrompt",e.JsonPayload="jsonPayload",e.EnableNewHosts="enableNewHosts",e.AccountTypeFilter="accountTypeFilter",e.AddinTrustId="addinTrustId",e.Reserved="reserved",e.Tcid="tcid",e.Xml="xml",e.Namespace="namespace",e.Prefix="prefix",e.XPath="xPath",e.Text="text",e.ImageLeft="imageLeft",e.ImageTop="imageTop",e.ImageWidth="imageWidth",e.ImageHeight="imageHeight",e.TaskId="taskId",e.FieldId="fieldId",e.FieldValue="fieldValue",e.ServerUrl="serverUrl",e.ListName="listName",e.ResourceId="resourceId",e.ViewType="viewType",e.ViewName="viewName",e.GetRawValue="getRawValue",e.CellFormat="cellFormat",e.TableOptions="tableOptions",e.TaskIndex="taskIndex",e.ResourceIndex="resourceIndex",e.CustomFieldId="customFieldId",e.Url="url",e.MessageHandler="messageHandler",e.Width="width",e.Height="height",e.RequireHTTPs="requireHTTPS",e.DisplayInIframe="displayInIframe",e.HideTitle="hideTitle",e.UseDeviceIndependentPixels="useDeviceIndependentPixels",e.PromptBeforeOpen="promptBeforeOpen",e.EnforceAppDomain="enforceAppDomain",e.UrlNoHostInfo="urlNoHostInfo",e.Base64="base64",e.FormId="formId"}(e.ParameterNames||(e.ParameterNames={}))}(OSF||(OSF={})),function(e){!function(t){function n(t,n){var r=(new Date).getTime();return function(i){n.onReceiving&&n.onReceiving();var o=i.toArray?i.toArray()[0]:i;return n.onComplete&&n.onComplete(o),e.AppTelemetry&&e.AppTelemetry.onRegisterDone(t,n.dispId,Math.abs((new Date).getTime()-r),o),!0}}function r(e){var t=e;if(null!=e&&e.toArray){var n=e.toArray();t=new Array(n.length);for(var i=0;i<n.length;i++)t[i]=r(n[i])}return t}t.executeAsync=function(t){try{t.onCalling&&t.onCalling(),e._OfficeAppFactory.getClientHostController().execute(t.dispId,function t(n){var r=n;if(e.OUtil.isArray(n))for(var i=r.length,o=0;o<i;o++)r[o]=t(r[o]);else if(e.OUtil.isDate(n))r=n.getVarDate();else if("object"==typeof n&&!e.OUtil.isArray(n))for(var a in r=[],n)e.OUtil.isFunction(n[a])||(r[a]=t(n[a]));return r}(t.hostCallArgs),(function(e,n){var i,o;if("number"==typeof e?(i=[],o=e):o=(i=e.toArray())[0],1==o)return null!=(a=r(a=i[1]))&&(t._chunkResultData||(t._chunkResultData=new Array),t._chunkResultData[a[0]]=a[1]),!1;if(t.onReceiving&&t.onReceiving(),t.onComplete){var a;if(0==o){if(i.length>2){a=[];for(var s=1;s<i.length;s++)a[s-1]=i[s]}else a=i[1];if(t._chunkResultData&&null!=(a=r(a))){var c=a[a.length-1];t._chunkResultData.length==c?a[a.length-1]=t._chunkResultData:o=5001}}else a=i[1];t.onComplete(o,a)}return!0}))}catch(n){e.SafeArrayDelegate.onException(n,t)}},t.registerEventAsync=function(t){t.onCalling&&t.onCalling();var r=n(!0,t);try{e._OfficeAppFactory.getClientHostController().registerEvent(t.dispId,void 0,t.targetId,(function(n,r){t.onEvent&&t.onEvent(r),e.AppTelemetry&&e.AppTelemetry.onEventDone(t.dispId)}),r)}catch(n){e.SafeArrayDelegate.onException(n,t)}},t.unregisterEventAsync=function(t){t.onCalling&&t.onCalling();var r=n(!1,t);try{e._OfficeAppFactory.getClientHostController().unregisterEvent(t.dispId,void 0,t.targetId,r)}catch(n){e.SafeArrayDelegate.onException(n,t)}},t.onException=function(t,n){var r,i=t.number;if(i)switch(i){case-2146828218:r=7e3;break;case-2147467259:r=n.dispId==e.EventDispId.dispidDialogMessageReceivedEvent?12007:5001;break;case-2146828283:case-2147209089:r=5010;break;case-2147208704:r=5100;break;case-2146827850:default:r=5001}n.onComplete&&n.onComplete(r||5001)},t.onExceptionSyncMethod=function(e,t){var n,r=e.number;if(r)switch(r){case-2146828218:n=7e3;break;case-2146827850:default:n=5001}return n||5001},t.getOnAfterRegisterEvent=n}(e.SafeArrayDelegate||(e.SafeArrayDelegate={}))}(OSF||(OSF={})),function(e){var t=function(){function t(e){this.m_settingsInstance=e}return Object.defineProperty(t.prototype,"type",{get:function(){return e.EventType.SettingsChanged},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"settings",{get:function(){return this.m_settingsInstance},enumerable:!0,configurable:!0}),t}();e.SettingsChangedEventArgs=t}(OSF||(OSF={})),function(e){var t=function(){function t(e,t){this._complexTypes=e,this.dynamicTypes=t}return t.prototype.addComplexType=function(e){this._complexTypes.push(e)},t.prototype.getDynamicType=function(e){return this.dynamicTypes[e]},t.prototype.setDynamicType=function(e,t){this.dynamicTypes[e]=t},t.prototype.isComplexType=function(t){return e.OUtil.listContainsValue(this._complexTypes,t)},t.prototype.isDynamicType=function(t){return e.OUtil.listContainsKey(this.dynamicTypes,t)},t.prototype.preserveNesting=function(e){return!1},t.prototype.pack=function(e,t){return this.isDynamicType(e)?this.dynamicTypes[e].toHost(t):t},t.prototype.unpack=function(e,t){return this.isDynamicType(e)?this.dynamicTypes[e].fromHost(t):t},t}();e.SpecialProcessor=t}(OSF||(OSF={}));__extends=this&&this.__extends||function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();!function(e){var t=function(t){function n(){var n={};return n[e.ParameterNames.Data]={toHost:function(t){if(e.TableDataProperties&&"string"!=typeof t&&void 0!==t[e.TableDataProperties.TableRows]){var n=[];n[0]=t[e.TableDataProperties.TableRows],n[1]=t[e.TableDataProperties.TableHeaders],t=n}return t},fromHost:function(t){var n;if(t.toArray)if(2===t.dimensions())n=e.Utility.twoDVBArrayToJaggedArray(t);else{var r=t.toArray();2===r.length&&(null!=r[0]&&r[0].toArray||null!=r[1]&&r[1].toArray)?((n={})[e.TableDataProperties.TableRows]=e.Utility.twoDVBArrayToJaggedArray(r[0]),n[e.TableDataProperties.TableHeaders]=e.Utility.twoDVBArrayToJaggedArray(r[1])):n=r}else n=t;return n}},t.call(this,[],n)||this}return __extends(n,t),n.prototype.unpack=function(t,n){var r;this.isComplexType(t)||e.ListType.isListType(t)?r=void 0!==n&&void 0!==n.toArray?n.toArray():n||{}:r=this.isDynamicType(t)?this.dynamicTypes[t].fromHost(n):n;return r},n}(e.SpecialProcessor);e.SafeArraySpecialProcessor=t}(OSF||(OSF={})),function(e){var t=function(){function t(t,n,r,i,o){this._requiredCount=t.length,this._apiMethods=new e.ApiMethodCall(t,n,r,i,o),this._supportedOptions=n}return t.prototype.verifyAndExtractCall=function(e,t,n){var r=this._apiMethods.extractRequiredArguments(e,t,n),i=this.extractOptions(e,r,t,n);return this._apiMethods.constructCallArgs(r,i,t,n)},t.prototype.extractOptions=function(t,n,r,i){if(t.length>this._requiredCount+1)throw e.Utility.createParameterException(e.ErrorNames.TooManyArguments);for(var o,a=t.length-1;a>=this._requiredCount;a--){var s=t[a];switch(typeof s){case"object":if(o)throw e.Utility.createParameterException(e.ErrorNames.TooManyArguments);o=s;break;default:throw e.Utility.createArgumentException(e.ErrorNames.InvalidOptionalArgument)}}return o=this._apiMethods.fillOptions(o,n,r,i),this._apiMethods.verifyArguments(this._supportedOptions,o),o},t}();e.SyncMethodCall=t}(OSF||(OSF={})),function(e){!function(t){var n={};t.define=function(t){var r,i;n[t.method]=(i=(r=t).supportedOptions?e.OUtil.createObject(r.supportedOptions):[],new e.SyncMethodCall(r.requiredArguments||[],i,r.privateStateCallbacks,r.checkCallArgs,r.method.displayName))},t.get=function(e){return n[e]}}(e.SyncMethodCalls||(e.SyncMethodCalls={}))}(OSF||(OSF={})),function(e){e.SyncMethods={MessageParent:"messageParent",MessageChild:"messageChild",SendMessage:"sendMessage",AddMessageHandler:"addEventHandler"}}(OSF||(OSF={})),function(e){!function(t){!function(t){function n(t){for(var n=[{name:e.DDA.Theming.DocumentThemeEnum.PrimaryFontColor,needToConvertToHex:!0},{name:e.DDA.Theming.DocumentThemeEnum.PrimaryBackgroundColor,needToConvertToHex:!0},{name:e.DDA.Theming.DocumentThemeEnum.SecondaryFontColor,needToConvertToHex:!0},{name:e.DDA.Theming.DocumentThemeEnum.SecondaryBackgroundColor,needToConvertToHex:!0},{name:e.DDA.Theming.DocumentThemeEnum.Accent1,needToConvertToHex:!0},{name:e.DDA.Theming.DocumentThemeEnum.Accent2,needToConvertToHex:!0},{name:e.DDA.Theming.DocumentThemeEnum.Accent3,needToConvertToHex:!0},{name:e.DDA.Theming.DocumentThemeEnum.Accent4,needToConvertToHex:!0},{name:e.DDA.Theming.DocumentThemeEnum.Accent5,needToConvertToHex:!0},{name:e.DDA.Theming.DocumentThemeEnum.Accent6,needToConvertToHex:!0},{name:e.DDA.Theming.DocumentThemeEnum.Hyperlink,needToConvertToHex:!0},{name:e.DDA.Theming.DocumentThemeEnum.FollowedHyperlink,needToConvertToHex:!0},{name:e.DDA.Theming.DocumentThemeEnum.HeaderLatinFont,needToConvertToHex:!1},{name:e.DDA.Theming.DocumentThemeEnum.HeaderEastAsianFont,needToConvertToHex:!1},{name:e.DDA.Theming.DocumentThemeEnum.HeaderScriptFont,needToConvertToHex:!1},{name:e.DDA.Theming.DocumentThemeEnum.HeaderLocalizedFont,needToConvertToHex:!1},{name:e.DDA.Theming.DocumentThemeEnum.BodyLatinFont,needToConvertToHex:!1},{name:e.DDA.Theming.DocumentThemeEnum.BodyEastAsianFont,needToConvertToHex:!1},{name:e.DDA.Theming.DocumentThemeEnum.BodyScriptFont,needToConvertToHex:!1},{name:e.DDA.Theming.DocumentThemeEnum.BodyLocalizedFont,needToConvertToHex:!1}],r={},i=0;i<n.length;i++)n[i].needToConvertToHex?r[n[i].name]=e.OUtil.convertIntToCssHexColor(t[n[i].name]):r[n[i].name]=t[n[i].name];return r}function r(t){var n={};if(t){var r=e.DDA.Theming.OfficeThemeEnum,i={bodyBackgroundColor:{name:r.BodyBackgroundColor,convertToHex:!0},bodyForegroundColor:{name:r.BodyForegroundColor,convertToHex:!0},controlBackgroundColor:{name:r.ControlBackgroundColor,convertToHex:!0},controlForegroundColor:{name:r.ControlForegroundColor,convertToHex:!0},primaryFontColor:{name:r.BodyForegroundColor,convertToHex:!0},primaryBackgroundColor:{name:r.BodyBackgroundColor,convertToHex:!0},secondaryFontColor:{name:r.ControlForegroundColor,convertToHex:!0},secondaryBackgroundColor:{name:r.ControlBackgroundColor,convertToHex:!0},fluentThemeData:{name:r.FluentThemeData,convertToHex:!1}};for(var o in t){var a=!1,s=o;i[o]&&(s=i[o].name,a=i[o].convertToHex),n[s]=a?e.OUtil.convertIntToCssHexColor(t[o]):t[o]}null==n[r.IsDarkTheme]&&(n[r.IsDarkTheme]=e.DDA.Theming.GetIsDarkThemeFromCSSHexColor(n[r.BodyBackgroundColor])),null==n[r.ThemeId]&&(n[r.ThemeId]=n[r.IsDarkTheme]?e.DDA.Theming.ThemeId.Black:e.DDA.Theming.ThemeId.White)}return n}!function(e){e.PrimaryFontColor="primaryFontColor",e.PrimaryBackgroundColor="primaryBackgroundColor",e.SecondaryFontColor="secondaryFontColor",e.SecondaryBackgroundColor="secondaryBackgroundColor",e.Accent1="accent1",e.Accent2="accent2",e.Accent3="accent3",e.Accent4="accent4",e.Accent5="accent5",e.Accent6="accent6",e.Hyperlink="hyperlink",e.FollowedHyperlink="followedHyperlink",e.HeaderLatinFont="headerLatinFont",e.HeaderEastAsianFont="headerEastAsianFont",e.HeaderScriptFont="headerScriptFont",e.HeaderLocalizedFont="headerLocalizedFont",e.BodyLatinFont="bodyLatinFont",e.BodyEastAsianFont="bodyEastAsianFont",e.BodyScriptFont="bodyScriptFont",e.BodyLocalizedFont="bodyLocalizedFont"}(t.DocumentThemeEnum||(t.DocumentThemeEnum={})),function(e){e.BodyBackgroundColor="bodyBackgroundColor",e.BodyForegroundColor="bodyForegroundColor",e.ControlBackgroundColor="controlBackgroundColor",e.ControlForegroundColor="controlForegroundColor",e.IsDarkTheme="isDarkTheme",e.ThemeId="themeId",e.FluentThemeData="fluentThemeData"}(t.OfficeThemeEnum||(t.OfficeThemeEnum={})),function(e){e.PrimaryFontColor="primaryFontColor",e.PrimaryBackgroundColor="primaryBackgroundColor",e.SecondaryFontColor="secondaryFontColor",e.SecondaryBackgroundColor="secondaryBackgroundColor",e.IsDarkTheme="isDarkTheme",e.ThemeId="themeId"}(t.OfficeThemeEnumWac||(t.OfficeThemeEnumWac={})),function(e){e[e.Colorful=0]="Colorful",e[e.DarkGray=1]="DarkGray",e[e.Black=2]="Black",e[e.White=3]="White"}(t.ThemeId||(t.ThemeId={})),t.ConvertToDocumentTheme=n,t.GetIsDarkThemeFromCSSHexColor=function(e){var t="#"===e.charAt(0)?e.substring(1,7):e;return.299*parseInt(t.substring(0,2),16)+.587*parseInt(t.substring(2,4),16)+.114*parseInt(t.substring(4,6),16)<186},t.ConvertToOfficeTheme=r;var i=function(t){var n=null,i=e._OfficeAppFactory.getHostInfo();n=i.hostPlatform==e.HostInfoPlatform.web?t:r(t);var o=e.DDA.Theming.OfficeThemeEnum;void 0===n[o.IsDarkTheme]&&(n.isDarkTheme=e.DDA.Theming.GetIsDarkThemeFromCSSHexColor(t[o.BodyBackgroundColor])),void 0===n[o.ThemeId]&&(n.themeId=n.isDarkTheme?e.DDA.Theming.ThemeId.Black:e.DDA.Theming.ThemeId.White),i.hostPlatform!=e.HostInfoPlatform.web&&"mac"!=i.hostPlatform.toLowerCase()&&"ios"!=i.hostPlatform.toLowerCase()||Office.context&&Office.context.officeTheme&&(Office.context.officeTheme.bodyBackgroundColor=n.bodyBackgroundColor,Office.context.officeTheme.bodyForegroundColor=n.bodyForegroundColor,Office.context.officeTheme.controlBackgroundColor=n.controlBackgroundColor,Office.context.officeTheme.controlForegroundColor=n.controlForegroundColor,Office.context.officeTheme.isDarkTheme=n.isDarkTheme,Office.context.officeTheme.themeId=n.themeId),e.OUtil.defineEnumerableProperties(this,{type:{value:Microsoft.Office.WebExtension.EventType.OfficeThemeChanged},officeTheme:{value:n}})};t.OfficeThemeChangedEventArgs=i;var o=function(t){var r=n(t);e.OUtil.defineEnumerableProperties(this,{type:{value:Microsoft.Office.WebExtension.EventType.DocumentThemeChanged},documentTheme:{value:r}})};t.DocumentThemeChangedEventArgs=o}(t.Theming||(t.Theming={}))}(e.DDA||(e.DDA={}))}(OSF||(OSF={})),function(e){!function(t){var n=[];t.initialize=function(){n.forEach((function(t){t.defineMethodsFunc(),e.OUtil.getHostPlatform()==e.HostInfoPlatform.web?"function"==typeof t.defineWebParameterMapFunc&&t.defineWebParameterMapFunc():"function"==typeof t.defineSafeArrayParameterMapFunc&&t.defineSafeArrayParameterMapFunc(),"function"==typeof t.initializeFunc&&t.initializeFunc()}))},t.register=function(e){n.push(e)}}(e.V10ApiFeatureRegistry||(e.V10ApiFeatureRegistry={}))}(OSF||(OSF={})),function(e){!function(t){function n(t,n){var r=(new Date).getTime();return function(i,o){var a;if(n.onReceiving&&n.onReceiving(),0!=i)switch(i){case-5:a=7e3;break;default:a=5001}else a=o?o.Error?o.Error:0:5001;n.onComplete&&n.onComplete(a),e.AppTelemetry&&e.AppTelemetry.onRegisterDone(t,n.dispId,Math.abs((new Date).getTime()-r),a)}}t.version=1,function(e){e.Data="Data",e.Properties="Properties",e.BindingRequest="DdaBindingsMethod",e.BindingResponse="Bindings",e.SingleBindingResponse="singleBindingResponse",e.GetData="DdaGetBindingData",e.AddRowsColumns="DdaAddRowsColumns",e.SetData="DdaSetBindingData",e.ClearFormats="DdaClearBindingFormats",e.SetFormats="DdaSetBindingFormats",e.SettingsRequest="DdaSettingsMethod",e.BindingEventSource="ddaBinding",e.ArrayData="ArrayData"}(t.UniqueArguments||(t.UniqueArguments={})),t.executeAsync=function(t){t.hostCallArgs||(t.hostCallArgs={}),t.hostCallArgs.DdaMethod={ControlId:e._OfficeAppFactory.getId(),Version:e.WACDelegate.version,DispatchId:t.dispId},t.hostCallArgs.__timeout__=-1,t.onCalling&&t.onCalling(),e.getClientEndPoint()&&e.getClientEndPoint().invoke("executeMethod",(function(n,r){var i;if(t.onReceiving&&t.onReceiving(),0==n)e.WACDelegate.version=r.Version,i=r.Error;else switch(n){case-5:i=7e3;break;default:i=5001}t.onComplete&&t.onComplete(i,r)}),t.hostCallArgs)},t.getOnAfterRegisterEvent=n,t.registerEventAsync=function(t){t.onCalling&&t.onCalling(),e.getClientEndPoint()&&e.getClientEndPoint().registerForEvent(e.OUtil.getXdmEventName(t.targetId,t.eventType),(function(n){t.onEvent&&t.onEvent(n),e.AppTelemetry&&e.AppTelemetry.onEventDone(t.dispId)}),n(!0,t),{controlId:e._OfficeAppFactory.getId(),eventDispId:t.dispId,targetId:t.targetId})},t.unregisterEventAsync=function(t){t.onCalling&&t.onCalling(),e.getClientEndPoint()&&e.getClientEndPoint().unregisterForEvent(e.OUtil.getXdmEventName(t.targetId,t.eventType),n(!1,t),{controlId:e._OfficeAppFactory.getId(),eventDispId:t.dispId,targetId:t.targetId})}}(e.WACDelegate||(e.WACDelegate={}))}(OSF||(OSF={})),function(e){var t=function(t){function n(){var n=[e.WACDelegate.UniqueArguments.SingleBindingResponse,e.WACDelegate.UniqueArguments.BindingRequest,e.WACDelegate.UniqueArguments.BindingResponse,e.WACDelegate.UniqueArguments.GetData,e.WACDelegate.UniqueArguments.AddRowsColumns,e.WACDelegate.UniqueArguments.SetData,e.WACDelegate.UniqueArguments.ClearFormats,e.WACDelegate.UniqueArguments.SetFormats,e.WACDelegate.UniqueArguments.SettingsRequest,e.WACDelegate.UniqueArguments.BindingEventSource];return t.call(this,n,{})||this}return __extends(n,t),n}(e.SpecialProcessor);e.WebSpecialProcessor=t}(OSF||(OSF={}));__extends=this&&this.__extends||function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();!function(e){!function(e){!function(e){!function(e){e._eventDispatches=[],e.addFromSelectionAsync=function(e,t,n){OSF.DispIdHost.InvokeMethod(OSF.AsyncMethods.AddFromSelectionAsync,arguments,this,void 0)},e.addFromNamedItemAsync=function(e,t,n,r){OSF.DispIdHost.InvokeMethod(OSF.AsyncMethods.AddFromNamedItemAsync,arguments,this,void 0)},e.addFromPromptAsync=function(e,t,n){OSF.DispIdHost.InvokeMethod(OSF.AsyncMethods.AddFromPromptAsync,arguments,this,void 0)},e.getAllAsync=function(e,t){OSF.DispIdHost.InvokeMethod(OSF.AsyncMethods.GetAllAsync,arguments,this,void 0)},e.getByIdAsync=function(e,t,n){OSF.DispIdHost.InvokeMethod(OSF.AsyncMethods.GetByIdAsync,arguments,this,void 0)},e.releaseByIdAsync=function(e,t,n){OSF.DispIdHost.InvokeMethod(OSF.AsyncMethods.ReleaseByIdAsync,arguments,this,void 0)}}(e.bindings||(e.bindings={}))}(e.document||(e.document={}))}(e.context||(e.context={}))}(Office||(Office={})),function(e){!function(e){e.Id="BindingId",e.Type="bindingType",e.RowCount="RowCount",e.ColumnCount="BindingColumnCount",e.HasHeaders="HasHeaders"}(e.BindingProperties||(e.BindingProperties={})),function(e){e.BindingList="BindingList"}(e.ListDescriptors||(e.ListDescriptors={})),e.ListType.setListType(e.ListDescriptors.BindingList,e.PropertyDescriptors.BindingProperties),function(e){e.BindingSelectionChangedEvent="BindingSelectionChangedEvent"}(e.EventDescriptors||(e.EventDescriptors={})),function(e){!function(e){e.Id="BindingId",e.BindingType="BindingType",e.ItemName="ItemName",e.StartRow="StartRow",e.StartCol="StartCol",e.RowCount="RowCount",e.ColCount="ColCount"}(e.BindingParameterKeys||(e.BindingParameterKeys={})),function(e){e.TableHeaders="TableHeaders",e.TableRows="TableRows"}(e.TableBindingParameterKeys||(e.TableBindingParameterKeys={})),function(e){e.BindingId="Name",e.BindingType="BindingType",e[e.BindingProperties=0]="BindingProperties",e.BindingEventSource="ddaBinding",e.RowCount="RowCount",e.ColumnCount="ColCount",e.HasHeaders="HasHeaders"}(e.AppBindingKeys||(e.AppBindingKeys={})),function(e){e.TableSubset="subset",e.StartRow="startRow",e.StartColumn="startColumn",e.RowCount="rowCount",e.ColumnCount="columnCount"}(e.TableSubsetKeys||(e.TableSubsetKeys={})),function(e){e[e.Table=1]="Table",e[e.Text=2]="Text",e[e.Matrix=3]="Matrix"}(e.BindingType||(e.BindingType={}))}(e.Marshaling||(e.Marshaling={})),function(t){function n(t){return e.manufactureBinding(t,Office.context.document)}function r(e){return e.id}function i(t,n,r){var i=t[e.ParameterNames.Data];return e.TableDataProperties&&i&&(null!=i[e.TableDataProperties.TableRows]||null!=i[e.TableDataProperties.TableHeaders])&&(i=Office.manufactureTableData(i)),null==(i=e.DataCoercion.coerceData(i,r[e.ParameterNames.CoercionType]))?null:i}e.V10ApiFeatureRegistry.register({defineMethodsFunc:function(){e.AsyncMethodCalls.define({method:e.AsyncMethods.AddFromPromptAsync,requiredArguments:[{name:e.ParameterNames.BindingType,enum:Office.BindingType}],supportedOptions:[{name:e.ParameterNames.Id,value:{types:["string"],calculate:c}},{name:e.ParameterNames.PromptText,value:{types:["string"],calculate:function(){return""}}},{name:e.ParameterNames.SampleData,value:{types:["object"],defaultValue:null}}],privateStateCallbacks:[],onSucceeded:function(t){return e.manufactureBinding(t,Office.context.document)}}),e.AsyncMethodCalls.define({method:e.AsyncMethods.AddFromSelectionAsync,requiredArguments:[{name:e.ParameterNames.BindingType,enum:Office.BindingType}],supportedOptions:[{name:e.ParameterNames.Id,value:{types:["string"],calculate:c}},{name:e.ParameterNames.Columns,value:{types:["object"],defaultValue:null}}],privateStateCallbacks:[],onSucceeded:n}),e.AsyncMethodCalls.define({method:e.AsyncMethods.AddFromNamedItemAsync,requiredArguments:[{name:e.ParameterNames.ItemName,types:["string"]},{name:e.ParameterNames.BindingType,enum:Office.BindingType}],supportedOptions:[{name:e.ParameterNames.Id,value:{types:["string"],calculate:c}},{name:e.ParameterNames.Columns,value:{types:["object"],defaultValue:null}}],privateStateCallbacks:[{name:e.ParameterNames.FailOnCollision,value:function(){return!0}}],onSucceeded:n}),e.AsyncMethodCalls.define({method:e.AsyncMethods.GetAllAsync,requiredArguments:[],supportedOptions:[],privateStateCallbacks:[],onSucceeded:function(t){return t[e.ListDescriptors.BindingList].map(n)}}),e.AsyncMethodCalls.define({method:e.AsyncMethods.GetByIdAsync,requiredArguments:[{name:e.ParameterNames.Id,types:["string"]}],supportedOptions:[],privateStateCallbacks:[],onSucceeded:n}),e.AsyncMethodCalls.define({method:e.AsyncMethods.ReleaseByIdAsync,requiredArguments:[{name:e.ParameterNames.Id,types:["string"]}],supportedOptions:[],privateStateCallbacks:[],onSucceeded:function(t,n,r){var i=r[e.ParameterNames.Id];delete n._eventDispatches[i]}}),e.AsyncMethodCalls.define({method:e.AsyncMethods.GetDataAsync,requiredArguments:[],supportedOptions:[{name:e.ParameterNames.CoercionType,value:{enum:Office.CoercionType,calculate:function(t,n){return e.DataCoercion.getCoercionDefaultForBinding(n.type)}}},{name:e.ParameterNames.ValueFormat,value:{enum:Office.ValueFormat,defaultValue:Office.ValueFormat.Unformatted}},{name:e.ParameterNames.FilterType,value:{enum:Office.FilterType,defaultValue:Office.FilterType.All}},{name:e.ParameterNames.Rows,value:{types:["object","string"],defaultValue:null}},{name:e.ParameterNames.Columns,value:{types:["object"],defaultValue:null}},{name:e.ParameterNames.StartRow,value:{types:["number"],defaultValue:0}},{name:e.ParameterNames.StartColumn,value:{types:["number"],defaultValue:0}},{name:e.ParameterNames.RowCount,value:{types:["number"],defaultValue:0}},{name:e.ParameterNames.ColumnCount,value:{types:["number"],defaultValue:0}}],checkCallArgs:function(t,n,r){if(0==t[e.ParameterNames.StartRow]&&0==t[e.ParameterNames.StartColumn]&&0==t[e.ParameterNames.RowCount]&&0==t[e.ParameterNames.ColumnCount]&&(delete t[e.ParameterNames.StartRow],delete t[e.ParameterNames.StartColumn],delete t[e.ParameterNames.RowCount],delete t[e.ParameterNames.ColumnCount]),t[e.ParameterNames.CoercionType]!=e.DataCoercion.getCoercionDefaultForBinding(n.type)&&(t[e.ParameterNames.StartRow]||t[e.ParameterNames.StartColumn]||t[e.ParameterNames.RowCount]||t[e.ParameterNames.ColumnCount]))throw 1002;return t},privateStateCallbacks:[{name:e.ParameterNames.Id,value:r}],onSucceeded:i}),e.AsyncMethodCalls.define({method:e.AsyncMethods.SetDataAsync,requiredArguments:[{name:e.ParameterNames.Data,types:["string","object","number","boolean"]}],supportedOptions:[{name:e.ParameterNames.CoercionType,value:{enum:Office.CoercionType,calculate:function(t){return e.DataCoercion.determineCoercionType(t[e.ParameterNames.Data])}}},{name:e.ParameterNames.Rows,value:{types:["object","string"],defaultValue:null}},{name:e.ParameterNames.Columns,value:{types:["object"],defaultValue:null}},{name:e.ParameterNames.StartRow,value:{types:["number"],defaultValue:0}},{name:e.ParameterNames.StartColumn,value:{types:["number"],defaultValue:0}}],checkCallArgs:function(t,n,r){if(0==t[e.ParameterNames.StartRow]&&0==t[e.ParameterNames.StartColumn]&&(delete t[e.ParameterNames.StartRow],delete t[e.ParameterNames.StartColumn]),t[e.ParameterNames.CoercionType]!=e.DataCoercion.getCoercionDefaultForBinding(n.type)&&(t[e.ParameterNames.StartRow]||t[e.ParameterNames.StartColumn]))throw 1002;return t},privateStateCallbacks:[{name:e.ParameterNames.Id,value:r}]})},defineSafeArrayParameterMapFunc:function(){e.HostParameterMap.define({type:"bindingSpecificData",fromHost:[{name:e.BindingProperties.RowCount,value:0},{name:e.BindingProperties.ColumnCount,value:1},{name:e.BindingProperties.HasHeaders,value:2}],isComplexType:!0}),e.HostParameterMap.define({type:e.PropertyDescriptors.Subset,toHost:[{name:"offset",value:0},{name:"run",value:1}],canonical:!0,isComplexType:!0}),e.HostParameterMap.define({type:"offset",toHost:[{name:e.ParameterNames.StartRow,value:0},{name:e.ParameterNames.StartColumn,value:1}],canonical:!0,isComplexType:!0}),e.HostParameterMap.define({type:"run",toHost:[{name:e.ParameterNames.RowCount,value:0},{name:e.ParameterNames.ColumnCount,value:1}],canonical:!0,isComplexType:!0}),e.HostParameterMap.define({type:"run",toHost:[{name:e.ParameterNames.RowCount,value:0},{name:e.ParameterNames.ColumnCount,value:1}],canonical:!0,isComplexType:!0}),e.HostParameterMap.define({type:79,toHost:[{name:e.ParameterNames.Id,value:0},{name:e.ParameterNames.Data,value:1}]}),e.HostParameterMap.define({type:73,toHost:[{name:e.ParameterNames.Id,value:0}]}),e.HostParameterMap.define({type:e.PropertyDescriptors.BindingProperties,fromHost:[{name:e.BindingProperties.Id,value:0},{name:e.BindingProperties.Type,value:1},{name:"bindingSpecificData",value:2}],isComplexType:!0}),e.HostParameterMap.define({type:e.ParameterNames.BindingType,toHost:[{name:Office.BindingType.Text,value:0},{name:Office.BindingType.Matrix,value:1},{name:Office.BindingType.Table,value:2}],invertible:!0}),e.HostParameterMap.define({type:66,fromHost:[{name:e.PropertyDescriptors.BindingProperties,value:e.HostParameterMap.self}],toHost:[{name:e.ParameterNames.Id,value:0},{name:e.ParameterNames.BindingType,value:1}]}),e.HostParameterMap.define({type:78,fromHost:[{name:e.PropertyDescriptors.BindingProperties,value:e.HostParameterMap.self}],toHost:[{name:e.ParameterNames.ItemName,value:0},{name:e.ParameterNames.Id,value:1},{name:e.ParameterNames.BindingType,value:2},{name:e.ParameterNames.FailOnCollision,value:3}]}),e.HostParameterMap.define({type:67,fromHost:[{name:e.PropertyDescriptors.BindingProperties,value:e.HostParameterMap.self}],toHost:[{name:e.ParameterNames.Id,value:0},{name:e.ParameterNames.BindingType,value:1},{name:e.ParameterNames.PromptText,value:2}]}),e.HostParameterMap.define({type:69,toHost:[{name:e.ParameterNames.Id,value:0}]}),e.HostParameterMap.define({type:68,fromHost:[{name:e.PropertyDescriptors.BindingProperties,value:e.HostParameterMap.self}],toHost:[{name:e.ParameterNames.Id,value:0}]}),e.HostParameterMap.define({type:74,fromHost:[{name:e.ListDescriptors.BindingList,value:e.HostParameterMap.self}]}),e.HostParameterMap.define({type:70,fromHost:[{name:e.ParameterNames.Data,value:e.HostParameterMap.self}],toHost:[{name:e.ParameterNames.Id,value:0},{name:e.ParameterNames.CoercionType,value:1},{name:e.ParameterNames.ValueFormat,value:2},{name:e.ParameterNames.FilterType,value:3},{name:e.PropertyDescriptors.Subset,value:4}]}),e.HostParameterMap.define({type:71,toHost:[{name:e.ParameterNames.Id,value:0},{name:e.ParameterNames.CoercionType,value:1},{name:e.ParameterNames.Data,value:2},{name:"offset",value:3}]})},defineWebParameterMapFunc:function(){e.HostParameterMap.define({type:72,toHost:[{name:e.WACDelegate.UniqueArguments.AddRowsColumns,value:e.HostParameterMap.self}]}),e.HostParameterMap.define({type:79,toHost:[{name:e.WACDelegate.UniqueArguments.AddRowsColumns,value:e.HostParameterMap.self}]}),e.HostParameterMap.define({type:73,toHost:[{name:e.WACDelegate.UniqueArguments.BindingRequest,value:e.HostParameterMap.self}]}),e.HostParameterMap.define({type:e.WACDelegate.UniqueArguments.AddRowsColumns,toHost:[{name:e.ParameterNames.Id,value:"BindingId"},{name:e.ParameterNames.Data,value:e.WACDelegate.UniqueArguments.Data}]}),e.HostParameterMap.define({type:e.PropertyDescriptors.Subset,fromHost:[{name:e.ParameterNames.StartRow,value:"StartRow"},{name:e.ParameterNames.StartColumn,value:"StartCol"},{name:e.ParameterNames.RowCount,value:"RowCount"},{name:e.ParameterNames.ColumnCount,value:"ColCount"}]}),e.HostParameterMap.define({type:e.WACDelegate.UniqueArguments.BindingRequest,toHost:[{name:e.ParameterNames.ItemName,value:"ItemName"},{name:e.ParameterNames.Id,value:"BindingId"},{name:e.ParameterNames.BindingType,value:"BindingType"},{name:e.ParameterNames.PromptText,value:"PromptText"},{name:e.ParameterNames.Columns,value:"Columns"},{name:e.ParameterNames.SampleData,value:"SampleData"},{name:e.ParameterNames.FailOnCollision,value:"FailOnCollision"}]}),e.HostParameterMap.addComplexType(e.PropertyDescriptors.BindingProperties),e.HostParameterMap.define({type:e.ParameterNames.BindingType,toHost:[{name:Office.BindingType.Text,value:2},{name:Office.BindingType.Matrix,value:3},{name:Office.BindingType.Table,value:1}],invertible:!0}),e.HostParameterMap.define({type:e.PropertyDescriptors.BindingProperties,fromHost:[{name:e.BindingProperties.Id,value:"Name"},{name:e.BindingProperties.Type,value:"BindingType"},{name:e.BindingProperties.RowCount,value:"RowCount"},{name:e.BindingProperties.ColumnCount,value:"ColCount"},{name:e.BindingProperties.HasHeaders,value:"HasHeaders"}]}),e.HostParameterMap.define({type:e.WACDelegate.UniqueArguments.SingleBindingResponse,fromHost:[{name:e.PropertyDescriptors.BindingProperties,value:0}]}),e.HostParameterMap.define({type:66,fromHost:[{name:e.WACDelegate.UniqueArguments.SingleBindingResponse,value:e.WACDelegate.UniqueArguments.BindingResponse}],toHost:[{name:e.WACDelegate.UniqueArguments.BindingRequest,value:e.HostParameterMap.self}]}),e.HostParameterMap.define({type:67,fromHost:[{name:e.WACDelegate.UniqueArguments.SingleBindingResponse,value:e.WACDelegate.UniqueArguments.BindingResponse}],toHost:[{name:e.WACDelegate.UniqueArguments.BindingRequest,value:e.HostParameterMap.self}]}),e.HostParameterMap.define({type:78,fromHost:[{name:e.WACDelegate.UniqueArguments.SingleBindingResponse,value:e.WACDelegate.UniqueArguments.BindingResponse}],toHost:[{name:e.WACDelegate.UniqueArguments.BindingRequest,value:e.HostParameterMap.self}]}),e.HostParameterMap.define({type:69,toHost:[{name:e.WACDelegate.UniqueArguments.BindingRequest,value:e.HostParameterMap.self}]}),e.HostParameterMap.define({type:68,fromHost:[{name:e.WACDelegate.UniqueArguments.SingleBindingResponse,value:e.WACDelegate.UniqueArguments.BindingResponse}],toHost:[{name:e.WACDelegate.UniqueArguments.BindingRequest,value:e.HostParameterMap.self}]}),e.HostParameterMap.define({type:74,fromHost:[{name:e.ListDescriptors.BindingList,value:e.WACDelegate.UniqueArguments.BindingResponse}]}),e.HostParameterMap.define({type:70,fromHost:[{name:e.ParameterNames.Data,value:e.WACDelegate.UniqueArguments.Data}],toHost:[{name:e.WACDelegate.UniqueArguments.GetData,value:e.HostParameterMap.self}]}),e.HostParameterMap.define({type:71,toHost:[{name:e.WACDelegate.UniqueArguments.SetData,value:e.HostParameterMap.self}]})},initializeFunc:function(){e.manufactureBinding=function(t,n){var r,i=t[e.BindingProperties.Id],o=t[e.BindingProperties.RowCount],a=t[e.BindingProperties.ColumnCount],s=t[e.BindingProperties.HasHeaders];switch(t[e.BindingProperties.Type]){case Office.BindingType.Text:r=new e.TextBinding(i,n);break;case Office.BindingType.Matrix:r=null,r=new e.MatrixBinding(i,n,o,a);break;case Office.BindingType.Table:r=new(e._OfficeAppFactory.getHostInfo().hostType==e.HostInfoHostType.excel&&Office.context.document&&e.ExcelTableBinding?e.ExcelTableBinding:e.TableBinding)(i,n,o,a,s);break;default:r=new e.UnknownBinding(i,n)}return r}}})}(e.Bindings||(e.Bindings={})),e.BindingEvents||(e.BindingEvents={}),e.V10ApiFeatureRegistry.register({defineMethodsFunc:function(){},defineSafeArrayParameterMapFunc:function(){e.HostParameterMap.define({type:e.EventDispId.dispidBindingSelectionChangedEvent,fromHost:[{name:e.EventDescriptors.BindingSelectionChangedEvent,value:e.HostParameterMap.self}],isComplexType:!0}),e.HostParameterMap.define({type:e.EventDispId.dispidBindingDataChangedEvent,fromHost:[{name:e.PropertyDescriptors.BindingProperties,value:e.HostParameterMap.self}]})},defineWebParameterMapFunc:function(){e.HostParameterMap.define({type:e.EventDescriptors.BindingSelectionChangedEvent,fromHost:[{name:e.PropertyDescriptors.BindingProperties,value:e.WACDelegate.UniqueArguments.BindingEventSource},{name:e.PropertyDescriptors.Subset,value:e.PropertyDescriptors.Subset}]}),e.HostParameterMap.define({type:e.EventDispId.dispidBindingSelectionChangedEvent,fromHost:[{name:e.EventDescriptors.BindingSelectionChangedEvent,value:e.HostParameterMap.self}]}),e.HostParameterMap.define({type:e.EventDispId.dispidBindingDataChangedEvent,fromHost:[{name:e.PropertyDescriptors.BindingProperties,value:e.WACDelegate.UniqueArguments.BindingEventSource}]})}});var t=function(){function t(e){this.m_id=e}return Object.defineProperty(t.prototype,"onFail",{get:function(){return this.m_errorCallback},set:function(t){var n=typeof t;if("undefined"!=n&&"function"!=n)throw e.ErrorNames.CallbackNotFunction;this.m_errorCallback=t},enumerable:!0,configurable:!0}),t.prototype._fetch=function(t){if(this.m_binding)t&&t(this.m_binding);else if(!this.m_binding){var n=this;Office.context.document.bindings.getByIdAsync(this.m_id,(function(r){r.status==Office.AsyncResultStatus.Succeeded?(e.OUtil.defineEnumerableProperty(n,"binding",{value:r.value}),t&&t(n.m_binding)):n.onFail&&n.onFail(r)}))}return this},t.prototype.getDataAsync=function(){var e=arguments;return this._fetch((function(t){t.getDataAsync.apply(t,e)})),this},t.prototype.setDataAsync=function(){var e=arguments;return this._fetch((function(t){t.setDataAsync.apply(t,e)})),this},t.prototype.addHandlerAsync=function(){var e=arguments;return this._fetch((function(t){t.addHandlerAsync.apply(t,e)})),this},t.prototype.removeHandlerAsync=function(){var e=arguments;return this._fetch((function(t){t.removeHandlerAsync.apply(t,e)})),this},t.prototype.setTableOptionsAsync=function(){var e=arguments;return this._fetch((function(t){t.setTableOptionsAsync.apply(t,e)})),this},t.prototype.setFormatsAsync=function(){var e=arguments;return this._fetch((function(t){t.setFormatsAsync.apply(t,e)})),this},t.prototype.clearFormatsAsync=function(){var e=arguments;return this._fetch((function(t){t.clearFormatsAsync.apply(t,e)})),this},t}();e.BindingPromise=t;var n=function(){function e(e,t){this.m_id=e,this.m_docInstance=t}return Object.defineProperty(e.prototype,"document",{get:function(){return this.m_docInstance},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"id",{get:function(){return this.m_id},enumerable:!0,configurable:!0}),e}();e.UnknownBinding=n;var r=function(){function t(t,n){this.m_id=t,this.m_docInstance=n;var r=e.EventType,i=n.bindings._eventDispatches;i[t]||(i[t]=new e.EventDispatch([r.BindingSelectionChanged,r.BindingDataChanged]));var o=i[t];e.DispIdHost.addEventSupport(this,o)}return t.prototype.getDataAsync=function(t,n){e.DispIdHost.InvokeMethod(e.AsyncMethods.GetDataAsync,arguments,this,void 0)},t.prototype.setDataAsync=function(t,n,r){e.DispIdHost.InvokeMethod(e.AsyncMethods.SetDataAsync,arguments,this,void 0)},Object.defineProperty(t.prototype,"document",{get:function(){return this.m_docInstance},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"id",{get:function(){return this.m_id},enumerable:!0,configurable:!0}),t}();e.Binding=r;var i=function(e){function t(t,n,r,i){var o=e.call(this,t,n)||this;return o.m_rows=r,o.m_cols=i,o}return __extends(t,e),Object.defineProperty(t.prototype,"type",{get:function(){return Office.BindingType.Matrix},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"rowCount",{get:function(){return this.m_rows?this.m_rows:0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"columnCount",{get:function(){return this.m_cols?this.m_cols:0},enumerable:!0,configurable:!0}),t}(e.Binding);e.MatrixBinding=i;var o=function(t){function n(e,n,r,i,o){var a=t.call(this,e,n)||this;return a.m_rows=r,a.m_cols=i,a.m_hasHeaders=o,a}return __extends(n,t),Object.defineProperty(n.prototype,"type",{get:function(){return Office.BindingType.Table},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"rowCount",{get:function(){return this.m_rows?this.m_rows:0},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"columnCount",{get:function(){return this.m_cols?this.m_cols:0},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"hasHeaders",{get:function(){return!!this.m_hasHeaders&&this.m_hasHeaders},enumerable:!0,configurable:!0}),n.prototype.addRowsAsync=function(t,n,r){e.DispIdHost.InvokeMethod(e.AsyncMethods.AddRowsAsync,arguments,this,void 0)},n.prototype.addColumnsAsync=function(t,n,r){e.DispIdHost.InvokeMethod(e.AsyncMethods.AddColumnsAsync,arguments,this,void 0)},n.prototype.deleteAllDataValuesAsync=function(t,n){e.DispIdHost.InvokeMethod(e.AsyncMethods.DeleteAllDataValuesAsync,arguments,this,void 0)},n}(e.Binding);e.TableBinding=o;var a=function(t){function n(n,r,i,o,a){var s=t.call(this,n,r,i,o,a)||this;return e.OUtil.finalizeProperties(s),s}return __extends(n,t),n.prototype.clearFormatsAsync=function(t,n){e.DispIdHost.InvokeMethod(e.AsyncMethods.ClearFormatsAsync,arguments,this,void 0)},n.prototype.setTableOptionsAsync=function(t,n,r){e.DispIdHost.InvokeMethod(e.AsyncMethods.SetTableOptionsAsync,arguments,this,void 0)},n.prototype.setFormatsAsync=function(t,n,r){e.DispIdHost.InvokeMethod(e.AsyncMethods.SetFormatsAsync,arguments,this,void 0)},n}(e.TableBinding);e.ExcelTableBinding=a,function(t){function n(e){return e.id}e.V10ApiFeatureRegistry.register({defineMethodsFunc:function(){e.AsyncMethodCalls.define({method:e.AsyncMethods.AddRowsAsync,requiredArguments:[{name:e.ParameterNames.Data,types:["object"]}],supportedOptions:[],privateStateCallbacks:[{name:e.ParameterNames.Id,value:n}]}),e.AsyncMethodCalls.define({method:e.AsyncMethods.AddColumnsAsync,requiredArguments:[{name:e.ParameterNames.Data,types:["object"]}],supportedOptions:[],privateStateCallbacks:[{name:e.ParameterNames.Id,value:n}]}),e.AsyncMethodCalls.define({method:e.AsyncMethods.DeleteAllDataValuesAsync,requiredArguments:[],supportedOptions:[],privateStateCallbacks:[{name:e.ParameterNames.Id,value:n}]})}})}(e.TableBindingMethods||(e.TableBindingMethods={}));var s=function(e){function t(t,n){return e.call(this,t,n)||this}return __extends(t,e),Object.defineProperty(t.prototype,"type",{get:function(){return Office.BindingType.Text},enumerable:!0,configurable:!0}),t}(e.Binding);function c(){return"UnnamedBinding_"+e.OUtil.getUniqueId()+"_"+(new Date).getTime()}e.TextBinding=s,e.V10ApiFeatureRegistry.register({defineMethodsFunc:function(){e.AsyncMethodCalls.define({method:e.AsyncMethods.BindingSelectionChanged,requiredArguments:[],supportedOptions:[],privateStateCallbacks:[]}),e.AsyncMethodCalls.define({method:e.AsyncMethods.BindingDataChanged,requiredArguments:[],supportedOptions:[],privateStateCallbacks:[]})},defineSafeArrayParameterMapFunc:function(){e.HostParameterMap.define({type:e.EventDescriptors.BindingSelectionChangedEvent,fromHost:[{name:e.PropertyDescriptors.BindingProperties,value:0},{name:e.PropertyDescriptors.Subset,value:1}],isComplexType:!0}),e.HostParameterMap.define({type:e.EventDispId.dispidBindingSelectionChangedEvent,fromHost:[{name:e.EventDescriptors.BindingSelectionChangedEvent,value:e.HostParameterMap.self}],isComplexType:!0}),e.HostParameterMap.define({type:e.EventDispId.dispidBindingDataChangedEvent,fromHost:[{name:e.PropertyDescriptors.BindingProperties,value:e.HostParameterMap.self}]})},defineWebParameterMapFunc:function(){e.HostParameterMap.define({type:e.EventDescriptors.BindingSelectionChangedEvent,fromHost:[{name:e.PropertyDescriptors.BindingProperties,value:e.WACDelegate.UniqueArguments.BindingEventSource},{name:e.PropertyDescriptors.Subset,value:e.PropertyDescriptors.Subset}]}),e.HostParameterMap.define({type:e.EventDispId.dispidBindingSelectionChangedEvent,fromHost:[{name:e.EventDescriptors.BindingSelectionChangedEvent,value:e.HostParameterMap.self}]}),e.HostParameterMap.define({type:e.EventDispId.dispidBindingDataChangedEvent,fromHost:[{name:e.PropertyDescriptors.BindingProperties,value:e.WACDelegate.UniqueArguments.BindingEventSource}]})}})}(OSF||(OSF={})),function(e){!function(e){!function(e){!function(e){e._eventDispatches=[],e.addAsync=function(e,t,n){"function"==typeof t&&(n=t);var r={toSafeArrayHost:function(){return[e]},fromSafeArrayHost:function(e){var t={id:e[0],DataPartBuiltIn:e[1]};return OSF.processDataPart(t)},toWebHost:function(){return{xml:e}},fromWebHost:function(e){var t={id:e.DataPartProperties.id,DataPartBuiltIn:e.DataPartProperties.DataPartBuiltIn};return OSF.processDataPart(t)}};OSF._OfficeAppFactory.getAsyncMethodExecutor().executeAsync(128,r,n,null!=t?t.asyncContext:void 0)},e.getByIdAsync=function(e,t,n){"function"==typeof t&&(n=t);var r={toSafeArrayHost:function(){return[e]},fromSafeArrayHost:function(e){var t={id:e[0],DataPartBuiltIn:e[1]};return OSF.processDataPart(t)},toWebHost:function(){return{id:e}},fromWebHost:function(e){var t={id:e.DataPartProperties.id,DataPartBuiltIn:e.DataPartProperties.DataPartBuiltIn};return OSF.processDataPart(t)}};OSF._OfficeAppFactory.getAsyncMethodExecutor().executeAsync(129,r,n,null!=t?t.asyncContext:void 0)},e.getByNamespaceAsync=function(e,t,n){"function"==typeof t&&(n=t);var r={toSafeArrayHost:function(){return[e]},fromSafeArrayHost:function(e){var t=[];if(e)for(var n=0;n<e.length;n++){var r={id:e[n][0],DataPartBuiltIn:e[n][1]},i=OSF.processDataPart(r);t.push(i)}return t},toWebHost:function(){return{namespace:e}},fromWebHost:function(e){for(var t=[],n=0;n<e.DataPartList.length;n++){var r={id:e.DataPartList[n].id,DataPartBuiltIn:e.DataPartList[n].DataPartBuiltIn},i=OSF.processDataPart(r);t.push(i)}return t}};OSF._OfficeAppFactory.getAsyncMethodExecutor().executeAsync(130,r,n,null!=t?t.asyncContext:void 0)}}(e.customXmlParts||(e.customXmlParts={}))}(e.document||(e.document={}))}(e.context||(e.context={}))}(Office||(Office={})),function(e){!function(e){e.Id="id",e.BuiltIn="DataPartBuiltIn"}(e.DataPartProperties||(e.DataPartProperties={})),function(e){e.Handle="DataNodeHandle",e.BaseName="DataNodeBaseName",e.NamespaceUri="DataNodeNamespaceUri",e.NodeType="DataNodeType"}(e.DataNodeProperties||(e.DataNodeProperties={})),function(e){e.DataPartList="DataPartList",e.DataNodeList="DataNodeList"}(e.ListDescriptors||(e.ListDescriptors={})),e.ListType.setListType(e.ListDescriptors.DataPartList,e.PropertyDescriptors.DataPartProperties),e.ListType.setListType(e.ListDescriptors.DataNodeList,e.PropertyDescriptors.DataPartProperties);var t=function(){function t(t,n,r){this.m_customXmlParts=t,this.m_id=n,this.m_builtIn=r;var i=t._eventDispatches,o=i[n];if(!o){var a=e.EventType;o=new e.EventDispatch([a.DataNodeDeleted,a.DataNodeInserted,a.DataNodeReplaced]),i[n]=o}e.DispIdHost.addEventSupport(this,o)}return Object.defineProperty(t.prototype,"builtIn",{get:function(){return this.m_builtIn},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"id",{get:function(){return this.m_id},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"namespaceManager",{get:function(){return new n(this.m_id)},enumerable:!0,configurable:!0}),t.prototype.deleteAsync=function(t,n){var r=this;"function"==typeof t&&(n=t);var i={toSafeArrayHost:function(){return[null==r.m_id?void 0:r.m_id]},fromSafeArrayHost:function(e){},toWebHost:function(){return{id:null==r.m_id?void 0:r.m_id}},fromWebHost:function(e){return{}}};e._OfficeAppFactory.getAsyncMethodExecutor().executeAsync(133,i,n,null!=t?t.asyncContext:void 0)},t.prototype.getNodesAsync=function(t,n,r){var i=this;"function"==typeof n&&(r=n);var o={toSafeArrayHost:function(){return[null==i.m_id?void 0:i.m_id,t]},fromSafeArrayHost:function(t){for(var n=[],r=0;r<t.length;r++){var i={DataNodeHandle:t[r][0],DataNodeBaseName:t[r][1],DataNodeNamespaceUri:t[r][2],DataNodeType:t[r][3]},o=e.processDataNode(i);n.push(o)}return n},toWebHost:function(){return{id:null==i.m_id?void 0:i.m_id,xpath:t}},fromWebHost:function(t){for(var n=[],r=0;r<t.DataNodeList.length;r++){var i={DataNodeHandle:t.DataNodeList[r].DataNodeHandle,DataNodeBaseName:t.DataNodeList[r].DataNodeBaseName,DataNodeNamespaceUri:t.DataNodeList[r].DataNodeNamespaceUri,DataNodeType:t.DataNodeList[r].DataNodeType},o=e.processDataNode(i);n.push(o)}return n}};e._OfficeAppFactory.getAsyncMethodExecutor().executeAsync(132,o,r,null!=n?n.asyncContext:void 0)},t.prototype.getXmlAsync=function(t,n){var r=this;"function"==typeof t&&(n=t);var i={toSafeArrayHost:function(){return[null==r.m_id?void 0:r.m_id]},fromSafeArrayHost:function(e){return e},toWebHost:function(){return{id:null==r.m_id?void 0:r.m_id}},fromWebHost:function(e){return{data:e.Data}}};e._OfficeAppFactory.getAsyncMethodExecutor().executeAsync(131,i,n,null!=t?t.asyncContext:void 0)},t}();e.CustomXmlPart=t;var n=function(){function t(e){this.m_partId=e}return t.prototype.addNamespaceAsync=function(t,n,r,i){var o=this;"function"==typeof r&&(i=r);var a={toSafeArrayHost:function(){return[null==o.m_partId?void 0:o.m_partId,t,n]},fromSafeArrayHost:function(e){},toWebHost:function(){return{id:null==o.m_partId?void 0:o.m_partId,prefix:t,namespace:n}},fromWebHost:function(e){return{}}};e._OfficeAppFactory.getAsyncMethodExecutor().executeAsync(139,a,i,null!=r?r.asyncContext:void 0)},t.prototype.getNamespaceAsync=function(t,n,r){var i=this;"function"==typeof n&&(r=n);var o={toSafeArrayHost:function(){return[null==i.m_partId?void 0:i.m_partId,t]},fromSafeArrayHost:function(e){return e},toWebHost:function(){return{id:null==i.m_partId?void 0:i.m_partId,prefix:t}},fromWebHost:function(e){return{data:e.Data}}};e._OfficeAppFactory.getAsyncMethodExecutor().executeAsync(140,o,r,null!=n?n.asyncContext:void 0)},t.prototype.getPrefixAsync=function(t,n,r){var i=this;"function"==typeof n&&(r=n);var o={toSafeArrayHost:function(){return[null==i.m_partId?void 0:i.m_partId,t]},fromSafeArrayHost:function(e){return e},toWebHost:function(){return{id:null==i.m_partId?void 0:i.m_partId,namespace:t}},fromWebHost:function(e){return{data:e.Data}}};e._OfficeAppFactory.getAsyncMethodExecutor().executeAsync(141,o,r,null!=n?n.asyncContext:void 0)},t}();e.CustomXmlPrefixMappings=n;var r=function(){function t(e,t,n,r){this.m_handle=e,this.m_nodeType=t,this.m_ns=n,this.m_baseName=r}return Object.defineProperty(t.prototype,"baseName",{get:function(){return this.m_baseName},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"namespaceUri",{get:function(){return this.m_ns},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"nodeType",{get:function(){return this.m_nodeType},enumerable:!0,configurable:!0}),t.prototype.getNodesAsync=function(t,n,r){var o=this;"function"==typeof n&&(r=n);var a={toSafeArrayHost:function(){return[i(o,o.m_handle),t]},fromSafeArrayHost:function(t){for(var n=[],r=0;r<t.length;r++){var i={DataNodeBaseName:t[r][2],DataNodeNamespaceUri:t[r][3],DataNodeType:t[r][4]},o=e.processDataNode(i);n.push(o)}return n},toWebHost:function(){return{DataNodeHandle:i(o,o.m_handle),xpath:t}},fromWebHost:function(t){for(var n=[],r=0;r<t.DataNodeList.length;r++){var i={DataNodeHandle:t.DataNodeList[r].DataNodeHandle,DataNodeBaseName:t.DataNodeList[r].DataNodeBaseName,DataNodeNamespaceUri:t.DataNodeList[r].DataNodeNamespaceUri,DataNodeType:t.DataNodeList[r].DataNodeType},o=e.processDataNode(i);n.push(o)}return n}};e._OfficeAppFactory.getAsyncMethodExecutor().executeAsync(136,a,r,null!=n?n.asyncContext:void 0)},t.prototype.getNodeValueAsync=function(t,n){var r=this;"function"==typeof t&&(n=t);var o={toSafeArrayHost:function(){return[i(r,r.m_handle)]},fromSafeArrayHost:function(e){return e},toWebHost:function(){return{DataNodeHandle:i(r,r.m_handle)}},fromWebHost:function(e){return{data:e.Data}}};e._OfficeAppFactory.getAsyncMethodExecutor().executeAsync(134,o,n,null!=t?t.asyncContext:void 0)},t.prototype.setNodeValueAsync=function(t,n,r){var o=this;"function"==typeof n&&(r=n);var a={toSafeArrayHost:function(){return[i(o,o.m_handle),t]},fromSafeArrayHost:function(e){},toWebHost:function(){return{DataNodeHandle:i(o,o.m_handle),Data:t}},fromWebHost:function(e){return{}}};e._OfficeAppFactory.getAsyncMethodExecutor().executeAsync(137,a,r,null!=n?n.asyncContext:void 0)},t.prototype.getXmlAsync=function(t,n){var r=this;"function"==typeof t&&(n=t);var o={toSafeArrayHost:function(){return[i(r,r.m_handle)]},fromSafeArrayHost:function(e){return e},toWebHost:function(){return{DataNodeHandle:i(r,r.m_handle)}},fromWebHost:function(e){return{data:e.Data}}};e._OfficeAppFactory.getAsyncMethodExecutor().executeAsync(135,o,n,null!=t?t.asyncContext:void 0)},t.prototype.setXmlAsync=function(t,n,r){var o=this;"function"==typeof n&&(r=n);var a={toSafeArrayHost:function(){return[i(o,o.m_handle),t]},fromSafeArrayHost:function(e){},toWebHost:function(){return{DataNodeHandle:i(o,o.m_handle),xml:t}},fromWebHost:function(e){return{}}};e._OfficeAppFactory.getAsyncMethodExecutor().executeAsync(138,a,r,null!=n?n.asyncContext:void 0)},t.prototype.getTextAsync=function(t,n){var r=this;"function"==typeof t&&(n=t);var o={toSafeArrayHost:function(){return[i(r,r.m_handle)]},fromSafeArrayHost:function(e){return e},toWebHost:function(){return{DataNodeHandle:i(r,r.m_handle)}},fromWebHost:function(e){return{data:e.Data}}};e._OfficeAppFactory.getAsyncMethodExecutor().executeAsync(142,o,n,null!=t?t.asyncContext:void 0)},t.prototype.setTextAsync=function(t,n,r){var o=this;"function"==typeof n&&(r=n);var a={toSafeArrayHost:function(){return[i(o,o.m_handle),t]},fromSafeArrayHost:function(e){},toWebHost:function(){return{DataNodeHandle:i(o,o.m_handle),undefined:t}},fromWebHost:function(e){return{}}};e._OfficeAppFactory.getAsyncMethodExecutor().executeAsync(143,a,r,null!=n?n.asyncContext:void 0)},t}();function i(e,t){return t}e.CustomXmlNode=r,e.manufactureDataNode=function(t){if(t)return new e.CustomXmlNode(t[e.DataNodeProperties.Handle],t[e.DataNodeProperties.NodeType],t[e.DataNodeProperties.NamespaceUri],t[e.DataNodeProperties.BaseName])},e.manufactureDataPart=function(t,n){return new e.CustomXmlPart(n,t[e.DataPartProperties.Id],t[e.DataPartProperties.BuiltIn])},function(e){!function(e){!function(e){e.Id="id",e.Namespace="namespace",e.Xml="xml",e.XPath="xpath",e.Prefix="prefix"}(e.CustomXmlPartsKeys||(e.CustomXmlPartsKeys={})),function(e){e.Id="id",e.BuiltIn="DataPartBuiltIn"}(e.DataPartProperties||(e.DataPartProperties={})),function(e){e.DataPartProperties="DataPartProperties",e.DataNodeProperties="DataNodeProperties"}(e.PropertyDescriptors||(e.PropertyDescriptors={})),function(e){e.Handle="DataNodeHandle",e.BaseName="DataNodeBaseName",e.NamespaceUri="DataNodeNamespaceUri",e.NodeType="DataNodeType"}(e.DataNodeProperties||(e.DataNodeProperties={})),function(e){e.DataPartList="DataPartList",e.DataNodeList="DataNodeList"}(e.ListDescriptors||(e.ListDescriptors={}))}(e.Customxml||(e.Customxml={}))}(e.Marshaling||(e.Marshaling={})),e.CustomXml||(e.CustomXml={}),e.V10ApiFeatureRegistry.register({defineMethodsFunc:function(){},defineSafeArrayParameterMapFunc:function(){e.HostParameterMap.define({type:e.EventDescriptors.DataNodeInsertedEvent,fromHost:[{name:e.DataNodeEventProperties.InUndoRedo,value:0},{name:e.DataNodeEventProperties.NewNode,value:1}],isComplexType:!0}),e.HostParameterMap.define({type:e.EventDescriptors.DataNodeReplacedEvent,fromHost:[{name:e.DataNodeEventProperties.InUndoRedo,value:0},{name:e.DataNodeEventProperties.OldNode,value:1},{name:e.DataNodeEventProperties.NewNode,value:2}],isComplexType:!0}),e.HostParameterMap.define({type:e.EventDescriptors.DataNodeDeletedEvent,fromHost:[{name:e.DataNodeEventProperties.InUndoRedo,value:0},{name:e.DataNodeEventProperties.OldNode,value:1},{name:e.DataNodeEventProperties.NextSiblingNode,value:2}],isComplexType:!0}),e.HostParameterMap.define({type:e.DataNodeEventProperties.OldNode,fromHost:[{name:e.PropertyDescriptors.DataNodeProperties,value:e.HostParameterMap.self}],isComplexType:!0}),e.HostParameterMap.define({type:e.DataNodeEventProperties.NewNode,fromHost:[{name:e.PropertyDescriptors.DataNodeProperties,value:e.HostParameterMap.self}],isComplexType:!0}),e.HostParameterMap.define({type:e.DataNodeEventProperties.NextSiblingNode,fromHost:[{name:e.PropertyDescriptors.DataNodeProperties,value:e.HostParameterMap.self}],isComplexType:!0}),e.HostParameterMap.define({type:e.EventDispId.dispidDataNodeAddedEvent,fromHost:[{name:e.EventDescriptors.DataNodeInsertedEvent,value:e.HostParameterMap.self}]}),e.HostParameterMap.define({type:e.EventDispId.dispidDataNodeReplacedEvent,fromHost:[{name:e.EventDescriptors.DataNodeReplacedEvent,value:e.HostParameterMap.self}]}),e.HostParameterMap.define({type:e.EventDispId.dispidDataNodeDeletedEvent,fromHost:[{name:e.EventDescriptors.DataNodeDeletedEvent,value:e.HostParameterMap.self}]})},defineWebParameterMapFunc:function(){e.HostParameterMap.define({type:e.EventDescriptors.DataNodeInsertedEvent,fromHost:[{name:e.DataNodeEventProperties.InUndoRedo,value:e.Marshaling.Customxml.DataNodeEventProperties.InUndoRedo},{name:e.DataNodeEventProperties.NewNode,value:e.Marshaling.Customxml.DataNodeEventProperties.NewNode}],isComplexType:!0}),e.HostParameterMap.define({type:e.EventDescriptors.DataNodeReplacedEvent,fromHost:[{name:e.DataNodeEventProperties.InUndoRedo,value:e.Marshaling.Customxml.DataNodeEventProperties.InUndoRedo},{name:e.DataNodeEventProperties.OldNode,value:e.Marshaling.Customxml.DataNodeEventProperties.OldNode},{name:e.DataNodeEventProperties.NewNode,value:e.Marshaling.Customxml.DataNodeEventProperties.NewNode}],isComplexType:!0}),e.HostParameterMap.define({type:e.EventDescriptors.DataNodeDeletedEvent,fromHost:[{name:e.DataNodeEventProperties.InUndoRedo,value:e.Marshaling.Customxml.DataNodeEventProperties.InUndoRedo},{name:e.DataNodeEventProperties.OldNode,value:e.Marshaling.Customxml.DataNodeEventProperties.OldNode},{name:e.DataNodeEventProperties.NextSiblingNode,value:e.Marshaling.Customxml.DataNodeEventProperties.NextSiblingNode}],isComplexType:!0}),e.HostParameterMap.define({type:e.DataNodeEventProperties.OldNode,fromHost:[{name:e.PropertyDescriptors.DataNodeProperties,value:e.HostParameterMap.self}],isComplexType:!0}),e.HostParameterMap.define({type:e.DataNodeEventProperties.NewNode,fromHost:[{name:e.PropertyDescriptors.DataNodeProperties,value:e.HostParameterMap.self}],isComplexType:!0}),e.HostParameterMap.define({type:e.DataNodeEventProperties.NextSiblingNode,fromHost:[{name:e.PropertyDescriptors.DataNodeProperties,value:e.HostParameterMap.self}],isComplexType:!0}),e.HostParameterMap.define({type:e.EventDispId.dispidDataNodeAddedEvent,fromHost:[{name:e.EventDescriptors.DataNodeInsertedEvent,value:e.HostParameterMap.self}]}),e.HostParameterMap.define({type:e.EventDispId.dispidDataNodeReplacedEvent,fromHost:[{name:e.EventDescriptors.DataNodeReplacedEvent,value:e.HostParameterMap.self}]}),e.HostParameterMap.define({type:e.EventDispId.dispidDataNodeDeletedEvent,fromHost:[{name:e.EventDescriptors.DataNodeDeletedEvent,value:e.HostParameterMap.self}]})}}),e.processDataPart=function(t){return e.manufactureDataPart(t,Office.context.document.customXmlParts)},e.processDataNode=function(t){return e.manufactureDataNode(t)}}(OSF||(OSF={})),function(e){!function(t){function n(t){if(null==t||null==t)return null;var n=null,r=typeof t;return void 0!==t.rows?n=Office.CoercionType.Table:e.OUtil.isArray(t)?n=Office.CoercionType.Matrix:("string"==r||"number"==r||"boolean"==r||e.OUtil.isDate(t))&&(n=Office.CoercionType.Text),n}function r(t,r,i){return(i=i||n(t))&&i!=r&&(t=function(t,n){var r;switch(t){case Office.CoercionType.Table:r=n;break;case Office.CoercionType.Matrix:r=function(e){var t=e.rows;null!=e.headers&&t.unshift(e.headers);return t}(n);break;case Office.CoercionType.SlideRange:e.manufactureSlideRange&&null==(r=e.manufactureSlideRange(o(n)))&&(r=o(n));break;case Office.CoercionType.Text:case Office.CoercionType.Html:case Office.CoercionType.Ooxml:default:r=o(n)}return r}(r,function(e,t){null==t&&(t=n(e));var r;switch(t){case Office.CoercionType.Table:r=e;break;case Office.CoercionType.Matrix:r=new Office.TableData(e);break;case Office.CoercionType.Text:case Office.CoercionType.Html:case Office.CoercionType.Ooxml:default:r=new Office.TableData(function(e){for(var t=e.split("\n"),n=0;n<t.length;n++)t[n]=t[n].split("\t");return t}(e))}return r}(t,i))),t}function i(e){if(1==e.length&&1==e[0].length)return""+e[0][0];for(var t="",n=0;n<e.length;n++)t+=e[n].join("\t")+"\n";return t.substring(0,t.length-1)}function o(e){var t="";null!=e.headers&&(t=i([e.headers])+"\n");var n=i(e.rows);return""==n&&(t=t.substring(0,t.length-1)),t+n}e.V10ApiFeatureRegistry.register({defineMethodsFunc:function(){},defineSafeArrayParameterMapFunc:function(){e.HostParameterMap.define({type:e.ParameterNames.CoercionType,toHost:[{name:Office.CoercionType.Text,value:0},{name:Office.CoercionType.Matrix,value:1},{name:Office.CoercionType.Table,value:2},{name:Office.CoercionType.Html,value:3},{name:Office.CoercionType.Ooxml,value:4},{name:Office.CoercionType.OoxmlPackage,value:5},{name:Office.CoercionType.PdfFile,value:6},{name:Office.CoercionType.SlideRange,value:7}]});var t=e._OfficeAppFactory.getHostInfo();t.hostPlatform!=e.HostInfoPlatform.win32&&t.hostPlatform!=e.HostInfoPlatform.mac&&t.hostPlatform!=e.HostInfoPlatform.ios&&t.hostPlatform!=e.HostInfoPlatform.android||(e.OUtil.augmentList(Office.CoercionType,{Image:"image"}),e.OUtil.augmentList(Office.CoercionType,{XmlSvg:"xmlSvg"}),e.HostParameterMap.define({type:e.ParameterNames.CoercionType,toHost:[{name:"image",value:8},{name:"xmlSvg",value:9}]}));e.HostParameterMap.define({type:e.ParameterNames.ValueFormat,toHost:[{name:Office.ValueFormat.Unformatted,value:0},{name:Office.ValueFormat.Formatted,value:1}]}),e.HostParameterMap.define({type:e.ParameterNames.FilterType,toHost:[{name:Office.FilterType.All,value:0}]})},defineWebParameterMapFunc:function(){e.OUtil.augmentList(Office.CoercionType,{Image:"image"}),e.OUtil.augmentList(Office.CoercionType,{XmlSvg:"xmlSvg"}),e.HostParameterMap.define({type:e.ParameterNames.CoercionType,toHost:[{name:Office.CoercionType.Text,value:0},{name:Office.CoercionType.Matrix,value:1},{name:Office.CoercionType.Table,value:2},{name:Office.CoercionType.Html,value:3},{name:Office.CoercionType.Ooxml,value:4},{name:Office.CoercionType.OoxmlPackage,value:5},{name:Office.CoercionType.PdfFile,value:6},{name:Office.CoercionType.SlideRange,value:7},{name:"image",value:8},{name:"xmlSvg",value:9}]}),e.HostParameterMap.define({type:e.ParameterNames.ValueFormat,toHost:[{name:Office.ValueFormat.Unformatted,value:0},{name:Office.ValueFormat.Formatted,value:1}]}),e.HostParameterMap.define({type:e.ParameterNames.FilterType,toHost:[{name:Office.FilterType.All,value:0}]})}}),t.findArrayDimensionality=function t(n){if(e.OUtil.isArray(n)){for(var r=0,i=0;i<n.length;i++)r=Math.max(r,t(n[i]));return r+1}return 0},t.getCoercionDefaultForBinding=function(e){switch(e){case Office.BindingType.Matrix:return Office.CoercionType.Matrix;case Office.BindingType.Table:return Office.CoercionType.Table;case Office.BindingType.Text:default:return Office.CoercionType.Text}},t.getBindingDefaultForCoercion=function(e){switch(e){case Office.CoercionType.Matrix:return Office.BindingType.Matrix;case Office.CoercionType.Table:return Office.BindingType.Table;case Office.CoercionType.Text:case Office.CoercionType.Html:case Office.CoercionType.Ooxml:default:return Office.BindingType.Text}},t.determineCoercionType=n,t.coerceData=r,t.serializeDynamicData=function(t){if(null!=t&&void 0!==t.rows){var n={};n[e.TableDataProperties.TableRows]=t.rows,n[e.TableDataProperties.TableHeaders]=t.headers,t=n}var r;if(e._OfficeAppFactory.getHostInfo().hostPlatform==e.HostInfoPlatform.web)return"string"!=typeof t&&void 0!==t[e.TableDataProperties.TableRows]?((r={}).Rows=t[e.TableDataProperties.TableRows],r.Headers=t[e.TableDataProperties.TableHeaders],t=r):e.DataCoercion.determineCoercionType(t)==Office.CoercionType.Text&&(t=[[t]]),t;if(e.TableDataProperties&&"string"!=typeof t&&void 0!==t[e.TableDataProperties.TableRows]){(r=[])[0]=t[e.TableDataProperties.TableRows],r[1]=t[e.TableDataProperties.TableHeaders],t=r}return t},t.deserializeDynamicData=function(t,n){var i=null;if(e._OfficeAppFactory.getHostInfo().hostPlatform==e.HostInfoPlatform.web)null!=t.Rows?((i={})[e.TableDataProperties.TableRows]=t.Rows,i[e.TableDataProperties.TableHeaders]=t.Headers):i=t,!i||null==i[e.TableDataProperties.TableRows]&&null==i[e.TableDataProperties.TableHeaders]||(i=Office.manufactureTableData(i)),i=r(i,n);else{if(2===t.length){(i={})[e.TableDataProperties.TableRows]=t[0],i[e.TableDataProperties.TableHeaders]=t[1],i=Office.manufactureTableData(i)}else i=t;i=r(i,n)}return i}}(e.DataCoercion||(e.DataCoercion={}))}(OSF||(OSF={})),function(e){!function(e){!function(e){e.CoercionType="CoerceType"}(e.GetDataKeys||(e.GetDataKeys={})),function(e){e.CoercionType="CoerceType",e.Data="Data",e.ImageLeft="ImageLeft",e.ImageTop="ImageTop",e.ImageWidth="ImageWidth",e.ImageHeight="ImageHeight"}(e.SetDataKeys||(e.SetDataKeys={})),function(e){e.Html="html",e.Ooxml="ooxml",e.SlideRange="slideRange",e.Text="text",e.Table="table",e.Matrix="matrix",e.Image="image",e.XmlSvg="xmlSvg"}(e.CoercionTypeKeys||(e.CoercionTypeKeys={}))}(e.Marshaling||(e.Marshaling={})),e.DataIO||(e.DataIO={}),e.V10ApiFeatureRegistry.register({defineMethodsFunc:function(){},defineWebParameterMapFunc:function(){e.HostParameterMap.define({type:e.WACDelegate.UniqueArguments.GetData,toHost:[{name:e.ParameterNames.Id,value:"BindingId"},{name:e.ParameterNames.CoercionType,value:"CoerceType"},{name:e.ParameterNames.ValueFormat,value:"ValueFormat"},{name:e.ParameterNames.FilterType,value:"FilterType"},{name:e.ParameterNames.Rows,value:"Rows"},{name:e.ParameterNames.Columns,value:"Columns"},{name:e.ParameterNames.StartRow,value:"StartRow"},{name:e.ParameterNames.StartColumn,value:"StartCol"},{name:e.ParameterNames.RowCount,value:"RowCount"},{name:e.ParameterNames.ColumnCount,value:"ColCount"}]}),e.HostParameterMap.define({type:e.WACDelegate.UniqueArguments.SetData,toHost:[{name:e.ParameterNames.Id,value:"BindingId"},{name:e.ParameterNames.CoercionType,value:"CoerceType"},{name:e.ParameterNames.Data,value:e.WACDelegate.UniqueArguments.Data},{name:e.ParameterNames.Rows,value:"Rows"},{name:e.ParameterNames.Columns,value:"Columns"},{name:e.ParameterNames.StartRow,value:"StartRow"},{name:e.ParameterNames.StartColumn,value:"StartCol"},{name:e.ParameterNames.ImageLeft,value:"ImageLeft"},{name:e.ParameterNames.ImageTop,value:"ImageTop"},{name:e.ParameterNames.ImageWidth,value:"ImageWidth"},{name:e.ParameterNames.ImageHeight,value:"ImageHeight"}]})}})}(OSF||(OSF={})),function(e){!function(e){!function(e){e.MessageType="messageType",e.MessageContent="messageContent",e.MessageOrigin="messageOrigin"}(e.DialogMessageReceivedEventKeys||(e.DialogMessageReceivedEventKeys={})),function(e){e.MessageType="messageType",e.MessageContent="messageContent",e.MessageOrigin="messageOrigin"}(e.DialogParentMessageReceivedEventKeys||(e.DialogParentMessageReceivedEventKeys={})),function(e){e.MessageToParent="messageToParent",e.TargetOrigin="targetOrigin"}(e.MessageParentKeys||(e.MessageParentKeys={})),function(e){e.DialogNotificationShown="dialogNotificationShown"}(e.DialogNotificationShownEventType||(e.DialogNotificationShownEventType={})),function(e){e.MessageContent="messageContent",e.TargetOrigin="targetOrigin"}(e.SendMessageKeys||(e.SendMessageKeys={}))}(e.Marshaling||(e.Marshaling={}))}(OSF||(OSF={})),function(e){var t;!function(e){e.DialogParentMessageReceivedEvent="DialogParentMessageReceivedEvent",e.DialogMessageReceivedEvent="DialogMessageReceivedEvent"}(e.EventDescriptors||(e.EventDescriptors={})),e.DialogParentMessageEventDispatch=new e.EventDispatch([e.EventType.DialogParentMessageReceived,e.EventType.DialogParentEventReceived]),t||(t={}),e.V10ApiFeatureRegistry.register({defineMethodsFunc:function(){e.AsyncMethodCalls.define({method:e.AsyncMethods.DisplayDialogAsync,requiredArguments:[{name:e.ParameterNames.Url,types:["string"]}],supportedOptions:[{name:e.ParameterNames.Width,value:{types:["number"],defaultValue:99}},{name:e.ParameterNames.Height,value:{types:["number"],defaultValue:99}},{name:e.ParameterNames.RequireHTTPs,value:{types:["boolean"],defaultValue:!0}},{name:e.ParameterNames.DisplayInIframe,value:{types:["boolean"],defaultValue:!1}},{name:e.ParameterNames.HideTitle,value:{types:["boolean"],defaultValue:!1}},{name:e.ParameterNames.UseDeviceIndependentPixels,value:{types:["boolean"],defaultValue:!1}},{name:e.ParameterNames.PromptBeforeOpen,value:{types:["boolean"],defaultValue:!0}},{name:e.ParameterNames.EnforceAppDomain,value:{types:["boolean"],defaultValue:!0}},{name:e.ParameterNames.UrlNoHostInfo,value:{types:["boolean"],defaultValue:!1}}],privateStateCallbacks:[],onSucceeded:function(t,n,r){var i=t[e.ParameterNames.Id],o=t[e.ParameterNames.Data],a={},s=e.AsyncMethods.CloseAsync;e.OUtil.defineEnumerableProperty(a,s,{value:function(){var t=e.DispIdHost.CloseDialog;t(arguments,i,o,a)}});var c=e.SyncMethods.AddMessageHandler;if(e.OUtil.defineEnumerableProperty(a,c,{value:function(){var t=e.SyncMethodCalls.get(e.SyncMethods.AddMessageHandler),n=t.verifyAndExtractCall(arguments,a,o),r=n[e.ParameterNames.EventType],i=n[e.ParameterNames.Handler];return o.addEventHandlerAndFireQueuedEvent(r,i)}}),!0===e.EnableSendMessageDialogAPI){var l=e.SyncMethods.SendMessage;e.OUtil.defineEnumerableProperty(a,l,{value:function(){var t=e.DispIdHost.SendMessage;return t(arguments,o,a)}})}if(!0===e.EnableMessageChildDialogAPI){var u=e.SyncMethods.MessageChild;e.OUtil.defineEnumerableProperty(a,u,{value:function(){var t=e.DispIdHost.SendMessage;return t(arguments,o,a)}})}return a},checkCallArgs:function(t,n,r){return t[e.ParameterNames.Width]<=0&&(t[e.ParameterNames.Width]=1),!t[e.ParameterNames.UseDeviceIndependentPixels]&&t[e.ParameterNames.Width]>100&&(t[e.ParameterNames.Width]=99),t[e.ParameterNames.Height]<=0&&(t[e.ParameterNames.Height]=1),!t[e.ParameterNames.UseDeviceIndependentPixels]&&t[e.ParameterNames.Height]>100&&(t[e.ParameterNames.Height]=99),t[e.ParameterNames.RequireHTTPs]||(t[e.ParameterNames.RequireHTTPs]=!0),t}}),e.AsyncMethodCalls.define({method:e.AsyncMethods.CloseAsync,requiredArguments:[],supportedOptions:[],privateStateCallbacks:[]}),e.SyncMethodCalls.define({method:e.SyncMethods.MessageParent,requiredArguments:[{name:e.ParameterNames.MessageToParent,types:["string","number","boolean"]}],supportedOptions:[{name:e.ParameterNames.TargetOrigin,value:{types:["string"],defaultValue:""}}]}),e.SyncMethodCalls.define({method:e.SyncMethods.AddMessageHandler,requiredArguments:[{name:e.ParameterNames.EventType,enum:e.EventType,verify:function(e,t,n){return n.supportsEvent(e)}},{name:e.ParameterNames.Handler,types:["function"]}],supportedOptions:[]}),e.SyncMethodCalls.define({method:e.SyncMethods.SendMessage,requiredArguments:[{name:e.ParameterNames.MessageContent,types:["string"]}],supportedOptions:[{name:e.ParameterNames.TargetOrigin,value:{types:["string"],defaultValue:""}}],privateStateCallbacks:[]})},defineSafeArrayParameterMapFunc:function(){e.HostParameterMap.define({type:e.EventDispId.dispidDialogMessageReceivedEvent,fromHost:[{name:e.EventDescriptors.DialogMessageReceivedEvent,value:e.HostParameterMap.self}],isComplexType:!0}),e.HostParameterMap.define({type:e.EventDescriptors.DialogMessageReceivedEvent,fromHost:[{name:e.PropertyDescriptors.MessageType,value:0},{name:e.PropertyDescriptors.MessageContent,value:1},{name:e.PropertyDescriptors.MessageOrigin,value:2}],isComplexType:!0}),e.HostParameterMap.define({type:e.EventDispId.dispidDialogParentMessageReceivedEvent,fromHost:[{name:e.EventDescriptors.DialogParentMessageReceivedEvent,value:e.HostParameterMap.self}],isComplexType:!0}),e.HostParameterMap.define({type:e.EventDescriptors.DialogParentMessageReceivedEvent,fromHost:[{name:e.PropertyDescriptors.MessageType,value:0},{name:e.PropertyDescriptors.MessageContent,value:1},{name:e.PropertyDescriptors.MessageOrigin,value:2}],isComplexType:!0})},defineWebParameterMapFunc:function(){e.HostParameterMap.define({type:e.EventDispId.dispidDialogMessageReceivedEvent,fromHost:[{name:e.EventDescriptors.DialogMessageReceivedEvent,value:e.HostParameterMap.self}]}),e.HostParameterMap.addComplexType(e.EventDescriptors.DialogMessageReceivedEvent),e.HostParameterMap.define({type:e.EventDescriptors.DialogMessageReceivedEvent,fromHost:[{name:e.PropertyDescriptors.MessageType,value:e.Marshaling.DialogMessageReceivedEventKeys.MessageType},{name:e.PropertyDescriptors.MessageContent,value:e.Marshaling.DialogMessageReceivedEventKeys.MessageContent},{name:e.PropertyDescriptors.MessageOrigin,value:e.Marshaling.DialogMessageReceivedEventKeys.MessageOrigin}]}),e.HostParameterMap.define({type:e.EventDispId.dispidDialogParentMessageReceivedEvent,fromHost:[{name:e.EventDescriptors.DialogParentMessageReceivedEvent,value:e.HostParameterMap.self}]}),e.HostParameterMap.addComplexType(e.EventDescriptors.DialogParentMessageReceivedEvent),e.HostParameterMap.define({type:e.EventDescriptors.DialogParentMessageReceivedEvent,fromHost:[{name:e.PropertyDescriptors.MessageType,value:e.Marshaling.DialogParentMessageReceivedEventKeys.MessageType},{name:e.PropertyDescriptors.MessageContent,value:e.Marshaling.DialogParentMessageReceivedEventKeys.MessageContent},{name:e.PropertyDescriptors.MessageOrigin,value:e.Marshaling.DialogMessageReceivedEventKeys.MessageOrigin}]}),e.HostParameterMap.define({type:144,toHost:[{name:e.ParameterNames.MessageToParent,value:e.Marshaling.MessageParentKeys.MessageToParent},{name:e.ParameterNames.TargetOrigin,value:e.Marshaling.MessageParentKeys.TargetOrigin}]}),e.HostParameterMap.define({type:145,toHost:[{name:e.ParameterNames.MessageContent,value:e.Marshaling.SendMessageKeys.MessageContent},{name:e.ParameterNames.TargetOrigin,value:e.Marshaling.MessageParentKeys.TargetOrigin}]})},initializeFunc:function(){var t=e.OUtil.isPopupWindow();e.EnableMessageChildDialogAPI=!0,"onenote"==e._OfficeAppFactory.getHostInfo().hostType?e.EnableSendMessageDialogAPI=!1:e.EnableSendMessageDialogAPI=!0;var n=Office.context.ui;if(e.OUtil.isDialog()){var r=e.SyncMethods.MessageParent;n[r]||e.OUtil.defineEnumerableProperty(n,r,{value:function(){var t=e.DispIdHost.MessageParent;return t(arguments,n)}});var i=e.SyncMethods.AddMessageHandler;n[i]||void 0===e.DialogParentMessageEventDispatch||e.DispIdHost.addEventSupport(n,e.DialogParentMessageEventDispatch,t),t&&e.WacDialogAction.registerMessageReceivedEvent()}else{var o;o=null!=e.EventType.DialogParentMessageReceived?new e.EventDispatch([e.EventType.DialogMessageReceived,e.EventType.DialogEventReceived,e.EventType.DialogParentMessageReceived]):new e.EventDispatch([e.EventType.DialogMessageReceived,e.EventType.DialogEventReceived]);var a=e.AsyncMethods.DisplayDialogAsync;n[a]||e.OUtil.defineEnumerableProperty(n,a,{value:function(){var t=e.DispIdHost.OpenDialog;t(arguments,o,n)}})}e.OUtil.finalizeProperties(n)}})}(OSF||(OSF={}));var OfficeExt,Office,OSF,DialogApiManager=function(){function e(){}return e.messageChildRichApiBridge=function(){if(!0===OSF.EnableMessageChildDialogAPI){var e=OSF.DispIdHost.SendMessage;return e(arguments,null,null)}},e}();__assign=this&&this.__assign||function(){return(__assign=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)},__awaiter=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{c(r.next(e))}catch(e){o(e)}}function s(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){e.done?i(e.value):new n((function(t){t(e.value)})).then(a,s)}c((r=r.apply(e,t||[])).next())}))},__generator=this&&this.__generator||function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=t.call(e,a)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}};!function(e){!function(e){e.Url="url",e.Width="width",e.Height="height",e.DisplayInIframe="displayInIframe",e.HideTitle="hideTitle",e.UseDeviceIndependentPixels="useDeviceIndependentPixels",e.PromptBeforeOpen="promptBeforeOpen",e.EnforceAppDomain="enforceAppDomain",e.UrlNoHostInfo="urlNoHostInfo",e.TargetOrigin="targetOrigin"}(e.ShowWindowDialogParameterKeys||(e.ShowWindowDialogParameterKeys={})),function(e){var t="excel",n="word",r="powerpoint",i="outlook",o="visio";e.getDialogCssManager=function(e){switch(e){case t:case n:case r:case i:case o:default:return new a}};var a=function(){function e(){this.overlayElementCSS=["position: absolute","top: 0","left: 0","width: 100%","height: 100%","background-color: rgba(198, 198, 198, 0.5)","z-index: 99998"],this.dialogNotificationPanelCSS=["width: 100%","height: 190px","position: absolute","z-index: 99999","background-color: rgba(255, 255, 255, 1)","left: 0px","top: 50%","margin-top: -95px"],this.newWindowNotificationTextPanelCSS=["margin: 20px 14px","font-family: Segoe UI,Arial,Verdana,sans-serif","font-size: 14px","height: 100px","line-height: 100px"],this.newWindowNotificationTextSpanCSS=["display: inline-block","line-height: normal","vertical-align: middle"],this.crossZoneNotificationTextPanelCSS=["margin: 20px 14px","font-family: Segoe UI,Arial,Verdana,sans-serif","font-size: 14px","height: 100px"],this.dialogNotificationButtonPanelCSS="margin:0px 9px",this.buttonStyleCSS=["text-align: center","width: 70px","height: 25px","font-size: 14px","font-family: Segoe UI,Arial,Verdana,sans-serif","margin: 0px 5px","border-width: 1px","border-style: solid"]}return e.prototype.getOverlayElementCSS=function(){return this.overlayElementCSS.join(";")},e.prototype.getDialogNotificationPanelCSS=function(){return this.dialogNotificationPanelCSS.join(";")},e.prototype.getNewWindowNotificationTextPanelCSS=function(){return this.newWindowNotificationTextPanelCSS.join(";")},e.prototype.getNewWindowNotificationTextSpanCSS=function(){return this.newWindowNotificationTextSpanCSS.join(";")},e.prototype.getCrossZoneNotificationTextPanelCSS=function(){return this.crossZoneNotificationTextPanelCSS.join(";")},e.prototype.getDialogNotificationButtonPanelCSS=function(){return this.dialogNotificationButtonPanelCSS},e.prototype.getDialogButtonCSS=function(){return this.buttonStyleCSS.join(";")},e}();e.DefaultDialogCSSManager=a}(e.WacCommonUICssManager||(e.WacCommonUICssManager={})),function(t){var n=null,r=null,i=null,o=null,a="osfDialogInternal:action=closeDialog",s=null,c=!1,l=-1,u="messageParentKey",f=null,d="#ababab",p="#ffffff",m="newWindowNotificaiton",g="configureBrowserLink",h="dialogNotificationTextPanel",y={dispId:e.EventDispId.dispidDialogNotificationShownInAddinEvent,eventType:e.Marshaling.DialogNotificationShownEventType.DialogNotificationShown,onComplete:null,onCalling:null};function v(e,t){var n=t.message,r=t.targetOrigin;if(r)e.postMessage(n,r);else{var i=window.location.origin;i||(i=window.location.protocol+"//"+window.location.hostname+(window.location.port?":"+window.location.port:"")),e.postMessage(n,i)}}function O(){try{o&&o.id==m&&s&&s(12009)}catch(t){e.AppTelemetry&&e.AppTelemetry.logAppException("Error happened during executing displayDialogAsync callback."+t)}w()}function S(t,n){return __awaiter(this,void 0,void 0,(function(){var r,a,s,l;return __generator(this,(function(u){switch(u.label){case 0:return[4,e.OUtil.ensureOfficeStringsJs()];case 1:return u.sent(),r=!1,a=e.WacCommonUICssManager.getDialogCssManager(n),i=D(a),document.body.insertBefore(i,document.body.firstChild),(o=function(t,n){var r=document.createElement("div");r.style.cssText=t.getDialogNotificationPanelCSS(),M(r);var i=document.createElement("div");i.style.cssText=t.getCrossZoneNotificationTextPanelCSS(),i.id=h;var o=document.createElement("a");o.id=g,o.href="#",o.innerText=Strings.OfficeOM.L_NewWindowCrossZoneConfigureBrowserLink,o.setAttribute("onclick","window.open('https://support.microsoft.com/en-us/help/17479/windows-internet-explorer-11-change-security-privacy-settings', '_blank', 'fullscreen=1')");var a=document.createElement("span");if(Strings.OfficeOM.L_NewWindowCrossZone){var s=Strings.OfficeOM.L_NewWindowCrossZone.replace(/{1+}/gm,e.OUtil.getDomainForUrl(n)).split("{0}");a.appendChild(document.createTextNode(s[0])),a.appendChild(o),a.appendChild(document.createTextNode(s[1]))}return i.appendChild(a),r.appendChild(i),r}(a,t)).id="crossZoneNotification",s=x(a),l=P(a,Strings.OfficeOM.L_DialogOK?Strings.OfficeOM.L_DialogOK:"OK"),s.appendChild(l),o.appendChild(s),document.body.insertBefore(o,document.body.firstChild),c=!0,l.onclick=function(){w()},l.addEventListener("keydown",(function(e){9==e.keyCode?(document.getElementById(g).focus(),e.preventDefault(),e.stopPropagation()):13==e.keyCode&&(r=!0,e.preventDefault(),e.stopPropagation())}),!1),l.addEventListener("keyup",(function(e){13==e.keyCode&&r&&(r=!1,w(),e.preventDefault(),e.stopPropagation())}),!1),document.getElementById(g).addEventListener("keydown",(function(e){9==e.keyCode&&(l.focus(),e.preventDefault(),e.stopPropagation())}),!1),window.focus(),l.focus(),[2]}}))}))}function b(){return e._OfficeAppFactory.getInitializationHelper()instanceof e.WebInitializationHelper?e._OfficeAppFactory.getInitializationHelper().get_addInSourceUrlFromAppContext():""}function _(t){if(t.source==n)try{var i=t.origin;if(!function(t,n,r){if(void 0===r&&(r=!0),!t||!n)return!1;var i=e.OUtil.parseUrl(t),o=e.OUtil.parseUrl(n),a=e._OfficeAppFactory.getOfficeAppContext().get_appDomains();if("https:"!==i.protocol)return!1;var s=i.protocol===o.protocol&&i.hostname===o.hostname&&i.port===o.port,c=e.XdmCommunicationManager.checkUrlWithAppDomains(a,t),l=s||c;return!l&&r&&(l=e.XdmCommunicationManager.isTargetSubdomainOfSourceLocation(n,t)),l}(i,b(),!0))throw new Error("Received a message from a dialog with an untrusted domain.");var o={};o[e.Marshaling.DialogMessageReceivedEventKeys.MessageType]=0,o[e.Marshaling.DialogMessageReceivedEventKeys.MessageContent]=t.data,o[e.Marshaling.DialogMessageReceivedEventKeys.MessageOrigin]=i,r(o)}catch(t){e.AppTelemetry&&e.AppTelemetry.logAppException("Error happened during receive message handler."+t)}}function A(t){var n=e._OfficeAppFactory.getId()+u;if(t.key==n)try{var i={};i[e.Marshaling.DialogMessageReceivedEventKeys.MessageType]=0,i[e.Marshaling.DialogMessageReceivedEventKeys.MessageContent]=t.newValue,i[e.Marshaling.DialogMessageReceivedEventKeys.MessageOrigin]=t.origin,r(i)}catch(t){e.AppTelemetry&&e.AppTelemetry.logAppException("Error happened during storage changed handler."+t)}}function C(t){var i=e._OfficeAppFactory.getHostInfo(),o=[i.hostType,i.hostPlatform,i.hostSpecificFileVersion,i.hostLocale,i.osfControlAppCorrelationId,"isDialog",i.disableLogging?"disableLogging":"",i.flags&e.HostInfoFlags.PublicAddin].join("$"),a=e._OfficeAppFactory.getOfficeAppContext();a.set_taskpaneUrl(window.location.origin),a.get_taskpaneUrl()||a.set_taskpaneUrl(window.location.protocol+"//"+window.location.hostname+(window.location.port?":"+window.location.port:""));var c=t.url;t[e.ShowWindowDialogParameterKeys.UrlNoHostInfo]||(c=e.OUtil.addHostInfoAsQueryParam(c,o));var u=JSON.parse(window.name);u.hostInfo=o;var f=__assign({},a);if(f._appName===e.AppName.ExcelWebApp){if(!f._settings&&f._settingsFunc){var d=f._settingsFunc();f._settings=Object.keys(d).map((function(e){return[e,d[e]]}))}if(!f._hostSettings&&f._hostSettingsFunc){var p=f._hostSettingsFunc();f._hostSettings=Object.keys(p).map((function(e){return[e,p[e]]}))}u.appContext=f}else u.appContext=a;var m=t[e.ShowWindowDialogParameterKeys.Width]*screen.width/100,g=t[e.ShowWindowDialogParameterKeys.Height]*screen.height/100,h="width="+m+", height="+g+", left="+(a.get_clientWindowWidth()/2-m/2)+", top="+(a.get_clientWindowHeight()/2-g/2)+",channelmode=no,directories=no,fullscreen=no,location=no,menubar=no,resizable=yes,scrollbars=yes,status=no,titlebar=yes,toolbar=no";if(null==(n=window.open(c,e.OUtil.serializeObjectToString(u),h)))return e.AppTelemetry.logAppCommonMessage("Encountered cross zone issue in displayDialogAsync api."),T(),S(c,i.hostType),void s(12011);e.OUtil.shouldUseLocalStorageToPassMessage()?window.addEventListener("storage",A):window.addEventListener("message",_),l=window.setInterval((function(){try{if(null==n||n.closed){window.clearInterval(l),e.OUtil.shouldUseLocalStorageToPassMessage()?window.removeEventListener("storage",A):window.removeEventListener("message",_);var t={};t[e.Marshaling.DialogMessageReceivedEventKeys.MessageType]=12006,r(t)}}catch(t){e.AppTelemetry&&e.AppTelemetry.logAppException("Error happened during check or handle window close."+t)}}),1e3),null!=s?s(0):e.AppTelemetry&&e.AppTelemetry.logAppException("showDialogCallback can not be null.")}function P(e,t){var n=document.createElement("input");n.setAttribute("type","button"),n.style.cssText=e.getDialogButtonCSS(),n.style.borderColor=d,n.style.backgroundColor=p,n.setAttribute("value",t);var r=function(){E(n)},i=function(){I(n)};return n.addEventListener("mouseover",r),n.addEventListener("focus",r),n.addEventListener("mouseout",i),n.addEventListener("focusout",i),n}function E(t){null!=f?(t.style.borderColor=f.HostButtonBorderColor,t.style.backgroundColor=f.HostButtonBackgroundColor):e.OUtil.getCommonUI()?(t.style.borderColor=e.OUtil.getCommonUI().HostButtonBorderColor,t.style.backgroundColor=e.OUtil.getCommonUI().HostButtonBackgroundColor):t.style.backgroundColor="#ccc"}function I(e){e.style.borderColor=d,e.style.backgroundColor=p}function w(){y.onCalling=function(e){T(),F(e)},e.WACDelegate.unregisterEventAsync(y)}function T(){null!=o&&(document.body.removeChild(o),o=null),null!=i&&(document.body.removeChild(i),i=null)}function D(e){var t=document.createElement("div");return t.style.cssText=e.getOverlayElementCSS(),t}function x(e){var t=document.createElement("div");return t.style.cssText=e.getDialogNotificationButtonPanelCSS(),"rtl"==document.documentElement.getAttribute("dir")?t.style.cssFloat="left":t.style.cssFloat="right",t}function F(t){if(0!=t){var n=document.querySelectorAll(e._OfficeAppFactory.getInitializationHelper().getTabbableElements());e.OUtil.focusToFirstTabbable(n,!1)}}function M(e){e.setAttribute("role","dialog"),e.setAttribute("aria-describedby",h)}t.setHostThemeButtonStyle=function(t){var n=t.input;null!=n&&(f={HostButtonBorderColor:n[e.OUtil.HostThemeButtonStyleKeys.ButtonBorderColor],HostButtonBackgroundColor:n[e.OUtil.HostThemeButtonStyleKeys.ButtonBackgroundColor]}),t.completed()},t.removeEventListenersForDialog=function(t){!function(t){var n=this,r=function(){e._OfficeAppFactory.getWebAppState().focused||(e._OfficeAppFactory.getWebAppState().focused=!0),e.getClientEndPoint().invoke("ContextActivationManager_notifyHost",null,[n._webAppState.id,e.AgaveHostAction.Select])},i=function(){e&&(e._OfficeAppFactory.getWebAppState().focused&&(e._OfficeAppFactory.getWebAppState().focused=!1),e.getClientEndPoint().invoke("ContextActivationManager_notifyHost",null,[n._webAppState.id,e.AgaveHostAction.UnSelect]))},o=function(t){if(t.preventDefault=t.preventDefault||function(){t.returnValue=!1},117==t.keyCode&&(t.ctrlKey||t.metaKey)){t.preventDefault();var r=e.AgaveHostAction.CtrlF6Exit;t.shiftKey&&(r=e.AgaveHostAction.CtrlF6ExitShift),e.getClientEndPoint().invoke("ContextActivationManager_notifyHost",null,[n._webAppState.id,r])}else if(9==t.keyCode){t.preventDefault();var i=document.querySelectorAll(n._tabbableElements);e.OUtil.focusToNextTabbable(i,t.target||t.srcElement,t.shiftKey)||(n._hostInfo.isDialog?e.OUtil.focusToFirstTabbable(i,t.shiftKey):t.shiftKey?e.getClientEndPoint().invoke("ContextActivationManager_notifyHost",null,[n._webAppState.id,e.AgaveHostAction.TabExitShift]):e.getClientEndPoint().invoke("ContextActivationManager_notifyHost",null,[n._webAppState.id,e.AgaveHostAction.TabExit]))}else if(27==t.keyCode)t.preventDefault(),O(),e.getClientEndPoint().invoke("ContextActivationManager_notifyHost",null,[n._webAppState.id,e.AgaveHostAction.EscExit]);else if(113==t.keyCode)t.preventDefault(),e.getClientEndPoint().invoke("ContextActivationManager_notifyHost",null,[n._webAppState.id,e.AgaveHostAction.F2Exit]);else if((t.ctrlKey||t.metaKey||t.shiftKey||t.altKey)&&t.keyCode>=1&&t.keyCode<=255){var o={keyCode:t.keyCode,shiftKey:t.shiftKey,altKey:t.altKey,ctrlKey:t.ctrlKey,metaKey:t.metaKey};e.getClientEndPoint().invoke("ContextActivationManager_notifyHost",null,[n._webAppState.id,e.AgaveHostAction.KeyboardShortcuts,o])}},a=function(e){117==e.keyCode&&e.ctrlKey&&(e.preventDefault?e.preventDefault():e.returnValue=!1)};t?(e.OUtil.addEventListener(window,"focus",r),e.OUtil.addEventListener(window,"blur",i),e.OUtil.addEventListener(window,"keydown",o),e.OUtil.addEventListener(window,"keypress",a)):(e.OUtil.removeEventListener(window,"focus",r),e.OUtil.removeEventListener(window,"blur",i),e.OUtil.removeEventListener(window,"keydown",o),e.OUtil.removeEventListener(window,"keypress",a))}(!1),t.completed()},t.handleNewWindowDialog=function(t){return __awaiter(this,void 0,void 0,(function(){function n(t){y.onCalling=function(e){T(),F(e),s(12009)},e.WACDelegate.unregisterEventAsync(y),t.preventDefault(),t.stopPropagation()}function r(e){p.focus()}var a,l,u,f,d,p,g,v;return __generator(this,(function(O){switch(O.label){case 0:return O.trys.push([0,2,,3]),function(t){var n=e._OfficeAppFactory.getOfficeAppContext().get_appDomains(),r=t.url,i=e.XdmCommunicationManager.checkUrlWithAppDomains(n,r);if(!i){var o=b();return Boolean(o)&&e.XdmCommunicationManager.isTargetSubdomainOfSourceLocation(o,r)}return i}(t)?t[e.ShowWindowDialogParameterKeys.PromptBeforeOpen]?[4,e.OUtil.ensureOfficeStringsJs()]:(C(t),[2]):(s(12004),[2]);case 1:return O.sent(),c=!1,a=!1,l=e._OfficeAppFactory.getHostInfo(),u=e.WacCommonUICssManager.getDialogCssManager(l.hostType),f=e.OUtil.formatString(Strings.OfficeOM.L_ShowWindowDialogNotification,e._OfficeAppFactory.getOfficeAppContext().get_addinName()),i=D(u),document.body.insertBefore(i,document.body.firstChild),(o=function(e,t){var n=document.createElement("div");n.style.cssText=e.getDialogNotificationPanelCSS(),M(n);var r=document.createElement("div");r.style.cssText=e.getNewWindowNotificationTextPanelCSS(),r.id=h,"rtl"==document.documentElement.getAttribute("dir")?r.style.paddingRight="30px":r.style.paddingLeft="30px";var i=document.createElement("span");return i.style.cssText=e.getNewWindowNotificationTextSpanCSS(),i.innerText=t,r.appendChild(i),n.appendChild(r),n}(u,f)).id=m,d=x(u),p=P(u,Strings.OfficeOM.L_ShowWindowDialogNotificationAllow),g=P(u,Strings.OfficeOM.L_ShowWindowDialogNotificationIgnore),d.appendChild(p),d.appendChild(g),o.appendChild(d),document.body.insertBefore(o,document.body.firstChild),p.onclick=function(e){C(t),c||w(),e.preventDefault(),e.stopPropagation()},g.onclick=n,p.addEventListener("keydown",(function(e){e.shiftKey&&9==e.keyCode&&(I(p),E(g),g.focus(),e.preventDefault(),e.stopPropagation())}),!1),g.addEventListener("keydown",(function(e){e.shiftKey||9!=e.keyCode?13==e.keyCode&&(a=!0,e.preventDefault(),e.stopPropagation()):(I(g),E(p),p.focus(),e.preventDefault(),e.stopPropagation())}),!1),g.addEventListener("keyup",(function(e){13==e.keyCode&&a&&(a=!1,n(e))}),!1),window.focus(),y.onCalling=r,e.WACDelegate.registerEventAsync(y),[3,3];case 2:return v=O.sent(),e.AppTelemetry&&e.AppTelemetry.logAppException("Exception happens at new window dialog."+v),s(5001),[3,3];case 3:return[2]}}))}))},t.closeDialog=function(t){try{if(null!=n){if(!e.OUtil.checkFlight(e.FlightTreatmentNames.MetaOSJsonManifestAppDomainWildcards)){var r=e._OfficeAppFactory.getOfficeAppContext().get_appDomains();if(r)for(var i=0;i<r.length&&-1!==r[i].indexOf("://");i++)n.postMessage(a,r[i])}null==n||n.closed||n.close(),e.OUtil.shouldUseLocalStorageToPassMessage()?window.removeEventListener("storage",A):window.removeEventListener("message",_),window.clearInterval(l),n=null,t(0)}else t(5001)}catch(n){e.AppTelemetry&&e.AppTelemetry.logAppException("Exception happens at close window dialog."+n),t(5001)}},t.messageParent=function(t){var n=t.hostCallArgs[e.ParameterNames.MessageToParent],r=t.hostCallArgs[e.ParameterNames.TargetOrigin]||null;if(e.OUtil.shouldUseLocalStorageToPassMessage())try{var i=e._OfficeAppFactory.getId()+u;window.localStorage.setItem(i,n)}catch(t){e.AppTelemetry&&e.AppTelemetry.logAppException("Error happened during messageParent method:"+t)}else v(window.opener,{message:n,targetOrigin:r})},t.sendMessage=function(t){if(null!=n){var r=t.hostCallArgs,i=r[e.ParameterNames.TargetOrigin]||null;delete r[e.ParameterNames.TargetOrigin],"string"!=typeof r&&(r=JSON.stringify(r)),v(n,{message:r,targetOrigin:i})}},t.postDialogMessage=v,t.registerMessageReceivedEvent=function(){window.addEventListener("message",(function(t){if(t.source==window.opener)if("string"==typeof t.data&&t.data.indexOf(a)>-1)window.close();else{var n=t.data,r=typeof n;if(n&&("object"==r||"string"==r)){var i="string"==r?JSON.parse(n):n,o={};o[e.Marshaling.DialogMessageReceivedEventKeys.MessageContent]=i.messageContent,o[e.Marshaling.DialogMessageReceivedEventKeys.MessageOrigin]=t.origin;var s=e.manufactureEventArgs(e.EventType.DialogParentMessageReceived,null,o);e.DialogParentMessageEventDispatch.fireEvent(s)}}}))},t.setHandlerAndShowDialogCallback=function(e,t){r=e,s=t},t.escDismissDialogNotification=O,t.showCrossZoneNotification=S,t.getUrlProtocolHostnamePort=function(e){var t=e.port?":"+e.port:"";return e.protocol+"//"+e.hostname+t}}(e.WacDialogAction||(e.WacDialogAction={}))}(OSF||(OSF={})),function(e){!function(t){t.openDialog=function(t){try{t.onCalling&&t.onCalling();var n=e.SafeArrayDelegate.getOnAfterRegisterEvent(!0,t);e._OfficeAppFactory.getClientHostController().openDialog(t.dispId,void 0,t.targetId,(function(n,r){t.onEvent&&t.onEvent(r),e.AppTelemetry&&e.AppTelemetry.onEventDone(t.dispId)}),n)}catch(n){e.SafeArrayDelegate.onException(n,t)}},t.closeDialog=function(t){t.onCalling&&t.onCalling();var n=e.SafeArrayDelegate.getOnAfterRegisterEvent(!1,t);try{e._OfficeAppFactory.getClientHostController().closeDialog(t.dispId,void 0,t.targetId,n)}catch(n){e.SafeArrayDelegate.onException(n,t)}},t.messageParent=function(t){try{t.onCalling&&t.onCalling();var n=(new Date).getTime(),r=e._OfficeAppFactory.getClientHostController().messageParent(t.hostCallArgs);return t.onReceiving&&t.onReceiving(),e.AppTelemetry&&e.AppTelemetry.onMethodDone(t.dispId,t.hostCallArgs,Math.abs((new Date).getTime()-n),r),r}catch(t){return e.SafeArrayDelegate.onExceptionSyncMethod(t)}},t.sendMessage=function(t){try{t.onCalling&&t.onCalling();(new Date).getTime();var n=e._OfficeAppFactory.getClientHostController().sendMessage(t.hostCallArgs);return t.onReceiving&&t.onReceiving(),n}catch(t){return e.SafeArrayDelegate.onExceptionSyncMethod(t)}}}(e.SafeArrayDelegate||(e.SafeArrayDelegate={}))}(OSF||(OSF={})),function(e){!function(t){t.openDialog=function(n){var r="https://",i="http://",o=JSON.parse(n.targetId),a=t.getOnAfterRegisterEvent(!0,n);function s(t){var n={Error:t};try{a(0,n)}catch(t){e.AppTelemetry&&e.AppTelemetry.logAppException("Exception happens at showDialogCallback."+t)}}if(e.DialogShownStatus.hasDialogShown)s(12007);else{var c=o[e.ShowWindowDialogParameterKeys.Url].toLowerCase(),l=window.location.href.toLowerCase();if(e.AppTelemetry){var u=!1,f=!1,d=!1,p=!1,m="",g="";if(e.OUtil){var h=e.OUtil.parseUrl(c),y=e.OUtil.parseUrl(l);u=h.protocol===y.protocol&&h.hostname===y.hostname&&h.port===y.port,m=e.OUtil.getHostnamePortionForLogging(h.hostname),u?g=m:(g=e.OUtil.getHostnamePortionForLogging(y.hostname),f=e.XdmCommunicationManager.isTargetSubdomainOfSourceLocation(c,l),d=e.XdmCommunicationManager.isTargetSubdomainOfSourceLocation(l,c));var v=e._OfficeAppFactory.getOfficeAppContext().get_appDomains();p=e.XdmCommunicationManager.checkUrlWithAppDomains(v,c)}var O="openDialog isInline: "+o[e.ShowWindowDialogParameterKeys.DisplayInIframe].toString()+", taskpaneHostname: "+g+", dialogHostName: "+m+", isSameDomain: "+u.toString()+", parentIsSubdomain: "+f.toString()+", childIsSubdomain: "+d.toString()+", isAppDomain: "+p.toString();e.AppTelemetry.logAppCommonMessage(O)}null!=c&&c.substr(0,r.length)===r?o[e.ShowWindowDialogParameterKeys.DisplayInIframe]?(e.DialogShownStatus.isWindowDialog=!1,e.WACDelegate.registerEventAsync(n)):(e.DialogShownStatus.isWindowDialog=!0,e.WacDialogAction.setHandlerAndShowDialogCallback((function(t){n.onEvent&&n.onEvent(t),e.AppTelemetry&&e.AppTelemetry.onEventDone(n.dispId)}),s),e.WacDialogAction.handleNewWindowDialog(o)):c.substr(0,i.length)===i?s(12005):s(12003)}},t.messageParent=function(t){var n=!!t.hostCallArgs.targetOrigin;if(null!=window.opener)e.WacDialogAction.messageParent(t);else{var r=window.location.origin;r||(r=window.location.protocol+"//"+window.location.hostname+(window.location.port?":"+window.location.port:"")),n||(t.hostCallArgs.targetOrigin=r),e.WACDelegate.executeAsync(t)}},t.sendMessage=function(t){e.DialogShownStatus.hasDialogShown&&(e.DialogShownStatus.isWindowDialog?e.WacDialogAction.sendMessage(t):e.WACDelegate.executeAsync(t))},t.closeDialog=function(n){var r=t.getOnAfterRegisterEvent(!1,n);function i(t){var n={Error:t};try{r(0,n)}catch(t){e.AppTelemetry&&e.AppTelemetry.logAppException("Exception happens at closeDialogCallback."+t)}}e.DialogShownStatus.hasDialogShown?e.DialogShownStatus.isWindowDialog?(n.onCalling&&n.onCalling(),e.WacDialogAction.closeDialog(i)):e.WACDelegate.unregisterEventAsync(n):i(12006)}}(e.WACDelegate||(e.WACDelegate={}))}(OSF||(OSF={})),function(e){var t;t||(t={}),e.V10ApiFeatureRegistry.register({defineMethodsFunc:function(){},defineSafeArrayParameterMapFunc:function(){e.HostParameterMap.define({type:e.EventDispId.dispidDocumentSelectionChangedEvent})},defineWebParameterMapFunc:function(){e.HostParameterMap.define({type:e.EventDispId.dispidDocumentSelectionChangedEvent})},initializeFunc:function(){var t=Office.context.document;e.DispIdHost.addEventSupport(t,new e.EventDispatch([e.EventType.DocumentSelectionChanged,e.EventType.ActiveViewChanged]))}})}(OSF||(OSF={})),function(e){var t;t||(t={}),e.V10ApiFeatureRegistry.register({defineMethodsFunc:function(){e.AsyncMethodCalls.define({method:e.AsyncMethods.AddHandlerAsync,requiredArguments:[{name:e.ParameterNames.EventType,enum:e.EventType,verify:function(e,t,n){return n.supportsEvent(e)}},{name:e.ParameterNames.Handler,types:["function"]}],supportedOptions:[],privateStateCallbacks:[]}),e.AsyncMethodCalls.define({method:e.AsyncMethods.RemoveHandlerAsync,requiredArguments:[{name:e.ParameterNames.EventType,enum:e.EventType,verify:function(e,t,n){return n.supportsEvent(e)}}],supportedOptions:[{name:e.ParameterNames.Handler,value:{types:["function","object"],defaultValue:null}}],privateStateCallbacks:[]})}})}(OSF||(OSF={})),function(e){var t;!function(e){e.FeatureProperties="FeatureProperties",e.TcidEnabled="TcidEnabled",e.TcidVisible="TcidVisible"}(e.PropertyDescriptors||(e.PropertyDescriptors={})),function(t){function n(){e.HostParameterMap.define({type:e.PropertyDescriptors.FeatureProperties,fromHost:[{name:e.PropertyDescriptors.TcidEnabled,value:0},{name:e.PropertyDescriptors.TcidVisible,value:1}],isComplexType:!0}),e.HostParameterMap.define({type:146,toHost:[{name:e.ParameterNames.Tcid,value:0}]}),e.HostParameterMap.define({type:147,fromHost:[{name:e.PropertyDescriptors.FeatureProperties,value:e.HostParameterMap.self}],toHost:[{name:e.ParameterNames.Tcid,value:0}]})}e.V10ApiFeatureRegistry.register({defineMethodsFunc:function(){e.AsyncMethodCalls.define({method:e.AsyncMethods.ExecuteFeature,requiredArguments:[{name:e.ParameterNames.Tcid,types:["number"]}],privateStateCallbacks:[]}),e.AsyncMethodCalls.define({method:e.AsyncMethods.QueryFeature,requiredArguments:[{name:e.ParameterNames.Tcid,types:["number"]}],privateStateCallbacks:[]})},defineSafeArrayParameterMapFunc:n,defineWebParameterMapFunc:n,initializeFunc:function(){var t=Office.context.ui;e.DispIdHost.addAsyncMethods(t,[e.AsyncMethods.ExecuteFeature]),e.DispIdHost.addAsyncMethods(t,[e.AsyncMethods.QueryFeature])}})}(t||(t={}))}(OSF||(OSF={})),function(e){!function(e){!function(e){e.launchExtensionComponent=function(e,t,n,r,i){var o=OSF.OUtil.Guid.generateNewGuid();null==i&&(i={OptionalProperties:{},DevProperties:{}}),i.OptionalProperties.InstanceToken=o;var a={ExtId:e,ComponentType:t,ComponentId:n,HostProps:r,OptionalProps:i};if(OSF._OfficeAppFactory.getHostInfo().hostPlatform==OSF.HostInfoPlatform.web){var s=OSF._OfficeAppFactory.getWebAppState();return s.clientEndPoint.invoke("ContextActivationManager_notifyHost",null,[s.id,OSF.AgaveHostAction.LaunchExtensionComponent,a]),{Id:e,ComponentType:t,ComponentId:n,InstanceToken:o,LaunchProperties:i}}throw OSF.Utility.createNotImplementedException()}}(e.extensionLifeCycle||(e.extensionLifeCycle={}))}(e.context||(e.context={})),function(e){e.close=function(e){OSF._OfficeAppFactory.getClientHostController().closeSdxDialog(e)},e.resize=function(e,t){OSF.Utility.isNullOrUndefined(e)||OSF.Utility.isNullOrUndefined(t)||"number"!=typeof e||"number"!=typeof t?OSF.Utility.debugLog("Invaid dialog width or height. Kindly provide two numbers as input parameters."):OSF._OfficeAppFactory.getClientHostController().resizeSdxDialog(e,t)}}(e.ExtensionLifeCycle||(e.ExtensionLifeCycle={}))}(Office||(Office={})),function(e){var t=function(){function e(e,t,n){this.m_fileSize=t,this.m_sliceSize=n,this.m_privateState={},this.m_privateState[OSF.FileProperties.Handle]=e,this.m_privateState[OSF.FileProperties.SliceSize]=n}return Object.defineProperty(e.prototype,"size",{get:function(){return this.m_fileSize},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"sliceCount",{get:function(){return Math.ceil(this.m_fileSize/this.m_sliceSize)},enumerable:!0,configurable:!0}),e.prototype.getSliceAsync=function(e,t){OSF.DispIdHost.InvokeMethod(OSF.AsyncMethods.GetDocumentCopyChunkAsync,arguments,this,this.m_privateState)},e.prototype.closeAsync=function(e){OSF.DispIdHost.InvokeMethod(OSF.AsyncMethods.ReleaseDocumentCopyAsync,arguments,this,this.m_privateState)},e}();e.File=t}(Office||(Office={})),function(e){!function(t){!function(t){t.getFileAsync=function(t,n,r){OSF.DispIdHost.InvokeMethod(OSF.AsyncMethods.GetDocumentCopyAsync,arguments,e.context.document,void 0)}}(t.document||(t.document={}))}(e.context||(e.context={}))}(Office||(Office={})),function(e){!function(e){e.FileProperties="FileProperties",e.FileSliceProperties="FileSliceProperties"}(e.PropertyDescriptors||(e.PropertyDescriptors={})),function(e){e.Handle="FileHandle",e.FileSize="FileSize",e.SliceSize="sliceSize"}(e.FileProperties||(e.FileProperties={})),function(e){e.FileSliceOffset="fileSliceoffset"}(e.additionalParameter||(e.additionalParameter={})),function(e){!function(e){!function(e){e[e.Handle=0]="Handle",e[e.FileSize=1]="FileSize"}(e.FilePropertiesKeys||(e.FilePropertiesKeys={})),function(e){e[e.Data=0]="Data",e[e.SliceSize=1]="SliceSize"}(e.SlicePropertiesKeys||(e.SlicePropertiesKeys={})),function(e){e[e.Text=0]="Text",e[e.Compressed=1]="Compressed",e[e.Pdf=2]="Pdf"}(e.FileType||(e.FileType={})),function(e){e[e.FileType=0]="FileType",e[e.SliceSize=1]="SliceSize",e[e.Handle=2]="Handle",e[e.SliceIndex=3]="SliceIndex"}(e.ParameterKeys||(e.ParameterKeys={}))}(e.File||(e.File={}))}(e.Marshaling||(e.Marshaling={})),e.File||(e.File={}),e.V10ApiFeatureRegistry.register({defineMethodsFunc:function(){e.AsyncMethodCalls.define({method:e.AsyncMethods.GetDocumentCopyAsync,requiredArguments:[{name:e.ParameterNames.FileType,enum:Office.FileType}],supportedOptions:[{name:e.ParameterNames.SliceSize,value:{types:["number"],defaultValue:e.OUtil.getHostPlatform()==e.HostInfoPlatform.ios?65536:4194304}}],checkCallArgs:function(t,n,r){var i=t[e.ParameterNames.SliceSize];if(i<=0||i>4194304)throw 11002;return t},onSucceeded:function(t,n,r){return new Office.File(t[e.FileProperties.Handle],t[e.FileProperties.FileSize],r[e.ParameterNames.SliceSize])}}),e.AsyncMethodCalls.define({method:e.AsyncMethods.GetDocumentCopyChunkAsync,requiredArguments:[{name:e.ParameterNames.SliceIndex,types:["number"]}],privateStateCallbacks:[{name:e.FileProperties.Handle,value:function(t,n){return n[e.FileProperties.Handle]}},{name:e.FileProperties.SliceSize,value:function(t,n){return n[e.FileProperties.SliceSize]}}],checkCallArgs:function(t,n,r){var i=t[e.ParameterNames.SliceIndex];if(i<0||i>=n.sliceCount)throw 5008;return t[e.additionalParameter.FileSliceOffset]=parseInt((i*r[e.FileProperties.SliceSize]).toString()),t},onSucceeded:function(t,n,r){var i={};return e.OUtil.defineEnumerableProperties(i,{data:{value:e.OUtil.getHostPlatform()==e.HostInfoPlatform.mac?e.OUtil.shallowCopy(t[e.ParameterNames.Data]):t[e.ParameterNames.Data]},index:{value:r[e.ParameterNames.SliceIndex]},size:{value:t[e.FileProperties.SliceSize]}}),i}}),e.AsyncMethodCalls.define({method:e.AsyncMethods.ReleaseDocumentCopyAsync,privateStateCallbacks:[{name:e.FileProperties.Handle,value:function(t,n){return n[e.FileProperties.Handle]}}]})},defineSafeArrayParameterMapFunc:function(){e.HostParameterMap.define({type:e.PropertyDescriptors.FileProperties,fromHost:[{name:e.FileProperties.Handle,value:0},{name:e.FileProperties.FileSize,value:1}],isComplexType:!0}),e.HostParameterMap.define({type:e.PropertyDescriptors.FileSliceProperties,fromHost:[{name:e.ParameterNames.Data,value:0},{name:e.FileProperties.SliceSize,value:1}],isComplexType:!0}),e.HostParameterMap.define({type:e.ParameterNames.FileType,toHost:[{name:Office.FileType.Text,value:0},{name:Office.FileType.Compressed,value:5},{name:Office.FileType.Pdf,value:6}]}),e.HostParameterMap.define({type:77,toHost:[{name:e.ParameterNames.FileType,value:0}],fromHost:[{name:e.PropertyDescriptors.FileProperties,value:e.HostParameterMap.self}]}),e.HostParameterMap.define({type:80,toHost:[{name:e.FileProperties.Handle,value:0},{name:e.additionalParameter.FileSliceOffset,value:1},{name:e.FileProperties.SliceSize,value:2}],fromHost:[{name:e.PropertyDescriptors.FileSliceProperties,value:e.HostParameterMap.self}]}),e.HostParameterMap.define({type:81,toHost:[{name:e.FileProperties.Handle,value:0}]})},defineWebParameterMapFunc:function(){e.HostParameterMap.addComplexType(e.PropertyDescriptors.FileProperties),e.HostParameterMap.addComplexType(e.PropertyDescriptors.FileSliceProperties),e.HostParameterMap.define({type:e.PropertyDescriptors.FileProperties,fromHost:[{name:e.FileProperties.Handle,value:e.Marshaling.File.FilePropertiesKeys.Handle},{name:e.FileProperties.FileSize,value:e.Marshaling.File.FilePropertiesKeys.FileSize}]}),e.HostParameterMap.define({type:e.PropertyDescriptors.FileSliceProperties,fromHost:[{name:e.ParameterNames.Data,value:e.Marshaling.File.SlicePropertiesKeys.Data},{name:e.FileProperties.SliceSize,value:e.Marshaling.File.SlicePropertiesKeys.SliceSize}]}),e.HostParameterMap.define({type:e.ParameterNames.FileType,toHost:[{name:Office.FileType.Text,value:e.Marshaling.File.FileType.Text},{name:Office.FileType.Compressed,value:e.Marshaling.File.FileType.Compressed},{name:Office.FileType.Pdf,value:e.Marshaling.File.FileType.Pdf}]}),e.HostParameterMap.define({type:77,toHost:[{name:e.ParameterNames.FileType,value:e.Marshaling.File.ParameterKeys.FileType},{name:e.ParameterNames.SliceSize,value:e.Marshaling.File.ParameterKeys.SliceSize}],fromHost:[{name:e.PropertyDescriptors.FileProperties,value:e.HostParameterMap.self}]}),e.HostParameterMap.define({type:80,toHost:[{name:e.FileProperties.Handle,value:e.Marshaling.File.ParameterKeys.Handle},{name:e.ParameterNames.SliceIndex,value:e.Marshaling.File.ParameterKeys.SliceIndex}],fromHost:[{name:e.PropertyDescriptors.FileSliceProperties,value:e.HostParameterMap.self}]}),e.HostParameterMap.define({type:81,toHost:[{name:e.FileProperties.Handle,value:e.Marshaling.File.ParameterKeys.Handle}]})}})}(OSF||(OSF={})),function(e){var t=function(e){OSF.OUtil.defineEnumerableProperties(this,{url:{value:e[OSF.FilePropertiesDescriptor.Url]}})};e.FileProperties=t}(OfficeExt||(OfficeExt={})),function(e){e.FilePropertiesDescriptor={Url:"Url"},function(e){e.FilePropertiesDescriptor="FilePropertiesDescriptor"}(e.PropertyDescriptors||(e.PropertyDescriptors={})),function(e){!function(e){e[e.Properties=0]="Properties",e[e.Url=1]="Url"}(e.FilePropertiesKeys||(e.FilePropertiesKeys={}))}(e.Marshaling||(e.Marshaling={})),e.FileProperties||(e.FileProperties={}),e.V10ApiFeatureRegistry.register({defineMethodsFunc:function(){e.AsyncMethodCalls.define({method:e.AsyncMethods.GetFilePropertiesAsync,fromHost:[{name:e.PropertyDescriptors.FilePropertiesDescriptor,value:0}],requiredArguments:[],supportedOptions:[],onSucceeded:function(e,t,n){return new OfficeExt.FileProperties(e)}})},defineSafeArrayParameterMapFunc:function(){e.HostParameterMap.define({type:e.PropertyDescriptors.FilePropertiesDescriptor,fromHost:[{name:e.FilePropertiesDescriptor.Url,value:0}],isComplexType:!0}),e.HostParameterMap.define({type:86,fromHost:[{name:e.PropertyDescriptors.FilePropertiesDescriptor,value:e.HostParameterMap.self}]})},defineWebParameterMapFunc:function(){e.HostParameterMap.addComplexType(e.PropertyDescriptors.FilePropertiesDescriptor),e.HostParameterMap.define({type:e.PropertyDescriptors.FilePropertiesDescriptor,fromHost:[{name:e.FilePropertiesDescriptor.Url,value:e.Marshaling.FilePropertiesKeys.Url}]}),e.HostParameterMap.define({type:86,fromHost:[{name:e.PropertyDescriptors.FilePropertiesDescriptor,value:e.Marshaling.FilePropertiesKeys.Properties}]})},initializeFunc:function(){var t=Office.context.document;e.DispIdHost.addAsyncMethods(t,[e.AsyncMethods.GetFilePropertiesAsync])}})}(OSF||(OSF={})),function(e){var t;e.NestedAppAuth||(e.NestedAppAuth={}),t=function(){function t(){this._events=[]}return t.prototype.postMessage=function(t){var n=this;!function(t,n){var r=e._OfficeAppFactory.getAsyncMethodExecutor(),i={toSafeArrayHost:function(){return[]},fromSafeArrayHost:function(e){return null},toWebHost:function(){return{requestPayload:t}},fromWebHost:function(e){return e.responsePayload}};r.executeAsync(209,i,n)}(t,(function(e){"succeeded"==e.status&&n._events.forEach((function(t){t(e.value)}))}))},t.prototype.addEventListener=function(e,t){"message"===e&&this._events.push(t)},t.prototype.removeEventListener=function(e,t){"message"===e&&(this._events=this._events.filter((function(e){return e!=t})))},t}(),e.V10ApiFeatureRegistry.register({defineMethodsFunc:function(){},initializeFunc:function(){var n=e._OfficeAppFactory.getOfficeAppContext(),r=n.get_nestedAppAuthBridgeType();if(1===r)window.nestedAppAuthBridge=new t;else if(2!==r||window.nestedAppAuthBridge){if(3===r){var i=n.get_topFrameOrigin();e.pairwiseBrokerConfig={enabled:!0,trustedBrokerDomain:i||void 0}}}else{var o=n.get_topFrameOrigin();o&&e._OfficeAppFactory.getInitializationHelper().setCreateNaaBridge((function(){return function(t){return __awaiter(this,void 0,void 0,(function(){var n;return __generator(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),n=e.LoadScriptHelper.getHostBundleJsBasePath()+"webauth/hubsdknaabridge.min.js",[4,e.OUtil.loadScriptPromise(n,e.LoadScriptHelper.getTrustedTypesPolicy())];case 1:return r.sent()&&HubSdkNaaBridge.initializeBridge(t),[3,3];case 2:return r.sent(),[3,3];case 3:return[2]}}))}))}(o)}))}}})}(OSF||(OSF={})),function(e){!function(t){!function(t){t.getAuthContextAsync=function(t){function n(e){var t=e.userObjectId||"",n=e.tenantId||"",r=e.userPrincipalName||"";return{userObjectId:t,tenantId:n,userPrincipalName:r,authorityType:e.authorityType||"",authorityBaseUrl:e.authorityBaseUrl||"",puid:e.puid||"",loginHint:e.loginHint||r}}var r={toSafeArrayHost:function(){return[]},fromSafeArrayHost:function(e){try{return n(JSON.parse(e))}catch(e){return null}},toWebHost:function(){return{}},fromWebHost:function(e){return n(e)}};e._OfficeAppFactory.getAsyncMethodExecutor().executeAsync(205,r,t)}}(t.Auth||(t.Auth={}))}(e.DDA||(e.DDA={}))}(OSF||(OSF={})),function(e){!function(t){t.getAuthContext=function(){return new e.Promise((function(t,n){OSF.DDA.Auth.getAuthContextAsync((function(r){r.status===e.AsyncResultStatus.Succeeded?t(r.value):n(r.error)}))}))}}(e.auth||(e.auth={}))}(Office||(Office={})),function(e){e.select=function(e,t){var n;if(e&&"string"==typeof e){var r=e.indexOf("#");if(-1!=r){var i=e.substring(0,r),o=e.substring(r+1);switch(i){case"binding":case"bindings":o&&(n=new OSF.BindingPromise(o))}}}if(n)return n.onFail=t,n;if(t){var a=typeof t;if("function"!=a)throw OSF.OUtil.formatString(Strings.OfficeOM.L_CallbackNotAFunction,a);var s={};s[OSF.ParameterNames.Callback]=t,OSF.DispIdHost.issueAsyncResult(s,5004,OSF.DDA.ErrorCodeManager.getErrorArgs(5004))}}}(Office||(Office={})),function(e){!function(t){!function(t){function n(t){var n=0;switch(t){case e.CoercionType.Text:n=0;break;case e.CoercionType.Matrix:n=1;break;case e.CoercionType.Table:n=2;break;case e.CoercionType.Html:n=3;break;case e.CoercionType.Ooxml:n=4;break;case e.CoercionType.OoxmlPackage:n=5;break;case e.CoercionType.PdfFile:n=6;break;case e.CoercionType.SlideRange:n=7;break;case"image":n=8;break;case"xmlSvg":n=9}return n}function r(t){var n=0;switch(t){case e.ValueFormat.Unformatted:n=0;break;case e.ValueFormat.Formatted:n=1}return n}function i(t){var n=0;switch(t){case e.FilterType.All:n=0;break;case e.FilterType.OnlyVisible:n=1}return n}t.setSelectedDataAsync=function(t,r,i){var o=null==r.coercionType?OSF.DataCoercion.determineCoercionType(t):r.coercionType;"function"==typeof r&&(i=r);var a={toSafeArrayHost:function(){var i=OSF._OfficeAppFactory.getHostInfo();return i.hostType.toLowerCase()==e.HostType.Word.toLowerCase()||i.hostType.toLowerCase()==e.HostType.PowerPoint.toLowerCase()||i.hostType.toLowerCase()==e.HostType.OneNote.toLowerCase()||i.hostType.toLowerCase()==e.HostType.Visio.toLowerCase()||"image"==o||"xmlSvg"==o?[n(o),OSF.DataCoercion.serializeDynamicData(t),null!=r.imageLeft&&r.imageLeft,null!=r.imageTop&&r.imageTop,null!=r.imageWidth&&r.imageWidth,null!=r.imageHeight&&r.imageHeight]:i.hostType.toLowerCase()==e.HostType.Excel.toLowerCase()?[n(o),OSF.DataCoercion.serializeDynamicData(t),null==r.cellFormat?[]:r.cellFormat,null==r.tableOptions?[]:r.tableOptions,null!=r.imageWidth&&r.imageWidth,null!=r.imageHeight&&r.imageHeight]:[n(o),OSF.DataCoercion.serializeDynamicData(t),null==r.cellFormat?[]:r.cellFormat,null==r.tableOptions?[]:r.tableOptions]},fromSafeArrayHost:function(e){return e},toWebHost:function(){return{DdaSetBindingData:{CoerceType:o,Data:OSF.DataCoercion.serializeDynamicData(t),CellFormat:[],TableOptions:[]}}},fromWebHost:function(e){return e}};OSF._OfficeAppFactory.getAsyncMethodExecutor().executeAsync(65,a,i,null)},t.getSelectedDataAsync=function(t,o,a){var s,c=e.ValueFormat.Unformatted,l=e.FilterType.All;"function"==typeof o?a=o:void 0!==o&&(void 0!==o.valueFormat&&(c=o.valueFormat),void 0!==o.filterType&&(l=o.filterType),void 0!==o.asyncContext&&(s=o.asyncContext));var u={toSafeArrayHost:function(){return[n(t),r(c),i(l)]},fromSafeArrayHost:function(e){return OSF.DataCoercion.deserializeDynamicData(e,t)},toWebHost:function(){return{DdaGetBindingData:{CoerceType:t,ValueFormat:c,FilterType:l}}},fromWebHost:function(e){return OSF.DataCoercion.deserializeDynamicData(e.Data,t)}};OSF._OfficeAppFactory.getAsyncMethodExecutor().executeAsync(64,u,a,s)}}(t.document||(t.document={}))}(e.context||(e.context={}))}(Office||(Office={})),function(e){var t=function(){function e(e,t){this._rows=e,this._header=t}return Object.defineProperty(e.prototype,"headers",{get:function(){return this._header},set:function(e){this._header=this.fixData(e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"rows",{get:function(){return this._rows},set:function(e){this._rows=null==e||OSF.OUtil.isArray(e)&&0==e.length?[]:this.fixData(e)},enumerable:!0,configurable:!0}),e.prototype.fixData=function(e){if(null==e||null==e)return null;try{for(var t=OSF.DataCoercion.findArrayDimensionality(e);t<2;t++)e=[e];return e}catch(e){}},e}();e.TableData=t,e.manufactureTableData=function(t){return new e.TableData(t[OSF.TableDataProperties.TableRows],t[OSF.TableDataProperties.TableHeaders])}}(Office||(Office={})),function(e){e.BootStrapExtension.prepareApiSurface=function(){return new Promise((function(){e.V10ApiFeatureRegistry.initialize()}))}}(OSF||(OSF={})),function(e){!function(t){!function(t){!function(e){e.OfficeThemeChangedEvent="OfficeThemeChangedEvent",e.DocumentThemeChangedEvent="DocumentThemeChangedEvent"}(t.EventDescriptors||(t.EventDescriptors={})),e.V10ApiFeatureRegistry.register({defineMethodsFunc:function(){e.AsyncMethodCalls.define({method:e.AsyncMethods.GetDocumentThemeAsync,requiredArguments:[],supportedOptions:[],privateStateCallbacks:[],onSucceeded:e.DDA.Theming.ConvertToDocumentTheme}),e.AsyncMethodCalls.define({method:e.AsyncMethods.GetOfficeThemeAsync,requiredArguments:[],supportedOptions:[],privateStateCallbacks:[],onSucceeded:e.DDA.Theming.ConvertToOfficeTheme})},defineSafeArrayParameterMapFunc:function(){e.HostParameterMap.define({type:85,fromHost:[{name:e.ParameterNames.OfficeTheme,value:e.HostParameterMap.self}]}),e.HostParameterMap.define({type:e.ParameterNames.OfficeTheme,fromHost:[{name:e.DDA.Theming.OfficeThemeEnum.BodyForegroundColor,value:0},{name:e.DDA.Theming.OfficeThemeEnum.BodyBackgroundColor,value:1},{name:e.DDA.Theming.OfficeThemeEnum.ControlForegroundColor,value:2},{name:e.DDA.Theming.OfficeThemeEnum.ControlBackgroundColor,value:3},{name:e.DDA.Theming.OfficeThemeEnum.ThemeId,value:4},{name:e.DDA.Theming.OfficeThemeEnum.IsDarkTheme,value:5},{name:e.DDA.Theming.OfficeThemeEnum.FluentThemeData,value:6}],isComplexType:!0}),e.HostParameterMap.define({type:e.EventDispId.dispidOfficeThemeChangedEvent,fromHost:[{name:e.DDA.Theming.EventDescriptors.OfficeThemeChangedEvent,value:e.HostParameterMap.self}],isComplexType:!0}),e.HostParameterMap.define({type:e.DDA.Theming.EventDescriptors.OfficeThemeChangedEvent,fromHost:[{name:e.ParameterNames.OfficeTheme,value:e.HostParameterMap.self}],isComplexType:!0})},defineWebParameterMapFunc:function(){e.HostParameterMap.addComplexType(e.ParameterNames.DocumentTheme),e.HostParameterMap.addComplexType(e.ParameterNames.OfficeTheme),e.HostParameterMap.define({type:e.EventDispId.dispidOfficeThemeChangedEvent,fromHost:[{name:e.ParameterNames.OfficeTheme,value:e.HostParameterMap.self}]}),e.HostParameterMap.define({type:e.ParameterNames.OfficeTheme,fromHost:[{name:e.DDA.Theming.OfficeThemeEnum.BodyForegroundColor,value:e.DDA.Theming.OfficeThemeEnumWac.PrimaryFontColor},{name:e.DDA.Theming.OfficeThemeEnum.BodyBackgroundColor,value:e.DDA.Theming.OfficeThemeEnumWac.PrimaryBackgroundColor},{name:e.DDA.Theming.OfficeThemeEnum.ControlForegroundColor,value:e.DDA.Theming.OfficeThemeEnumWac.SecondaryFontColor},{name:e.DDA.Theming.OfficeThemeEnum.ControlBackgroundColor,value:e.DDA.Theming.OfficeThemeEnumWac.SecondaryBackgroundColor}],isComplexType:!0})},initializeFunc:function(){var n=e._OfficeAppFactory.getHostInfo(),r=n.hostType.toLowerCase();if(n.hostPlatform==e.HostInfoPlatform.web&&(r==Office.HostType.Word.toLowerCase()||r==Office.HostType.PowerPoint.toLowerCase())&&Office.context.officeTheme){var i=t.GetIsDarkThemeFromCSSHexColor(Office.context.officeTheme.bodyBackgroundColor);Office.context.officeTheme[e.DDA.Theming.OfficeThemeEnum.IsDarkTheme]=i,Office.context.officeTheme[e.DDA.Theming.OfficeThemeEnum.ThemeId]=i?e.DDA.Theming.ThemeId.Black:e.DDA.Theming.ThemeId.White}Office.context&&Office.context.themeManager&&Office.context.themeManager.InitializeAndChangeOnce()}});var n=function(){function n(){this._eventTarget=null,this._previousDocumentThemeData=null,this._previousOfficeThemeData=null,this._officeCss=null,this._asyncCallsCompleted=null,this._onAsyncCallsCompleted=null}return n.prototype.InitializeThemeManager=function(){this._eventTarget=this,e.DispIdHost.addAsyncMethods(this,[e.AsyncMethods.GetOfficeThemeAsync,e.AsyncMethods.GetDocumentThemeAsync]),e.DispIdHost.addEventSupport(this,new e.EventDispatch([Microsoft.Office.WebExtension.EventType.OfficeThemeChanged,Microsoft.Office.WebExtension.EventType.DocumentThemeChanged]))},n.prototype.InitializeAndChangeOnce=function(t){var n=this;this._officeCss=this._getOfficeThemesCss(),this._officeCss?(this._onAsyncCallsCompleted=t,this._asyncCallsCompleted={},this._asyncCallsCompleted[e.AsyncMethods.GetOfficeThemeAsync]=!1,this._asyncCallsCompleted[e.AsyncMethods.GetDocumentThemeAsync]=!1,this._getAndProcessThemeData(this._eventTarget.getOfficeThemeAsync,(function(e){n._processOfficeThemeData(e)}),e.AsyncMethods.GetOfficeThemeAsync)):t&&t()},n.prototype.isDarkTheme=function(){var e=!1;if(Office.context&&Office.context.officeTheme&&Office.context.officeTheme.bodyBackgroundColor){var n=Office.context.officeTheme.bodyBackgroundColor;e=t.GetIsDarkThemeFromCSSHexColor(n)}return e},n.prototype._getOfficeThemesCss=function(){try{return function(){for(var t="officethemes.css",n=0;n<document.styleSheets.length;n++){var r=document.styleSheets[n];if(!r.disabled&&r.href&&t==r.href.substring(r.href.length-t.length,r.href.length).toLowerCase())return r.cssRules||r.rules?r:(e.AppTelemetry&&e.AppTelemetry.logAppException("Browser styleSheet object does not implement cssRules or rules property. Viloates browser's css access rule"),null)}}()}catch(t){return e.AppTelemetry&&e.AppTelemetry.logAppException("Exception thrown when trying to read officethems.css:["+t+"]"),null}},n.prototype._changeCss=function(e,t,n){for(var r=e.cssRules?e.cssRules.length:e.rules.length,i=0;i<r;i++){var o=(e.cssRules?e.cssRules[i]:e.rules[i]).selectorText;o&&o.toLowerCase()==t.toLowerCase()&&(e.cssRules?(e.deleteRule(i),e.insertRule(o+n,i)):(e.removeRule(i),e.addRule(o,n,i)))}},n.prototype._changeDocumentThemeData=function(t){for(var n=[{name:e.DDA.Theming.DocumentThemeEnum.PrimaryFontColor,cssSelector:".office-docTheme-primary-fontColor",cssProperty:"color"},{name:e.DDA.Theming.DocumentThemeEnum.PrimaryBackgroundColor,cssSelector:".office-docTheme-primary-bgColor",cssProperty:"background-color"},{name:e.DDA.Theming.DocumentThemeEnum.SecondaryFontColor,cssSelector:".office-docTheme-secondary-fontColor",cssProperty:"color"},{name:e.DDA.Theming.DocumentThemeEnum.SecondaryBackgroundColor,cssSelector:".office-docTheme-secondary-bgColor",cssProperty:"background-color"},{name:e.DDA.Theming.DocumentThemeEnum.Accent1,cssSelector:".office-contentAccent1-color",cssProperty:"color"},{name:e.DDA.Theming.DocumentThemeEnum.Accent2,cssSelector:".office-contentAccent2-color",cssProperty:"color"},{name:e.DDA.Theming.DocumentThemeEnum.Accent3,cssSelector:".office-contentAccent3-color",cssProperty:"color"},{name:e.DDA.Theming.DocumentThemeEnum.Accent4,cssSelector:".office-contentAccent4-color",cssProperty:"color"},{name:e.DDA.Theming.DocumentThemeEnum.Accent5,cssSelector:".office-contentAccent5-color",cssProperty:"color"},{name:e.DDA.Theming.DocumentThemeEnum.Accent6,cssSelector:".office-contentAccent6-color",cssProperty:"color"},{name:e.DDA.Theming.DocumentThemeEnum.Accent1,cssSelector:".office-contentAccent1-bgColor",cssProperty:"background-color"},{name:e.DDA.Theming.DocumentThemeEnum.Accent2,cssSelector:".office-contentAccent2-bgColor",cssProperty:"background-color"},{name:e.DDA.Theming.DocumentThemeEnum.Accent3,cssSelector:".office-contentAccent3-bgColor",cssProperty:"background-color"},{name:e.DDA.Theming.DocumentThemeEnum.Accent4,cssSelector:".office-contentAccent4-bgColor",cssProperty:"background-color"},{name:e.DDA.Theming.DocumentThemeEnum.Accent5,cssSelector:".office-contentAccent5-bgColor",cssProperty:"background-color"},{name:e.DDA.Theming.DocumentThemeEnum.Accent6,cssSelector:".office-contentAccent6-bgColor",cssProperty:"background-color"},{name:e.DDA.Theming.DocumentThemeEnum.Accent1,cssSelector:".office-contentAccent1-borderColor",cssProperty:"border-color"},{name:e.DDA.Theming.DocumentThemeEnum.Accent2,cssSelector:".office-contentAccent2-borderColor",cssProperty:"border-color"},{name:e.DDA.Theming.DocumentThemeEnum.Accent3,cssSelector:".office-contentAccent3-borderColor",cssProperty:"border-color"},{name:e.DDA.Theming.DocumentThemeEnum.Accent4,cssSelector:".office-contentAccent4-borderColor",cssProperty:"border-color"},{name:e.DDA.Theming.DocumentThemeEnum.Accent5,cssSelector:".office-contentAccent5-borderColor",cssProperty:"border-color"},{name:e.DDA.Theming.DocumentThemeEnum.Accent6,cssSelector:".office-contentAccent6-borderColor",cssProperty:"border-color"},{name:e.DDA.Theming.DocumentThemeEnum.Hyperlink,cssSelector:".office-a",cssProperty:"color"},{name:e.DDA.Theming.DocumentThemeEnum.FollowedHyperlink,cssSelector:".office-a:visited",cssProperty:"color"},{name:e.DDA.Theming.DocumentThemeEnum.HeaderLatinFont,cssSelector:".office-headerFont-latin",cssProperty:"font-family"},{name:e.DDA.Theming.DocumentThemeEnum.HeaderEastAsianFont,cssSelector:".office-headerFont-eastAsian",cssProperty:"font-family"},{name:e.DDA.Theming.DocumentThemeEnum.HeaderScriptFont,cssSelector:".office-headerFont-script",cssProperty:"font-family"},{name:e.DDA.Theming.DocumentThemeEnum.HeaderLocalizedFont,cssSelector:".office-headerFont-localized",cssProperty:"font-family"},{name:e.DDA.Theming.DocumentThemeEnum.BodyLatinFont,cssSelector:".office-bodyFont-latin",cssProperty:"font-family"},{name:e.DDA.Theming.DocumentThemeEnum.BodyEastAsianFont,cssSelector:".office-bodyFont-eastAsian",cssProperty:"font-family"},{name:e.DDA.Theming.DocumentThemeEnum.BodyScriptFont,cssSelector:".office-bodyFont-script",cssProperty:"font-family"},{name:e.DDA.Theming.DocumentThemeEnum.BodyLocalizedFont,cssSelector:".office-bodyFont-localized",cssProperty:"font-family"}],r=t.type==e.EventType.DocumentThemeChanged?t.documentTheme:t,i=0;i<n.length;i++)if(null===this._previousDocumentThemeData||this._previousDocumentThemeData[n[i].name]!=r[n[i].name])if(null!=r[n[i].name]&&""!=r[n[i].name]){var o=r[n[i].name];"font-family"===n[i].cssProperty&&(o='"'+o.replace(new RegExp('"',"g"),'\\"')+'"'),this._changeCss(this._officeCss,n[i].cssSelector,"{"+n[i].cssProperty+":"+o+";}")}else this._changeCss(this._officeCss,n[i].cssSelector,"{}");this._previousDocumentThemeData=r},n.prototype._changeOfficeThemeData=function(t){for(var n=[{name:e.DDA.Theming.OfficeThemeEnum.BodyForegroundColor,cssSelector:".office-officeTheme-primary-fontColor",cssProperty:"color"},{name:e.DDA.Theming.OfficeThemeEnum.BodyBackgroundColor,cssSelector:".office-officeTheme-primary-bgColor",cssProperty:"background-color"},{name:e.DDA.Theming.OfficeThemeEnum.ControlForegroundColor,cssSelector:".office-officeTheme-secondary-fontColor",cssProperty:"color"},{name:e.DDA.Theming.OfficeThemeEnum.ControlBackgroundColor,cssSelector:".office-officeTheme-secondary-bgColor",cssProperty:"background-color"}],r=t.type==e.EventType.OfficeThemeChanged?t.officeTheme:t,i=0;i<n.length;i++)null!==this._previousOfficeThemeData&&this._previousOfficeThemeData[n[i].name]==r[n[i].name]||void 0!==r[n[i].name]&&this._changeCss(this._officeCss,n[i].cssSelector,"{"+n[i].cssProperty+":"+r[n[i].name]+";}");this._previousOfficeThemeData=r},n.prototype._getAndProcessThemeData=function(t,n,r){var i=this,o=e._OfficeAppFactory.getHostInfo();if(o&&o.hostPlatform==e.HostInfoPlatform.web){if(r==e.AsyncMethods.GetOfficeThemeAsync&&Office.context.officeTheme){var a={};a[e.DDA.Theming.OfficeThemeEnum.BodyBackgroundColor]=Office.context.officeTheme.bodyBackgroundColor,a[e.DDA.Theming.OfficeThemeEnum.BodyForegroundColor]=Office.context.officeTheme.bodyForegroundColor,a[e.DDA.Theming.OfficeThemeEnum.ControlBackgroundColor]=Office.context.officeTheme.controlBackgroundColor,a[e.DDA.Theming.OfficeThemeEnum.ControlForegroundColor]=Office.context.officeTheme.controlForegroundColor,a[e.DDA.Theming.OfficeThemeEnum.IsDarkTheme]=Office.context.officeTheme.isDarkTheme,a[e.DDA.Theming.OfficeThemeEnum.ThemeId]=Office.context.officeTheme.isDarkTheme?e.DDA.Theming.ThemeId.Black:e.DDA.Theming.ThemeId.White,a[e.DDA.Theming.OfficeThemeEnum.FluentThemeData]=Office.context.officeTheme.fluentThemeData,n(a)}}else t((function(e){if("succeeded"==e.status){var t=e.value;n(t)}i._areAllCallsCompleted(r)&&i._onAsyncCallsCompleted&&(i._onAsyncCallsCompleted(),i._onAsyncCallsCompleted=null)}))},n.prototype._processOfficeThemeData=function(e){var t=this;this._changeOfficeThemeData(e),this._eventTarget.addHandlerAsync(Microsoft.Office.WebExtension.EventType.OfficeThemeChanged,(function(e){t._changeOfficeThemeData(e)}),null)},n.prototype._processDocumentThemeData=function(e){var t=this;this._changeDocumentThemeData(e),this._eventTarget.addHandlerAsync(Microsoft.Office.WebExtension.EventType.DocumentThemeChanged,(function(e){t._changeDocumentThemeData(e)}),null)},n.prototype._areAllCallsCompleted=function(e){var t;if(!(t=this._asyncCallsCompleted))return!0;for(var n in e&&t.hasOwnProperty(e)&&(t[e]=!0),t)if(!t.hasOwnProperty(n)||!t[n])return!1;return!0},n}();t.InternalThemeHandler=n}(t.Theming||(t.Theming={}))}(e.DDA||(e.DDA={}))}(OSF||(OSF={})),function(e){!function(e){var t;OSF.definePropertyOnNamespace(e,"themeManager",(function(){return t||(t=new OSF.DDA.Theming.InternalThemeHandler).InitializeThemeManager(),t}))}(e.context||(e.context={}))}(Office||(Office={})),function(e){e.OUtil.setLibraryReleaseVehicle(1),e.LoadScriptHelper.setIsSdx(!0)}(OSF||(OSF={})),function(e){if(!function(){try{return"object"==typeof process&&"[object process]"===String(process)}catch(e){return!1}}()&&!e.isOfficeReactNative()){try{e.Flights=e.OUtil.parseFlights(!0),e.DisabledChangeGates=e.OUtil.parseDisabledChangeGates(!0)}catch(e){}function t(){OSFPerformance.hostSpecificFileName=e.LoadScriptHelper.getHostBundleJsName(),Office.onReadyInternal((function(){OSFPerfUtil.sendPerformanceTelemetry()}))}e._OfficeAppFactory.bootstrap((function(){}),(function(e){e instanceof Error?console.warn(e.message):console.warn(JSON.stringify(e))})),"complete"===document.readyState||"interactive"===document.readyState?t():window.addEventListener("DOMContentLoaded",(function(e){t()}))}}(OSF||(OSF={})),OSFPerformance.hostInitializationEnd=OSFPerformance.now(),OSFPerformance.totalJSHeapSize=OSFPerformance.getTotalJSHeapSize(),OSFPerformance.usedJSHeapSize=OSFPerformance.getUsedJSHeapSize(),OSFPerformance.jsHeapSizeLimit=OSFPerformance.getJSHeapSizeLimit();export{Microsoft,Office,OfficeCore,OfficeExtension,OfficeFirstParty,OfficeFirstPartyAuth,OfficeRuntime,OSF,OTel,oteljs};