/* Copyright (c) Microsoft Corporation. All rights reserved. */ /* Your use of this file is governed by the Microsoft Services Agreement http://go.microsoft.com/fwlink/?LinkId=266419. */ /* * @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 */ // Sources: // osfweb: 16.0\14621.10000 // runtime: 16.0\14621.10000 // core: 16.0\14621.10000 // host: 16.0\14621.10000 "undefined"!==typeof OSFPerformance&&(OSFPerformance.hostInitializationStart=OSFPerformance.now());var OfficeExt,__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(){function e(){}return e.prototype.isMsAjaxLoaded=function(){return!!("undefined"!==typeof Sys&&"undefined"!==typeof Type&&Sys.StringBuilder&&"function"===typeof Sys.StringBuilder&&Type.registerNamespace&&"function"===typeof Type.registerNamespace&&Type.registerClass&&"function"===typeof Type.registerClass&&"function"===typeof Function._validateParams&&Sys.Serialization&&Sys.Serialization.JavaScriptSerializer&&"function"===typeof Sys.Serialization.JavaScriptSerializer.serialize)},e.prototype.loadMsAjaxFull=function(e){var t=("https:"===window.location.protocol.toLowerCase()?"https:":"http:")+"//ajax.aspnetcdn.com/ajax/3.5/MicrosoftAjax.js";OSF.OUtil.loadScript(t,e)},Object.defineProperty(e.prototype,"msAjaxError",{get:function(){return null==this._msAjaxError&&this.isMsAjaxLoaded()&&(this._msAjaxError=Error),this._msAjaxError},set:function(e){this._msAjaxError=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"msAjaxString",{get:function(){return null==this._msAjaxString&&this.isMsAjaxLoaded()&&(this._msAjaxString=String),this._msAjaxString},set:function(e){this._msAjaxString=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"msAjaxDebug",{get:function(){return null==this._msAjaxDebug&&this.isMsAjaxLoaded()&&(this._msAjaxDebug=Sys.Debug),this._msAjaxDebug},set:function(e){this._msAjaxDebug=e},enumerable:!0,configurable:!0}),e}();e.MicrosoftAjaxFactory=t}(OfficeExt||(OfficeExt={}));var OSFLog,Logger,OSFAriaLogger,OSFAppTelemetry,OSFPerfUtil,OSFWebAuth,OSF_DDA_Marshaling_File_FilePropertiesKeys,OSF_DDA_Marshaling_File_SlicePropertiesKeys,OSF_DDA_Marshaling_File_FileType,OSF_DDA_Marshaling_File_ParameterKeys,OSF_DDA_Marshaling_FilePropertiesKeys,OSF_DDA_Marshaling_GoToType,OSF_DDA_Marshaling_SelectionMode,OSF_DDA_Marshaling_TableOptionProperties,OSF_DDA_Marshaling_CellProperties,OSF_DDA_Marshaling_CellFormatProperties,OSF_DDA_Marshaling_BorderStyleType,OSF_DDA_Marshaling_ColorType,OSF_DDA_Marshaling_AlignHorizontalType,OSF_DDA_Marshaling_AlignVerticalType,OSF_DDA_Marshaling_FontStyleType,OSF_DDA_Marshaling_FontUnderlineStyleType,OSF_DDA_Marshaling_FontDirectionType,OSF_DDA_Marshaling_WidthType,OSF_DDA_Marshaling_HeightType,AgaveFormatAPI,OSF_DDA_Marshaling_AppCommand_AppCommandInvokedEventKeys,OSF_DDA_Marshaling_AppCommand_AppCommandCompletedMethodParameterKeys,OsfMsAjaxFactory=new OfficeExt.MicrosoftAjaxFactory,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;r0?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)}return{set_entropy:function(e){if("string"==typeof e)for(var t=0;t6&&t.slice(0,5)===OSF.DDA.SettingsManager.DateJSONPrefix&&t.slice(-1)===OSF.DDA.SettingsManager.DataJSONSuffix&&(n=new Date(parseInt(t.slice(5,-1))))?n:t})):Sys.Serialization.JavaScriptSerializer.deserialize(r,!0),t[n]=r}catch(e){}}return t},loadScript:function(e,t,r){if(e&&t){var i=window.document,o=n[e];if(o)o.loaded?t():o.pendingCallbacks.push(t);else{var a=i.createElement("script");a.type="text/javascript",o={loaded:!1,pendingCallbacks:[t],timer:null},n[e]=o;var s=function(){null!=o.timer&&(clearTimeout(o.timer),delete o.timer),o.loaded=!0;for(var e=o.pendingCallbacks.length,t=0;t0?l(null):l(new Event("Script load timed out"))}),r),a.setAttribute("crossOrigin","anonymous"),a.src=e,i.getElementsByTagName("head")[0].appendChild(a)}}},loadCSS:function(e){if(e){var t=window.document,n=t.createElement("link");n.type="text/css",n.rel="stylesheet",n.href=e,t.getElementsByTagName("head")[0].appendChild(n)}},parseEnum:function(e,t){var n=t[e.trim()];if("undefined"==typeof n)throw OsfMsAjaxFactory.msAjaxDebug.trace("invalid enumeration string:"+e),OsfMsAjaxFactory.msAjaxError.argument("str");return n},delayExecutionAndCache:function(){var e={calc:arguments[0]};return function(){return e.calc&&(e.val=e.calc.apply(this,arguments),delete e.calc),e.val}},getUniqueId:function(){return(e+=1).toString()},formatString:function(){var e=arguments,t=e[0];return t.replace(/{(\d+)}/gm,(function(t,n){var r=parseInt(n,10)+1;return void 0===e[r]?"{"+n+"}":e[r]}))},generateConversationId:function(){return[a(),a(),(new Date).getTime().toString()].join("_")},getFrameName:function(e){return"_xdm_"+e+this.generateConversationId()},addXdmInfoAsHash:function(e,t){return OSF.OUtil.addInfoAsHash(e,"&_xdm_Info=",t,!1)},addSerializerVersionAsHash:function(e,t){return OSF.OUtil.addInfoAsHash(e,"&_serializer_version=",t,!0)},addFlightsAsHash:function(e,t){return OSF.OUtil.addInfoAsHash(e,"&_flights=",t,!0)},addInfoAsHash:function(e,n,r,i){var o,a=(e=e.trim()||"").split(t),s=a.shift(),l=a.join(t);return o=i?[n,encodeURIComponent(r),l].join(""):[l,n,r].join(""),[s,t,o].join("")},parseHostInfoFromWindowName:function(e,t){return OSF.OUtil.parseInfoFromWindowName(e,t,OSF.WindowNameItemKeys.HostInfo)},parseXdmInfo:function(e){var t=OSF.OUtil.parseXdmInfoWithGivenFragment(e,window.location.hash);return t||(t=OSF.OUtil.parseXdmInfoFromWindowName(e,window.name)),t},parseXdmInfoFromWindowName:function(e,t){return OSF.OUtil.parseInfoFromWindowName(e,t,OSF.WindowNameItemKeys.XdmInfo)},parseXdmInfoWithGivenFragment:function(e,t){return OSF.OUtil.parseInfoWithGivenFragment("&_xdm_Info=","_xdm_",!1,e,t)},parseSerializerVersion:function(e){var t=OSF.OUtil.parseSerializerVersionWithGivenFragment(e,window.location.hash);return isNaN(t)&&(t=OSF.OUtil.parseSerializerVersionFromWindowName(e,window.name)),t},parseSerializerVersionFromWindowName:function(e,t){return parseInt(OSF.OUtil.parseInfoFromWindowName(e,t,OSF.WindowNameItemKeys.SerializerVersion))},parseSerializerVersionWithGivenFragment:function(e,t){return parseInt(OSF.OUtil.parseInfoWithGivenFragment("&_serializer_version=","_serializer_version=",!0,e,t))},parseFlights:function(e){var t=OSF.OUtil.parseFlightsWithGivenFragment(e,window.location.hash);return 0==t.length&&(t=OSF.OUtil.parseFlightsFromWindowName(e,window.name)),t},checkFlight:function(e){return OSF.Flights&&OSF.Flights.indexOf(e)>=0},pushFlight:function(e){return OSF.Flights.indexOf(e)<0&&(OSF.Flights.push(e),!0)},getBooleanSetting:function(e){return OSF.OUtil.getBooleanFromDictionary(OSF.Settings,e)},getBooleanFromDictionary:function(e,t){var n=e&&t&&void 0!==e[t]&&e[t]&&("string"===typeof e[t]&&"TRUE"===e[t].toUpperCase()||"boolean"===typeof e[t]&&e[t]);return void 0!==n&&n},parseFlightsFromWindowName:function(e,t){return OSF.OUtil.parseArrayWithDefault(OSF.OUtil.parseInfoFromWindowName(e,t,OSF.WindowNameItemKeys.Flights))},parseFlightsWithGivenFragment:function(e,t){return OSF.OUtil.parseArrayWithDefault(OSF.OUtil.parseInfoWithGivenFragment("&_flights=","_flights=",!0,e,t))},parseArrayWithDefault:function(e){var t=[];try{t=JSON.parse(e)}catch(e){}return Array.isArray(t)||(t=[]),t},parseInfoFromWindowName:function(e,t,n){try{var r=JSON.parse(t),i=null!=r?r[n]:null,o=s();if(!e&&o&&null!=r){var a=r[OSF.WindowNameItemKeys.BaseFrameName]+n;i?o.setItem(a,i):i=o.getItem(a)}return i}catch(e){return null}},parseInfoWithGivenFragment:function(e,t,n,r,i){var o=i.split(e),a=o.length>1?o[o.length-1]:null;n&&null!=a&&(a.indexOf("&")>=0&&(a=a.split("&")[0]),a=decodeURIComponent(a));var l=s();if(!r&&l){var u=window.name.indexOf(t);if(u>-1){var c=window.name.indexOf(";",u);-1==c&&(c=window.name.length);var p=window.name.substring(u,c);a?l.setItem(p,a):a=l.getItem(p)}}return a},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},getInfoItems:function(e){var t=e.split("$");return"undefined"==typeof t[1]&&(t=e.split("|")),"undefined"==typeof t[1]&&(t=e.split("%7C")),t},getXdmFieldValue:function(e,t){var n="",r=OSF.OUtil.parseXdmInfo(t);if(r){var i=OSF.OUtil.getInfoItems(r);if(void 0!=i&&i.length>=3)switch(e){case OSF.XdmFieldName.ConversationUrl:n=i[2];break;case OSF.XdmFieldName.AppId:n=i[1]}}return n},validateParamObject:function(e,t,n){var r=Function._validateParams(arguments,[{name:"params",type:Object,mayBeNull:!1},{name:"expectedProperties",type:Object,mayBeNull:!1},{name:"callback",type:Function,mayBeNull:!0}]);if(r)throw r;for(var i in t)if(r=Function._validateParameter(e[i],t[i],i))throw r},writeProfilerMark:function(e){window.msWriteProfilerMark&&(window.msWriteProfilerMark(e),OsfMsAjaxFactory.msAjaxDebug.trace(e))},outputDebug:function(e){"undefined"!==typeof OsfMsAjaxFactory&&OsfMsAjaxFactory.msAjaxDebug&&OsfMsAjaxFactory.msAjaxDebug.trace&&OsfMsAjaxFactory.msAjaxDebug.trace(e)},defineNondefaultProperty:function(e,t,n,r){for(var i in n=n||{},r){var o=r[i];void 0==n[o]&&(n[o]=!0)}return Object.defineProperty(e,t,n),e},defineNondefaultProperties:function(e,t,n){for(var r in t=t||{})OSF.OUtil.defineNondefaultProperty(e,r,t[r],n);return e},defineEnumerableProperty:function(e,t,n){return OSF.OUtil.defineNondefaultProperty(e,t,n,["enumerable"])},defineEnumerableProperties:function(e,t){return OSF.OUtil.defineNondefaultProperties(e,t,["enumerable"])},defineMutableProperty:function(e,t,n){return OSF.OUtil.defineNondefaultProperty(e,t,n,["writable","enumerable","configurable"])},defineMutableProperties:function(e,t){return OSF.OUtil.defineNondefaultProperties(e,t,["writable","enumerable","configurable"])},finalizeProperties:function(e,t){t=t||{};for(var n=Object.getOwnPropertyNames(e),r=n.length,i=0;i>8,a=255&n,c[s++]=i>>2,c[s++]=(3&i)<<4|o>>4,c[s++]=(15&o)<<2|a>>6,c[s++]=63&a,isNaN(n)||(i=n>>8,o=255&r,a=r>>8,c[s++]=i>>2,c[s++]=(3&i)<<4|o>>4,c[s++]=(15&o)<<2|a>>6,c[s++]=63&a),isNaN(n)?c[s-1]=64:isNaN(r)&&(c[s-2]=64,c[s-1]=64);for(var f=0;f=2?n[r-2]+"."+n[r-1]:1==r?n[0]:void 0},isiOS:function(){return!!window.navigator.userAgent.match(/(iPad|iPhone|iPod)/g)},isChrome:function(){return window.navigator.userAgent.indexOf("Chrome")>0&&!OSF.OUtil.isEdge()},isEdge:function(){return window.navigator.userAgent.indexOf("Edge")>0},isIE:function(){return window.navigator.userAgent.indexOf("Trident")>0},isFirefox:function(){return window.navigator.userAgent.indexOf("Firefox")>0},startsWith:function(e,t,n){return n?e.substr(0,t.length)===t:e.startsWith(t)},containsPort:function(e,t,n,r){return this.startsWith(e,t+"//"+n+":"+r,!0)||this.startsWith(e,n+":"+r,!0)},getRedundandPortString:function(e,t){return e&&t?"https:"==t.protocol&&this.containsPort(e,"https:",t.hostname,"443")?":443":"http:"==t.protocol&&this.containsPort(e,"http:",t.hostname,"80")?":80":"":""},removeChar:function(e,t){return t=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},cleanUrl:function(e){if(e=this.cleanUrlOfChar(e,"/"),e=this.cleanUrlOfChar(e,"?"),"https://"==(e=this.cleanUrlOfChar(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},parseUrl:function(e,t){if(void 0===t&&(t=!1),"undefined"!==typeof e&&e){var n=this.isIE(),r={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(n){var i=document.createElement("a");if(i.href=e,!i||!i.protocol||!i.host||!i.hostname||!i.href||this.cleanUrl(i.href).toLowerCase()!==this.cleanUrl(e).toLowerCase())throw"InvalidUrl";if(OSF.OUtil.checkFlight(OSF.FlightNames.AddinEnforceHttps)&&t&&"https:"!=i.protocol)throw new Error("NotHttps");var o=this.getRedundandPortString(e,i);r.protocol=i.protocol,r.hostname=i.hostname,r.port=""==o?i.port:"",r.host=""!=o?i.hostname:i.host,r.pathname=(n?"/":"")+i.pathname,r.search=i.search,r.hash=i.hash,r.isPortPartOfUrl=this.containsPort(e,i.protocol,i.hostname,i.port)}else{var a=new URL(e);if(a&&a.protocol&&a.host&&a.hostname){if(OSF.OUtil.checkFlight(OSF.FlightNames.AddinEnforceHttps)&&t&&"https:"!=a.protocol)throw new Error("NotHttps");r.protocol=a.protocol,r.hostname=a.hostname,r.port=a.port,r.host=a.host,r.pathname=a.pathname,r.search=a.search,r.hash=a.hash,r.isPortPartOfUrl=a.host.lastIndexOf(":"+a.port)==a.host.length-a.port.length-1}}}catch(e){if("NotHttps"===e.message)throw e}return r}},shallowCopy:function(e){if(null==e)return null;if(e instanceof Object){if(Array.isArray(e)){for(var t=[],n=0;ne||0===t&&n?-1:t!==e-1||n?n?t-1:t+1:-1};if(e=l(e),n=t?e.length-1:0,0===e.length)return null;for(;!i&&n>=0&&ne||0===t&&n?-1:t!==e-1||n?n?t-1:t+1:-1};if(r=function(e,t){for(var n=0;n=0&&ie.length)return!1;if(e.substr(e.length-t.length)===t)return!0}return!1},hashCode:function(e){var t=0;if(!OSF.OUtil.isNullOrUndefined(e))for(var n=0,r=e.length;n0;r++)8!=r&&12!=r&&16!=r&&20!=r||(t+="-"),t+=e[n%16],n=Math.floor(n/16);for(;r<32;r++)8!=r&&12!=r&&16!=r&&20!=r||(t+="-"),t+=e[Math.floor(16*Math.random())];return t}}}();try{!function(){OSF.Flights=OSF.OUtil.parseFlights(!0)}()}catch(e){}window.OSF=OSF,OSF.OUtil.setNamespace("OSF",window),OSF.MessageIDs={FetchBundleUrl:0,LoadReactBundle:1,LoadBundleSuccess:2,LoadBundleError:3},OSF.AppName={Unsupported:0,Excel:1,Word:2,PowerPoint:4,Outlook:8,ExcelWebApp:16,WordWebApp:32,OutlookWebApp:64,Project:128,AccessWebApp:256,PowerpointWebApp:512,ExcelIOS:1024,Sway:2048,WordIOS:4096,PowerPointIOS:8192,Access:16384,Lync:32768,OutlookIOS:65536,OneNoteWebApp:131072,OneNote:262144,ExcelWinRT:524288,WordWinRT:1048576,PowerpointWinRT:2097152,OutlookAndroid:4194304,OneNoteWinRT:8388608,ExcelAndroid:8388609,VisioWebApp:8388610,OneNoteIOS:8388611,WordAndroid:8388613,PowerpointAndroid:8388614,Visio:8388615,OneNoteAndroid:4194305},OSF.InternalPerfMarker={DataCoercionBegin:"Agave.HostCall.CoerceDataStart",DataCoercionEnd:"Agave.HostCall.CoerceDataEnd"},OSF.HostCallPerfMarker={IssueCall:"Agave.HostCall.IssueCall",ReceiveResponse:"Agave.HostCall.ReceiveResponse",RuntimeExceptionRaised:"Agave.HostCall.RuntimeExecptionRaised"},OSF.AgaveHostAction={Select:0,UnSelect:1,CancelDialog:2,InsertAgave:3,CtrlF6In:4,CtrlF6Exit:5,CtrlF6ExitShift:6,SelectWithError:7,NotifyHostError:8,RefreshAddinCommands:9,PageIsReady:10,TabIn:11,TabInShift:12,TabExit:13,TabExitShift:14,EscExit:15,F2Exit:16,ExitNoFocusable:17,ExitNoFocusableShift:18,MouseEnter:19,MouseLeave:20,UpdateTargetUrl:21,InstallCustomFunctions:22,SendTelemetryEvent:23,UninstallCustomFunctions:24,SendMessage:25,LaunchExtensionComponent:26,StopExtensionComponent:27,RestartExtensionComponent:28,EnableTaskPaneHeaderButton:29,DisableTaskPaneHeaderButton:30,TaskPaneHeaderButtonClicked:31,RemoveAppCommandsAddin:32,RefreshRibbonGallery:33,GetOriginalControlId:34,OfficeJsReady:35,InsertDevManifest:36,InsertDevManifestError:37,SendCustomerContent:38,KeyboardShortcuts:39},OSF.SharedConstants={NotificationConversationIdSuffix:"_ntf"},OSF.DialogMessageType={DialogMessageReceived:0,DialogParentMessageReceived:1,DialogClosed:12006},OSF.OfficeAppContext=function(e,t,n,r,i,o,a,s,l,u,c,p,h,f,d,m,y,g,_,b,O,v,S,C,A,P,F){this._id=e,this._appName=t,this._appVersion=n,this._appUILocale=r,this._dataLocale=i,this._docUrl=o,this._clientMode=a,this._settings=s,this._reason=l,this._osfControlType=u,this._eToken=c,this._correlationId=p,this._appInstanceId=h,this._touchEnabled=f,this._commerceAllowed=d,this._appMinorVersion=m,this._requirementMatrix=y,this._hostCustomMessage=g,this._hostFullVersion=_,this._isDialog=!1,this._clientWindowHeight=b,this._clientWindowWidth=O,this._addinName=v,this._appDomains=S,this._dialogRequirementMatrix=C,this._featureGates=A,this._officeTheme=P,this._initialDisplayMode=F,this.get_id=function(){return this._id},this.get_appName=function(){return this._appName},this.get_appVersion=function(){return this._appVersion},this.get_appUILocale=function(){return this._appUILocale},this.get_dataLocale=function(){return this._dataLocale},this.get_docUrl=function(){return this._docUrl},this.get_clientMode=function(){return this._clientMode},this.get_bindings=function(){return this._bindings},this.get_settings=function(){return this._settings},this.get_reason=function(){return this._reason},this.get_osfControlType=function(){return this._osfControlType},this.get_eToken=function(){return this._eToken},this.get_correlationId=function(){return this._correlationId},this.get_appInstanceId=function(){return this._appInstanceId},this.get_touchEnabled=function(){return this._touchEnabled},this.get_commerceAllowed=function(){return this._commerceAllowed},this.get_appMinorVersion=function(){return this._appMinorVersion},this.get_requirementMatrix=function(){return this._requirementMatrix},this.get_dialogRequirementMatrix=function(){return this._dialogRequirementMatrix},this.get_hostCustomMessage=function(){return this._hostCustomMessage},this.get_hostFullVersion=function(){return this._hostFullVersion},this.get_isDialog=function(){return this._isDialog},this.get_clientWindowHeight=function(){return this._clientWindowHeight},this.get_clientWindowWidth=function(){return this._clientWindowWidth},this.get_addinName=function(){return this._addinName},this.get_appDomains=function(){return this._appDomains},this.get_featureGates=function(){return this._featureGates},this.get_officeTheme=function(){return this._officeTheme},this.get_initialDisplayMode=function(){return this._initialDisplayMode?this._initialDisplayMode:0}},OSF.OsfControlType={DocumentLevel:0,ContainerLevel:1},OSF.ClientMode={ReadOnly:0,ReadWrite:1},OSF.OUtil.setNamespace("Microsoft",window),OSF.OUtil.setNamespace("Office",Microsoft),OSF.OUtil.setNamespace("Client",Microsoft.Office),OSF.OUtil.setNamespace("WebExtension",Microsoft.Office),Microsoft.Office.WebExtension.InitializationReason={Inserted:"inserted",DocumentOpened:"documentOpened",ControlActivation:"controlActivation"},Microsoft.Office.WebExtension.ValueFormat={Unformatted:"unformatted",Formatted:"formatted"},Microsoft.Office.WebExtension.FilterType={All:"all"},Microsoft.Office.WebExtension.Parameters={BindingType:"bindingType",CoercionType:"coercionType",ValueFormat:"valueFormat",FilterType:"filterType",Columns:"columns",SampleData:"sampleData",GoToType:"goToType",SelectionMode:"selectionMode",Id:"id",PromptText:"promptText",ItemName:"itemName",FailOnCollision:"failOnCollision",StartRow:"startRow",StartColumn:"startColumn",RowCount:"rowCount",ColumnCount:"columnCount",Callback:"callback",AsyncContext:"asyncContext",Data:"data",Rows:"rows",OverwriteIfStale:"overwriteIfStale",FileType:"fileType",EventType:"eventType",Handler:"handler",SliceSize:"sliceSize",SliceIndex:"sliceIndex",ActiveView:"activeView",Status:"status",PlatformType:"platformType",HostType:"hostType",ForceConsent:"forceConsent",ForceAddAccount:"forceAddAccount",AuthChallenge:"authChallenge",AllowConsentPrompt:"allowConsentPrompt",ForMSGraphAccess:"forMSGraphAccess",AllowSignInPrompt:"allowSignInPrompt",JsonPayload:"jsonPayload",EnableNewHosts:"enableNewHosts",AccountTypeFilter:"accountTypeFilter",AddinTrustId:"addinTrustId",Reserved:"reserved",Tcid:"tcid",Xml:"xml",Namespace:"namespace",Prefix:"prefix",XPath:"xPath",Text:"text",ImageLeft:"imageLeft",ImageTop:"imageTop",ImageWidth:"imageWidth",ImageHeight:"imageHeight",TaskId:"taskId",FieldId:"fieldId",FieldValue:"fieldValue",ServerUrl:"serverUrl",ListName:"listName",ResourceId:"resourceId",ViewType:"viewType",ViewName:"viewName",GetRawValue:"getRawValue",CellFormat:"cellFormat",TableOptions:"tableOptions",TaskIndex:"taskIndex",ResourceIndex:"resourceIndex",CustomFieldId:"customFieldId",Url:"url",MessageHandler:"messageHandler",Width:"width",Height:"height",RequireHTTPs:"requireHTTPS",MessageToParent:"messageToParent",DisplayInIframe:"displayInIframe",MessageContent:"messageContent",HideTitle:"hideTitle",UseDeviceIndependentPixels:"useDeviceIndependentPixels",PromptBeforeOpen:"promptBeforeOpen",EnforceAppDomain:"enforceAppDomain",UrlNoHostInfo:"urlNoHostInfo",TargetOrigin:"targetOrigin",AppCommandInvocationCompletedData:"appCommandInvocationCompletedData",Base64:"base64",FormId:"formId"},OSF.OUtil.setNamespace("DDA",OSF),OSF.DDA.DocumentMode={ReadOnly:1,ReadWrite:0},OSF.DDA.PropertyDescriptors={AsyncResultStatus:"AsyncResultStatus"},OSF.DDA.EventDescriptors={},OSF.DDA.ListDescriptors={},OSF.DDA.UI={},OSF.DDA.getXdmEventName=function(e,t){return t==Microsoft.Office.WebExtension.EventType.BindingSelectionChanged||t==Microsoft.Office.WebExtension.EventType.BindingDataChanged||t==Microsoft.Office.WebExtension.EventType.DataNodeDeleted||t==Microsoft.Office.WebExtension.EventType.DataNodeInserted||t==Microsoft.Office.WebExtension.EventType.DataNodeReplaced?e+"_"+t:t},OSF.DDA.MethodDispId={dispidMethodMin:64,dispidGetSelectedDataMethod:64,dispidSetSelectedDataMethod:65,dispidAddBindingFromSelectionMethod:66,dispidAddBindingFromPromptMethod:67,dispidGetBindingMethod:68,dispidReleaseBindingMethod:69,dispidGetBindingDataMethod:70,dispidSetBindingDataMethod:71,dispidAddRowsMethod:72,dispidClearAllRowsMethod:73,dispidGetAllBindingsMethod:74,dispidLoadSettingsMethod:75,dispidSaveSettingsMethod:76,dispidGetDocumentCopyMethod:77,dispidAddBindingFromNamedItemMethod:78,dispidAddColumnsMethod:79,dispidGetDocumentCopyChunkMethod:80,dispidReleaseDocumentCopyMethod:81,dispidNavigateToMethod:82,dispidGetActiveViewMethod:83,dispidGetDocumentThemeMethod:84,dispidGetOfficeThemeMethod:85,dispidGetFilePropertiesMethod:86,dispidClearFormatsMethod:87,dispidSetTableOptionsMethod:88,dispidSetFormatsMethod:89,dispidExecuteRichApiRequestMethod:93,dispidAppCommandInvocationCompletedMethod:94,dispidCloseContainerMethod:97,dispidGetAccessTokenMethod:98,dispidGetAuthContextMethod:99,dispidOpenBrowserWindow:102,dispidCreateDocumentMethod:105,dispidInsertFormMethod:106,dispidDisplayRibbonCalloutAsyncMethod:109,dispidGetSelectedTaskMethod:110,dispidGetSelectedResourceMethod:111,dispidGetTaskMethod:112,dispidGetResourceFieldMethod:113,dispidGetWSSUrlMethod:114,dispidGetTaskFieldMethod:115,dispidGetProjectFieldMethod:116,dispidGetSelectedViewMethod:117,dispidGetTaskByIndexMethod:118,dispidGetResourceByIndexMethod:119,dispidSetTaskFieldMethod:120,dispidSetResourceFieldMethod:121,dispidGetMaxTaskIndexMethod:122,dispidGetMaxResourceIndexMethod:123,dispidCreateTaskMethod:124,dispidAddDataPartMethod:128,dispidGetDataPartByIdMethod:129,dispidGetDataPartsByNamespaceMethod:130,dispidGetDataPartXmlMethod:131,dispidGetDataPartNodesMethod:132,dispidDeleteDataPartMethod:133,dispidGetDataNodeValueMethod:134,dispidGetDataNodeXmlMethod:135,dispidGetDataNodesMethod:136,dispidSetDataNodeValueMethod:137,dispidSetDataNodeXmlMethod:138,dispidAddDataNamespaceMethod:139,dispidGetDataUriByPrefixMethod:140,dispidGetDataPrefixByUriMethod:141,dispidGetDataNodeTextMethod:142,dispidSetDataNodeTextMethod:143,dispidMessageParentMethod:144,dispidSendMessageMethod:145,dispidExecuteFeature:146,dispidQueryFeature:147,dispidMethodMax:147},OSF.DDA.EventDispId={dispidEventMin:0,dispidInitializeEvent:0,dispidSettingsChangedEvent:1,dispidDocumentSelectionChangedEvent:2,dispidBindingSelectionChangedEvent:3,dispidBindingDataChangedEvent:4,dispidDocumentOpenEvent:5,dispidDocumentCloseEvent:6,dispidActiveViewChangedEvent:7,dispidDocumentThemeChangedEvent:8,dispidOfficeThemeChangedEvent:9,dispidDialogMessageReceivedEvent:10,dispidDialogNotificationShownInAddinEvent:11,dispidDialogParentMessageReceivedEvent:12,dispidObjectDeletedEvent:13,dispidObjectSelectionChangedEvent:14,dispidObjectDataChangedEvent:15,dispidContentControlAddedEvent:16,dispidActivationStatusChangedEvent:32,dispidRichApiMessageEvent:33,dispidAppCommandInvokedEvent:39,dispidOlkItemSelectedChangedEvent:46,dispidOlkRecipientsChangedEvent:47,dispidOlkAppointmentTimeChangedEvent:48,dispidOlkRecurrenceChangedEvent:49,dispidOlkAttachmentsChangedEvent:50,dispidOlkEnhancedLocationsChangedEvent:51,dispidOlkInfobarClickedEvent:52,dispidTaskSelectionChangedEvent:56,dispidResourceSelectionChangedEvent:57,dispidViewSelectionChangedEvent:58,dispidDataNodeAddedEvent:60,dispidDataNodeReplacedEvent:61,dispidDataNodeDeletedEvent:62,dispidEventMax:63},OSF.DDA.ErrorCodeManager=function(){var e={};return{getErrorArgs:function(t){var n=e[t];return n?(n.name||(n.name=e[this.errorCodes.ooeInternalError].name),n.message||(n.message=e[this.errorCodes.ooeInternalError].message)):n=e[this.errorCodes.ooeInternalError],n},addErrorMessage:function(t,n){e[t]=n},errorCodes:{ooeSuccess:0,ooeChunkResult:1,ooeCoercionTypeNotSupported:1e3,ooeGetSelectionNotMatchDataType:1001,ooeCoercionTypeNotMatchBinding:1002,ooeInvalidGetRowColumnCounts:1003,ooeSelectionNotSupportCoercionType:1004,ooeInvalidGetStartRowColumn:1005,ooeNonUniformPartialGetNotSupported:1006,ooeGetDataIsTooLarge:1008,ooeFileTypeNotSupported:1009,ooeGetDataParametersConflict:1010,ooeInvalidGetColumns:1011,ooeInvalidGetRows:1012,ooeInvalidReadForBlankRow:1013,ooeUnsupportedDataObject:2e3,ooeCannotWriteToSelection:2001,ooeDataNotMatchSelection:2002,ooeOverwriteWorksheetData:2003,ooeDataNotMatchBindingSize:2004,ooeInvalidSetStartRowColumn:2005,ooeInvalidDataFormat:2006,ooeDataNotMatchCoercionType:2007,ooeDataNotMatchBindingType:2008,ooeSetDataIsTooLarge:2009,ooeNonUniformPartialSetNotSupported:2010,ooeInvalidSetColumns:2011,ooeInvalidSetRows:2012,ooeSetDataParametersConflict:2013,ooeCellDataAmountBeyondLimits:2014,ooeSelectionCannotBound:3e3,ooeBindingNotExist:3002,ooeBindingToMultipleSelection:3003,ooeInvalidSelectionForBindingType:3004,ooeOperationNotSupportedOnThisBindingType:3005,ooeNamedItemNotFound:3006,ooeMultipleNamedItemFound:3007,ooeInvalidNamedItemForBindingType:3008,ooeUnknownBindingType:3009,ooeOperationNotSupportedOnMatrixData:3010,ooeInvalidColumnsForBinding:3011,ooeSettingNameNotExist:4e3,ooeSettingsCannotSave:4001,ooeSettingsAreStale:4002,ooeOperationNotSupported:5e3,ooeInternalError:5001,ooeDocumentReadOnly:5002,ooeEventHandlerNotExist:5003,ooeInvalidApiCallInContext:5004,ooeShuttingDown:5005,ooeUnsupportedEnumeration:5007,ooeIndexOutOfRange:5008,ooeBrowserAPINotSupported:5009,ooeInvalidParam:5010,ooeRequestTimeout:5011,ooeInvalidOrTimedOutSession:5012,ooeInvalidApiArguments:5013,ooeOperationCancelled:5014,ooeWorkbookHidden:5015,ooeWriteNotSupportedWhenModalDialogOpen:5016,ooeTooManyIncompleteRequests:5100,ooeRequestTokenUnavailable:5101,ooeActivityLimitReached:5102,ooeRequestPayloadSizeLimitExceeded:5103,ooeResponsePayloadSizeLimitExceeded:5104,ooeCustomXmlNodeNotFound:6e3,ooeCustomXmlError:6100,ooeCustomXmlExceedQuota:6101,ooeCustomXmlOutOfDate:6102,ooeNoCapability:7e3,ooeCannotNavTo:7001,ooeSpecifiedIdNotExist:7002,ooeNavOutOfBound:7004,ooeElementMissing:8e3,ooeProtectedError:8001,ooeInvalidCellsValue:8010,ooeInvalidTableOptionValue:8011,ooeInvalidFormatValue:8012,ooeRowIndexOutOfRange:8020,ooeColIndexOutOfRange:8021,ooeFormatValueOutOfRange:8022,ooeCellFormatAmountBeyondLimits:8023,ooeMemoryFileLimit:11e3,ooeNetworkProblemRetrieveFile:11001,ooeInvalidSliceSize:11002,ooeInvalidCallback:11101,ooeInvalidWidth:12e3,ooeInvalidHeight:12001,ooeNavigationError:12002,ooeInvalidScheme:12003,ooeAppDomains:12004,ooeRequireHTTPS:12005,ooeWebDialogClosed:12006,ooeDialogAlreadyOpened:12007,ooeEndUserAllow:12008,ooeEndUserIgnore:12009,ooeNotUILessDialog:12010,ooeCrossZone:12011,ooeNotSSOAgave:13e3,ooeSSOUserNotSignedIn:13001,ooeSSOUserAborted:13002,ooeSSOUnsupportedUserIdentity:13003,ooeSSOInvalidResourceUrl:13004,ooeSSOInvalidGrant:13005,ooeSSOClientError:13006,ooeSSOServerError:13007,ooeAddinIsAlreadyRequestingToken:13008,ooeSSOUserConsentNotSupportedByCurrentAddinCategory:13009,ooeSSOConnectionLost:13010,ooeResourceNotAllowed:13011,ooeSSOUnsupportedPlatform:13012,ooeSSOCallThrottled:13013,ooeAccessDenied:13990,ooeGeneralException:13991},initializeErrorMessages:function(t){e[OSF.DDA.ErrorCodeManager.errorCodes.ooeCoercionTypeNotSupported]={name:t.L_InvalidCoercion,message:t.L_CoercionTypeNotSupported},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeGetSelectionNotMatchDataType]={name:t.L_DataReadError,message:t.L_GetSelectionNotSupported},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeCoercionTypeNotMatchBinding]={name:t.L_InvalidCoercion,message:t.L_CoercionTypeNotMatchBinding},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidGetRowColumnCounts]={name:t.L_DataReadError,message:t.L_InvalidGetRowColumnCounts},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeSelectionNotSupportCoercionType]={name:t.L_DataReadError,message:t.L_SelectionNotSupportCoercionType},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidGetStartRowColumn]={name:t.L_DataReadError,message:t.L_InvalidGetStartRowColumn},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeNonUniformPartialGetNotSupported]={name:t.L_DataReadError,message:t.L_NonUniformPartialGetNotSupported},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeGetDataIsTooLarge]={name:t.L_DataReadError,message:t.L_GetDataIsTooLarge},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeFileTypeNotSupported]={name:t.L_DataReadError,message:t.L_FileTypeNotSupported},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeGetDataParametersConflict]={name:t.L_DataReadError,message:t.L_GetDataParametersConflict},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidGetColumns]={name:t.L_DataReadError,message:t.L_InvalidGetColumns},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidGetRows]={name:t.L_DataReadError,message:t.L_InvalidGetRows},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidReadForBlankRow]={name:t.L_DataReadError,message:t.L_InvalidReadForBlankRow},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeUnsupportedDataObject]={name:t.L_DataWriteError,message:t.L_UnsupportedDataObject},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeCannotWriteToSelection]={name:t.L_DataWriteError,message:t.L_CannotWriteToSelection},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeDataNotMatchSelection]={name:t.L_DataWriteError,message:t.L_DataNotMatchSelection},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeOverwriteWorksheetData]={name:t.L_DataWriteError,message:t.L_OverwriteWorksheetData},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeDataNotMatchBindingSize]={name:t.L_DataWriteError,message:t.L_DataNotMatchBindingSize},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSetStartRowColumn]={name:t.L_DataWriteError,message:t.L_InvalidSetStartRowColumn},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidDataFormat]={name:t.L_InvalidFormat,message:t.L_InvalidDataFormat},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeDataNotMatchCoercionType]={name:t.L_InvalidDataObject,message:t.L_DataNotMatchCoercionType},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeDataNotMatchBindingType]={name:t.L_InvalidDataObject,message:t.L_DataNotMatchBindingType},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeSetDataIsTooLarge]={name:t.L_DataWriteError,message:t.L_SetDataIsTooLarge},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeNonUniformPartialSetNotSupported]={name:t.L_DataWriteError,message:t.L_NonUniformPartialSetNotSupported},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSetColumns]={name:t.L_DataWriteError,message:t.L_InvalidSetColumns},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSetRows]={name:t.L_DataWriteError,message:t.L_InvalidSetRows},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeSetDataParametersConflict]={name:t.L_DataWriteError,message:t.L_SetDataParametersConflict},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeSelectionCannotBound]={name:t.L_BindingCreationError,message:t.L_SelectionCannotBound},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeBindingNotExist]={name:t.L_InvalidBindingError,message:t.L_BindingNotExist},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeBindingToMultipleSelection]={name:t.L_BindingCreationError,message:t.L_BindingToMultipleSelection},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSelectionForBindingType]={name:t.L_BindingCreationError,message:t.L_InvalidSelectionForBindingType},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeOperationNotSupportedOnThisBindingType]={name:t.L_InvalidBindingOperation,message:t.L_OperationNotSupportedOnThisBindingType},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeNamedItemNotFound]={name:t.L_BindingCreationError,message:t.L_NamedItemNotFound},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeMultipleNamedItemFound]={name:t.L_BindingCreationError,message:t.L_MultipleNamedItemFound},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidNamedItemForBindingType]={name:t.L_BindingCreationError,message:t.L_InvalidNamedItemForBindingType},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeUnknownBindingType]={name:t.L_InvalidBinding,message:t.L_UnknownBindingType},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeOperationNotSupportedOnMatrixData]={name:t.L_InvalidBindingOperation,message:t.L_OperationNotSupportedOnMatrixData},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidColumnsForBinding]={name:t.L_InvalidBinding,message:t.L_InvalidColumnsForBinding},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeSettingNameNotExist]={name:t.L_ReadSettingsError,message:t.L_SettingNameNotExist},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeSettingsCannotSave]={name:t.L_SaveSettingsError,message:t.L_SettingsCannotSave},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeSettingsAreStale]={name:t.L_SettingsStaleError,message:t.L_SettingsAreStale},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeOperationNotSupported]={name:t.L_HostError,message:t.L_OperationNotSupported},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError]={name:t.L_InternalError,message:t.L_InternalErrorDescription},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeDocumentReadOnly]={name:t.L_PermissionDenied,message:t.L_DocumentReadOnly},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeEventHandlerNotExist]={name:t.L_EventRegistrationError,message:t.L_EventHandlerNotExist},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidApiCallInContext]={name:t.L_InvalidAPICall,message:t.L_InvalidApiCallInContext},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeShuttingDown]={name:t.L_ShuttingDown,message:t.L_ShuttingDown},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeUnsupportedEnumeration]={name:t.L_UnsupportedEnumeration,message:t.L_UnsupportedEnumerationMessage},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeIndexOutOfRange]={name:t.L_IndexOutOfRange,message:t.L_IndexOutOfRange},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeBrowserAPINotSupported]={name:t.L_APINotSupported,message:t.L_BrowserAPINotSupported},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeRequestTimeout]={name:t.L_APICallFailed,message:t.L_RequestTimeout},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidOrTimedOutSession]={name:t.L_InvalidOrTimedOutSession,message:t.L_InvalidOrTimedOutSessionMessage},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidApiArguments]={name:t.L_APICallFailed,message:t.L_InvalidApiArgumentsMessage},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeWorkbookHidden]={name:t.L_APICallFailed,message:t.L_WorkbookHiddenMessage},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeWriteNotSupportedWhenModalDialogOpen]={name:t.L_APICallFailed,message:t.L_WriteNotSupportedWhenModalDialogOpen},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeTooManyIncompleteRequests]={name:t.L_APICallFailed,message:t.L_TooManyIncompleteRequests},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeRequestTokenUnavailable]={name:t.L_APICallFailed,message:t.L_RequestTokenUnavailable},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeActivityLimitReached]={name:t.L_APICallFailed,message:t.L_ActivityLimitReached},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeRequestPayloadSizeLimitExceeded]={name:t.L_APICallFailed,message:t.L_RequestPayloadSizeLimitExceededMessage},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeResponsePayloadSizeLimitExceeded]={name:t.L_APICallFailed,message:t.L_ResponsePayloadSizeLimitExceededMessage},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeCustomXmlNodeNotFound]={name:t.L_InvalidNode,message:t.L_CustomXmlNodeNotFound},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeCustomXmlError]={name:t.L_CustomXmlError,message:t.L_CustomXmlError},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeCustomXmlExceedQuota]={name:t.L_CustomXmlExceedQuotaName,message:t.L_CustomXmlExceedQuotaMessage},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeCustomXmlOutOfDate]={name:t.L_CustomXmlOutOfDateName,message:t.L_CustomXmlOutOfDateMessage},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeNoCapability]={name:t.L_PermissionDenied,message:t.L_NoCapability},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeCannotNavTo]={name:t.L_CannotNavigateTo,message:t.L_CannotNavigateTo},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeSpecifiedIdNotExist]={name:t.L_SpecifiedIdNotExist,message:t.L_SpecifiedIdNotExist},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeNavOutOfBound]={name:t.L_NavOutOfBound,message:t.L_NavOutOfBound},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeCellDataAmountBeyondLimits]={name:t.L_DataWriteReminder,message:t.L_CellDataAmountBeyondLimits},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeElementMissing]={name:t.L_MissingParameter,message:t.L_ElementMissing},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeProtectedError]={name:t.L_PermissionDenied,message:t.L_NoCapability},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidCellsValue]={name:t.L_InvalidValue,message:t.L_InvalidCellsValue},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidTableOptionValue]={name:t.L_InvalidValue,message:t.L_InvalidTableOptionValue},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidFormatValue]={name:t.L_InvalidValue,message:t.L_InvalidFormatValue},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeRowIndexOutOfRange]={name:t.L_OutOfRange,message:t.L_RowIndexOutOfRange},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeColIndexOutOfRange]={name:t.L_OutOfRange,message:t.L_ColIndexOutOfRange},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeFormatValueOutOfRange]={name:t.L_OutOfRange,message:t.L_FormatValueOutOfRange},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeCellFormatAmountBeyondLimits]={name:t.L_FormattingReminder,message:t.L_CellFormatAmountBeyondLimits},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeMemoryFileLimit]={name:t.L_MemoryLimit,message:t.L_CloseFileBeforeRetrieve},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeNetworkProblemRetrieveFile]={name:t.L_NetworkProblem,message:t.L_NetworkProblemRetrieveFile},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSliceSize]={name:t.L_InvalidValue,message:t.L_SliceSizeNotSupported},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeDialogAlreadyOpened]={name:t.L_DisplayDialogError,message:t.L_DialogAlreadyOpened},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidWidth]={name:t.L_IndexOutOfRange,message:t.L_IndexOutOfRange},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidHeight]={name:t.L_IndexOutOfRange,message:t.L_IndexOutOfRange},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeNavigationError]={name:t.L_DisplayDialogError,message:t.L_NetworkProblem},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidScheme]={name:t.L_DialogNavigateError,message:t.L_DialogInvalidScheme},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeAppDomains]={name:t.L_DisplayDialogError,message:t.L_DialogAddressNotTrusted},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeRequireHTTPS]={name:t.L_DisplayDialogError,message:t.L_DialogRequireHTTPS},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeEndUserIgnore]={name:t.L_DisplayDialogError,message:t.L_UserClickIgnore},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeCrossZone]={name:t.L_DisplayDialogError,message:t.L_NewWindowCrossZoneErrorString},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeNotSSOAgave]={name:t.L_APINotSupported,message:t.L_InvalidSSOAddinMessage},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeSSOUserNotSignedIn]={name:t.L_UserNotSignedIn,message:t.L_UserNotSignedIn},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeSSOUserAborted]={name:t.L_UserAborted,message:t.L_UserAbortedMessage},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeSSOUnsupportedUserIdentity]={name:t.L_UnsupportedUserIdentity,message:t.L_UnsupportedUserIdentityMessage},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeSSOInvalidResourceUrl]={name:t.L_InvalidResourceUrl,message:t.L_InvalidResourceUrlMessage},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeSSOInvalidGrant]={name:t.L_InvalidGrant,message:t.L_InvalidGrantMessage},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeSSOClientError]={name:t.L_SSOClientError,message:t.L_SSOClientErrorMessage},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeSSOServerError]={name:t.L_SSOServerError,message:t.L_SSOServerErrorMessage},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeAddinIsAlreadyRequestingToken]={name:t.L_AddinIsAlreadyRequestingToken,message:t.L_AddinIsAlreadyRequestingTokenMessage},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeSSOUserConsentNotSupportedByCurrentAddinCategory]={name:t.L_SSOUserConsentNotSupportedByCurrentAddinCategory,message:t.L_SSOUserConsentNotSupportedByCurrentAddinCategoryMessage},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeSSOConnectionLost]={name:t.L_SSOConnectionLostError,message:t.L_SSOConnectionLostErrorMessage},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeSSOUnsupportedPlatform]={name:t.L_APINotSupported,message:t.L_SSOUnsupportedPlatform},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeSSOCallThrottled]={name:t.L_APICallFailed,message:t.L_RequestTokenUnavailable},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeOperationCancelled]={name:t.L_OperationCancelledError,message:t.L_OperationCancelledErrorMessage}}}}(),function(e){!function(e){var t=function(){return function(){}}();e.RequirementVersion=t;var n=function(){return function(e){this.isSetSupported=function(e,t){if(void 0==e)return!1;void 0==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},this._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}},this._setMap=e,this.isSetSupported=this.isSetSupported.bind(this)}}();e.RequirementMatrix=n;var r=function(){return function(e){this._addSetMap=function(e){for(var t in e)this._sets[t]=e[t]},this._sets=e}}();e.DefaultSetRequirement=r;var i=function(e){function t(){return e.call(this,{dialogapi:1.1})||this}return __extends(t,e),t}(r);e.DefaultRequiredDialogSetRequirement=i;var o=function(e){function t(){return e.call(this,{dialogorigin:1.1})||this}return __extends(t,e),t}(r);e.DefaultOptionalDialogSetRequirement=o;var a=function(e){function t(){return e.call(this,{bindingevents:1.1,documentevents:1.1,excelapi:1.1,matrixbindings:1.1,matrixcoercion:1.1,selection:1.1,settings:1.1,tablebindings:1.1,tablecoercion:1.1,textbindings:1.1,textcoercion:1.1})||this}return __extends(t,e),t}(r);e.ExcelClientDefaultSetRequirement=a;var s=function(e){function t(){var t=e.call(this)||this;return t._addSetMap({imagecoercion:1.1}),t}return __extends(t,e),t}(a);e.ExcelClientV1DefaultSetRequirement=s;var l=function(e){function t(){return e.call(this,{mailbox:1.3})||this}return __extends(t,e),t}(r);e.OutlookClientDefaultSetRequirement=l;var u=function(e){function t(){return e.call(this,{bindingevents:1.1,compressedfile:1.1,customxmlparts:1.1,documentevents:1.1,file:1.1,htmlcoercion:1.1,matrixbindings:1.1,matrixcoercion:1.1,ooxmlcoercion:1.1,pdffile:1.1,selection:1.1,settings:1.1,tablebindings:1.1,tablecoercion:1.1,textbindings:1.1,textcoercion:1.1,textfile:1.1,wordapi:1.1})||this}return __extends(t,e),t}(r);e.WordClientDefaultSetRequirement=u;var c=function(e){function t(){var t=e.call(this)||this;return t._addSetMap({customxmlparts:1.2,wordapi:1.2,imagecoercion:1.1}),t}return __extends(t,e),t}(u);e.WordClientV1DefaultSetRequirement=c;var p=function(e){function t(){return e.call(this,{activeview:1.1,compressedfile:1.1,documentevents:1.1,file:1.1,pdffile:1.1,selection:1.1,settings:1.1,textcoercion:1.1})||this}return __extends(t,e),t}(r);e.PowerpointClientDefaultSetRequirement=p;var h=function(e){function t(){var t=e.call(this)||this;return t._addSetMap({imagecoercion:1.1}),t}return __extends(t,e),t}(p);e.PowerpointClientV1DefaultSetRequirement=h;var f=function(e){function t(){return e.call(this,{selection:1.1,textcoercion:1.1})||this}return __extends(t,e),t}(r);e.ProjectClientDefaultSetRequirement=f;var d=function(e){function t(){return e.call(this,{bindingevents:1.1,documentevents:1.1,matrixbindings:1.1,matrixcoercion:1.1,selection:1.1,settings:1.1,tablebindings:1.1,tablecoercion:1.1,textbindings:1.1,textcoercion:1.1,file:1.1})||this}return __extends(t,e),t}(r);e.ExcelWebDefaultSetRequirement=d;var m=function(e){function t(){return e.call(this,{compressedfile:1.1,documentevents:1.1,file:1.1,imagecoercion:1.1,matrixcoercion:1.1,ooxmlcoercion:1.1,pdffile:1.1,selection:1.1,settings:1.1,tablecoercion:1.1,textcoercion:1.1,textfile:1.1})||this}return __extends(t,e),t}(r);e.WordWebDefaultSetRequirement=m;var y=function(e){function t(){return e.call(this,{activeview:1.1,settings:1.1})||this}return __extends(t,e),t}(r);e.PowerpointWebDefaultSetRequirement=y;var g=function(e){function t(){return e.call(this,{mailbox:1.3})||this}return __extends(t,e),t}(r);e.OutlookWebDefaultSetRequirement=g;var _=function(e){function t(){return e.call(this,{activeview:1.1,documentevents:1.1,selection:1.1,settings:1.1,textcoercion:1.1})||this}return __extends(t,e),t}(r);e.SwayWebDefaultSetRequirement=_;var b=function(e){function t(){return e.call(this,{bindingevents:1.1,partialtablebindings:1.1,settings:1.1,tablebindings:1.1,tablecoercion:1.1})||this}return __extends(t,e),t}(r);e.AccessWebDefaultSetRequirement=b;var O=function(e){function t(){return e.call(this,{bindingevents:1.1,documentevents:1.1,matrixbindings:1.1,matrixcoercion:1.1,selection:1.1,settings:1.1,tablebindings:1.1,tablecoercion:1.1,textbindings:1.1,textcoercion:1.1})||this}return __extends(t,e),t}(r);e.ExcelIOSDefaultSetRequirement=O;var v=function(e){function t(){return e.call(this,{bindingevents:1.1,compressedfile:1.1,customxmlparts:1.1,documentevents:1.1,file:1.1,htmlcoercion:1.1,matrixbindings:1.1,matrixcoercion:1.1,ooxmlcoercion:1.1,pdffile:1.1,selection:1.1,settings:1.1,tablebindings:1.1,tablecoercion:1.1,textbindings:1.1,textcoercion:1.1,textfile:1.1})||this}return __extends(t,e),t}(r);e.WordIOSDefaultSetRequirement=v;var S=function(e){function t(){var t=e.call(this)||this;return t._addSetMap({customxmlparts:1.2,wordapi:1.2}),t}return __extends(t,e),t}(v);e.WordIOSV1DefaultSetRequirement=S;var C=function(e){function t(){return e.call(this,{activeview:1.1,compressedfile:1.1,documentevents:1.1,file:1.1,pdffile:1.1,selection:1.1,settings:1.1,textcoercion:1.1})||this}return __extends(t,e),t}(r);e.PowerpointIOSDefaultSetRequirement=C;var A=function(e){function t(){return e.call(this,{mailbox:1.1})||this}return __extends(t,e),t}(r);e.OutlookIOSDefaultSetRequirement=A;var P=function(){function e(){}return e.initializeOsfDda=function(){OSF.OUtil.setNamespace("Requirement",OSF.DDA)},e.getDefaultRequirementMatrix=function(t){this.initializeDefaultSetMatrix();var i=void 0,o=t.get_requirementMatrix();if(void 0!=o&&o.length>0&&"undefined"!==typeof JSON){var a=JSON.parse(t.get_requirementMatrix().toLowerCase());try{a.hasOwnProperty("dialogorigin")||(a.dialogorigin=1.1)}catch(e){}i=new n(new r(a))}else{var s=e.getClientFullVersionString(t);i=void 0!=e.DefaultSetArrayMatrix&&void 0!=e.DefaultSetArrayMatrix[s]?new n(e.DefaultSetArrayMatrix[s]):new n(new r({}))}return i},e.getDefaultDialogRequirementMatrix=function(e){var t=void 0,a=e.get_dialogRequirementMatrix();if(void 0!=a&&a.length>0&&"undefined"!==typeof JSON){var s=JSON.parse(e.get_requirementMatrix().toLowerCase());t=new r(s)}else{t=new i;var l=e.get_requirementMatrix();if(void 0!=l&&l.length>0&&"undefined"!==typeof JSON){s=JSON.parse(l.toLowerCase());for(var u in t._sets)s.hasOwnProperty(u)&&(t._sets[u]=s[u]);var c=new o;for(var u in c._sets)s.hasOwnProperty(u)&&(t._sets[u]=s[u])}}try{!t._sets.hasOwnProperty("dialogorigin")&&window.opener&&(t._sets.dialogorigin=1.1)}catch(e){}return new n(t)},e.getClientFullVersionString=function(e){var t=e.get_appMinorVersion(),n="",r="",i=e.get_appName();return(1024==i||4096==i||8192==i||65536==i)&&1==e.get_appVersion()?r=4096==i&&t>=15?"16.00.01":"16.00":64==e.get_appName()?r=e.get_appVersion():(n=t<10?"0"+t:""+t,r=e.get_appVersion()+"."+n),e.get_appName()+"-"+r},e.initializeDefaultSetMatrix=function(){e.DefaultSetArrayMatrix[e.Excel_RCLIENT_1600]=new a,e.DefaultSetArrayMatrix[e.Word_RCLIENT_1600]=new u,e.DefaultSetArrayMatrix[e.PowerPoint_RCLIENT_1600]=new p,e.DefaultSetArrayMatrix[e.Excel_RCLIENT_1601]=new s,e.DefaultSetArrayMatrix[e.Word_RCLIENT_1601]=new c,e.DefaultSetArrayMatrix[e.PowerPoint_RCLIENT_1601]=new h,e.DefaultSetArrayMatrix[e.Outlook_RCLIENT_1600]=new l,e.DefaultSetArrayMatrix[e.Excel_WAC_1600]=new d,e.DefaultSetArrayMatrix[e.Word_WAC_1600]=new m,e.DefaultSetArrayMatrix[e.Outlook_WAC_1600]=new g,e.DefaultSetArrayMatrix[e.Outlook_WAC_1601]=new g,e.DefaultSetArrayMatrix[e.Project_RCLIENT_1600]=new f,e.DefaultSetArrayMatrix[e.Access_WAC_1600]=new b,e.DefaultSetArrayMatrix[e.PowerPoint_WAC_1600]=new y,e.DefaultSetArrayMatrix[e.Excel_IOS_1600]=new O,e.DefaultSetArrayMatrix[e.SWAY_WAC_1600]=new _,e.DefaultSetArrayMatrix[e.Word_IOS_1600]=new v,e.DefaultSetArrayMatrix[e.Word_IOS_16001]=new S,e.DefaultSetArrayMatrix[e.PowerPoint_IOS_1600]=new C,e.DefaultSetArrayMatrix[e.Outlook_IOS_1600]=new A},e.Excel_RCLIENT_1600="1-16.00",e.Excel_RCLIENT_1601="1-16.01",e.Word_RCLIENT_1600="2-16.00",e.Word_RCLIENT_1601="2-16.01",e.PowerPoint_RCLIENT_1600="4-16.00",e.PowerPoint_RCLIENT_1601="4-16.01",e.Outlook_RCLIENT_1600="8-16.00",e.Excel_WAC_1600="16-16.00",e.Word_WAC_1600="32-16.00",e.Outlook_WAC_1600="64-16.00",e.Outlook_WAC_1601="64-16.01",e.Project_RCLIENT_1600="128-16.00",e.Access_WAC_1600="256-16.00",e.PowerPoint_WAC_1600="512-16.00",e.Excel_IOS_1600="1024-16.00",e.SWAY_WAC_1600="2048-16.00",e.Word_IOS_1600="4096-16.00",e.Word_IOS_16001="4096-16.00.01",e.PowerPoint_IOS_1600="8192-16.00",e.Outlook_IOS_1600="65536-16.00",e.DefaultSetArrayMatrix={},e}();e.RequirementsMatrixFactory=P}(e.Requirement||(e.Requirement={}))}(OfficeExt||(OfficeExt={})),OfficeExt.Requirement.RequirementsMatrixFactory.initializeOsfDda(),Microsoft.Office.WebExtension.ApplicationMode={WebEditor:"webEditor",WebViewer:"webViewer",Client:"client"},Microsoft.Office.WebExtension.DocumentMode={ReadOnly:"readOnly",ReadWrite:"readWrite"},OSF.NamespaceManager=function(){var e,t=!1;return{enableShortcut:function(){t||(window.Office?e=window.Office:OSF.OUtil.setNamespace("Office",window),window.Office=Microsoft.Office.WebExtension,t=!0)},disableShortcut:function(){t&&(e?window.Office=e:OSF.OUtil.unsetNamespace("Office",window),t=!1)}}}(),OSF.NamespaceManager.enableShortcut(),Microsoft.Office.WebExtension.useShortNamespace=function(e){e?OSF.NamespaceManager.enableShortcut():OSF.NamespaceManager.disableShortcut()},Microsoft.Office.WebExtension.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.DDA.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[Microsoft.Office.WebExtension.Parameters.Callback]=t,OSF.DDA.issueAsyncResult(s,OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidApiCallInContext,OSF.DDA.ErrorCodeManager.getErrorArgs(OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidApiCallInContext))}},OSF.DDA.Context=function(e,t,n,r,i){if(OSF.OUtil.defineEnumerableProperties(this,{contentLanguage:{value:e.get_dataLocale()},displayLanguage:{value:e.get_appUILocale()},touchEnabled:{value:e.get_touchEnabled()},commerceAllowed:{value:e.get_commerceAllowed()},host:{value:OfficeExt.HostName.Host.getInstance().getHost()},platform:{value:OfficeExt.HostName.Host.getInstance().getPlatform()},isDialog:{value:OSF._OfficeAppFactory.getHostInfo().isDialog},diagnostics:{value:OfficeExt.HostName.Host.getInstance().getDiagnostics(e.get_hostFullVersion())}}),n&&OSF.OUtil.defineEnumerableProperty(this,"license",{value:n}),e.ui&&OSF.OUtil.defineEnumerableProperty(this,"ui",{value:e.ui}),e.auth&&OSF.OUtil.defineEnumerableProperty(this,"auth",{value:e.auth}),e.webAuth&&OSF.OUtil.defineEnumerableProperty(this,"webAuth",{value:e.webAuth}),e.application&&OSF.OUtil.defineEnumerableProperty(this,"application",{value:e.application}),e.extensionLifeCycle&&OSF.OUtil.defineEnumerableProperty(this,"extensionLifeCycle",{value:e.extensionLifeCycle}),e.messaging&&OSF.OUtil.defineEnumerableProperty(this,"messaging",{value:e.messaging}),e.ui&&e.ui.taskPaneAction&&OSF.OUtil.defineEnumerableProperty(this,"taskPaneAction",{value:e.ui.taskPaneAction}),e.ui&&e.ui.ribbonGallery&&OSF.OUtil.defineEnumerableProperty(this,"ribbonGallery",{value:e.ui.ribbonGallery}),e.get_isDialog()){var o=OfficeExt.Requirement.RequirementsMatrixFactory.getDefaultDialogRequirementMatrix(e);OSF.OUtil.defineEnumerableProperty(this,"requirements",{value:o})}else{if(t&&OSF.OUtil.defineEnumerableProperty(this,"document",{value:t}),r){var a=r.displayName||"appOM";delete r.displayName,OSF.OUtil.defineEnumerableProperty(this,a,{value:r})}e.get_officeTheme()?OSF.OUtil.defineEnumerableProperty(this,"officeTheme",{get:function(){return e.get_officeTheme()}}):i&&OSF.OUtil.defineEnumerableProperty(this,"officeTheme",{get:function(){return i()}});o=OfficeExt.Requirement.RequirementsMatrixFactory.getDefaultRequirementMatrix(e);OSF.OUtil.defineEnumerableProperty(this,"requirements",{value:o})}},OSF.DDA.OutlookContext=function(e,t,n,r,i){OSF.DDA.OutlookContext.uber.constructor.call(this,e,null,n,r,i),t&&OSF.OUtil.defineEnumerableProperty(this,"roamingSettings",{value:t})},OSF.OUtil.extend(OSF.DDA.OutlookContext,OSF.DDA.Context),OSF.DDA.OutlookAppOm=function(e,t,n){},OSF.DDA.Application=function(e){},OSF.DDA.Document=function(e,t){var n;switch(e.get_clientMode()){case OSF.ClientMode.ReadOnly:n=Microsoft.Office.WebExtension.DocumentMode.ReadOnly;break;case OSF.ClientMode.ReadWrite:n=Microsoft.Office.WebExtension.DocumentMode.ReadWrite}t&&OSF.OUtil.defineEnumerableProperty(this,"settings",{value:t}),OSF.OUtil.defineMutableProperties(this,{mode:{value:n},url:{value:e.get_docUrl()}})},OSF.DDA.JsomDocument=function(e,t,n){OSF.DDA.JsomDocument.uber.constructor.call(this,e,n),t&&OSF.OUtil.defineEnumerableProperty(this,"bindings",{get:function(){return t}});var r=OSF.DDA.AsyncMethodNames;OSF.DDA.DispIdHost.addAsyncMethods(this,[r.GetSelectedDataAsync,r.SetSelectedDataAsync]),OSF.DDA.DispIdHost.addEventSupport(this,new OSF.EventDispatch([Microsoft.Office.WebExtension.EventType.DocumentSelectionChanged]))},OSF.OUtil.extend(OSF.DDA.JsomDocument,OSF.DDA.Document),OSF.OUtil.defineEnumerableProperty(Microsoft.Office.WebExtension,"context",{get:function(){var e;return OSF&&OSF._OfficeAppFactory&&(e=OSF._OfficeAppFactory.getContext()),e}}),OSF.DDA.License=function(e){OSF.OUtil.defineEnumerableProperty(this,"value",{value:e})},OSF.DDA.ApiMethodCall=function(e,t,n,r,i){var o=e.length,a=OSF.OUtil.delayExecutionAndCache((function(){return OSF.OUtil.formatString(Strings.OfficeOM.L_InvalidParameters,i)}));this.verifyArguments=function(e,t){for(var n in e){var r=e[n],i=t[n];if(r.enum)switch(typeof i){case"string":if(OSF.OUtil.listContainsValue(r.enum,i))break;case"undefined":throw OSF.DDA.ErrorCodeManager.errorCodes.ooeUnsupportedEnumeration;default:throw a()}if(r.types&&!OSF.OUtil.listContainsValue(r.types,typeof i))throw a()}},this.extractRequiredArguments=function(t,n,r){if(t.lengths+2)throw OsfMsAjaxFactory.msAjaxError.parameterCount(Strings.OfficeOM.L_TooManyArguments);for(var o,a,u=e.length-1;u>=s;u--){var c=e[u];switch(typeof c){case"object":if(o)throw OsfMsAjaxFactory.msAjaxError.parameterCount(Strings.OfficeOM.L_TooManyOptionalObjects);o=c;break;case"function":if(a)throw OsfMsAjaxFactory.msAjaxError.parameterCount(Strings.OfficeOM.L_TooManyOptionalFunction);a=c;break;default:throw OsfMsAjaxFactory.msAjaxError.argument(Strings.OfficeOM.L_InValidOptionalArgument)}}if(o=l.fillOptions(o,n,r,i),a){if(o[Microsoft.Office.WebExtension.Parameters.Callback])throw Strings.OfficeOM.L_RedundantCallbackSpecification;o[Microsoft.Office.WebExtension.Parameters.Callback]=a}return l.verifyArguments(t,o),o}(e,i,n,r);return l.constructCallArgs(i,o,n,r)},this.processResponse=function(e,t,n,o){return e==OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess?r?r(t,n,o):t:i?i(e,t):OSF.DDA.ErrorCodeManager.getErrorArgs(e)},this.getCallArgs=function(e){for(var t,n,r=e.length-1;r>=s;r--){var i=e[r];switch(typeof i){case"object":t=i;break;case"function":n=i}}return t=t||{},n&&(t[Microsoft.Office.WebExtension.Parameters.Callback]=n),t}},OSF.DDA.AsyncMethodCallFactory=function(){return{manufacture:function(e){var t=e.supportedOptions?OSF.OUtil.createObject(e.supportedOptions):[],n=e.privateStateCallbacks?OSF.OUtil.createObject(e.privateStateCallbacks):[];return new OSF.DDA.AsyncMethodCall(e.requiredArguments||[],t,n,e.onSucceeded,e.onFailed,e.checkCallArgs,e.method.displayName)}}}(),OSF.DDA.AsyncMethodCalls={},OSF.DDA.AsyncMethodCalls.define=function(e){OSF.DDA.AsyncMethodCalls[e.method.id]=OSF.DDA.AsyncMethodCallFactory.manufacture(e)},OSF.DDA.Error=function(e,t,n){OSF.OUtil.defineEnumerableProperties(this,{name:{value:e},message:{value:t},code:{value:n}})},OSF.DDA.AsyncResult=function(e,t){OSF.OUtil.defineEnumerableProperties(this,{value:{value:e[OSF.DDA.AsyncResultEnum.Properties.Value]},status:{value:t?Microsoft.Office.WebExtension.AsyncResultStatus.Failed:Microsoft.Office.WebExtension.AsyncResultStatus.Succeeded}}),e[OSF.DDA.AsyncResultEnum.Properties.Context]&&OSF.OUtil.defineEnumerableProperty(this,"asyncContext",{value:e[OSF.DDA.AsyncResultEnum.Properties.Context]}),t&&OSF.OUtil.defineEnumerableProperty(this,"error",{value:new OSF.DDA.Error(t[OSF.DDA.AsyncResultEnum.ErrorProperties.Name],t[OSF.DDA.AsyncResultEnum.ErrorProperties.Message],t[OSF.DDA.AsyncResultEnum.ErrorProperties.Code])})},OSF.DDA.issueAsyncResult=function(e,t,n){var r=e[Microsoft.Office.WebExtension.Parameters.Callback];if(r){var i,o={};o[OSF.DDA.AsyncResultEnum.Properties.Context]=e[Microsoft.Office.WebExtension.Parameters.AsyncContext],t==OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess?o[OSF.DDA.AsyncResultEnum.Properties.Value]=n:(i={},n=n||OSF.DDA.ErrorCodeManager.getErrorArgs(OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError),i[OSF.DDA.AsyncResultEnum.ErrorProperties.Code]=t||OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError,i[OSF.DDA.AsyncResultEnum.ErrorProperties.Name]=n.name||n,i[OSF.DDA.AsyncResultEnum.ErrorProperties.Message]=n.message||n),r(new OSF.DDA.AsyncResult(o,i))}},OSF.DDA.SyncMethodNames={},OSF.DDA.SyncMethodNames.addNames=function(e){for(var t in e){var n={};OSF.OUtil.defineEnumerableProperties(n,{id:{value:t},displayName:{value:e[t]}}),OSF.DDA.SyncMethodNames[t]=n}},OSF.DDA.SyncMethodCall=function(e,t,n,r,i){var o=e.length,a=new OSF.DDA.ApiMethodCall(e,t,n,r,i);this.verifyAndExtractCall=function(e,n,r){var i=a.extractRequiredArguments(e,n,r),s=function(e,n,r,i){if(e.length>o+1)throw OsfMsAjaxFactory.msAjaxError.parameterCount(Strings.OfficeOM.L_TooManyArguments);for(var s,l=e.length-1;l>=o;l--){var u=e[l];switch(typeof u){case"object":if(s)throw OsfMsAjaxFactory.msAjaxError.parameterCount(Strings.OfficeOM.L_TooManyOptionalObjects);s=u;break;default:throw OsfMsAjaxFactory.msAjaxError.argument(Strings.OfficeOM.L_InValidOptionalArgument)}}return s=a.fillOptions(s,n,r,i),a.verifyArguments(t,s),s}(e,i,n,r);return a.constructCallArgs(i,s,n,r)}},OSF.DDA.SyncMethodCallFactory=function(){return{manufacture:function(e){var t=e.supportedOptions?OSF.OUtil.createObject(e.supportedOptions):[];return new OSF.DDA.SyncMethodCall(e.requiredArguments||[],t,e.privateStateCallbacks,e.checkCallArgs,e.method.displayName)}}}(),OSF.DDA.SyncMethodCalls={},OSF.DDA.SyncMethodCalls.define=function(e){OSF.DDA.SyncMethodCalls[e.method.id]=OSF.DDA.SyncMethodCallFactory.manufacture(e)},OSF.DDA.ListType=function(){var e={};return{setListType:function(t,n){e[t]=n},isListType:function(t){return OSF.OUtil.listContainsKey(e,t)},getDescriptor:function(t){return e[t]}}}(),OSF.DDA.HostParameterMap=function(e,t){var n={};function r(i,o){var a=i?{}:void 0;for(var s in i){var l,u=i[s];if(OSF.DDA.ListType.isListType(s))for(var c in l=[],u)l.push(r(u[c],o));else if(OSF.OUtil.listContainsKey(n,s))l=n[s][o](u);else if("fromHost"==o&&e.preserveNesting(s))l=r(u,o);else{var p=t[s];if(p){var h=p[o];h&&void 0===(l=h[u])&&(l=u)}else l=u}a[s]=l}return a}function i(n,i,o){var a,s=t[n][o];if("toHost"==o)a=function n(r,i){var o;for(var a in i){var s;if(void 0!=(s=e.isComplexType(a)?n(r,t[a].toHost):r[a])){o||(o={});var l=i[a];"self"==l&&(l=a),o[l]=e.pack(a,s)}}return o}(r(i,o),s);else if("fromHost"==o){a=r(function n(r,i,o){for(var a in o||(o={}),i){var s,l,u=i[a];if("self"==u)s=r;else{if("sourceData"==u){o[a]=r.toArray();continue}s=r[u]}if(null===s||void 0===s)o[a]=void 0;else if(s=e.unpack(a,s),e.isComplexType(a))l=t[a].fromHost,e.preserveNesting(a)?o[a]=n(s,l):n(s,l,o);else if(OSF.DDA.ListType.isListType(a)){(l={})[OSF.DDA.ListType.getDescriptor(a)]="self";var c=new Array(s.length);for(var p in s)c[p]=n(s[p],l);o[a]=c}else o[a]=s}return o}(i,s),o)}return a}n[Microsoft.Office.WebExtension.Parameters.Data]={toHost:function(e){if(null!=e&&void 0!==e.rows){var t={};t[OSF.DDA.TableDataProperties.TableRows]=e.rows,t[OSF.DDA.TableDataProperties.TableHeaders]=e.headers,e=t}return e},fromHost:function(e){return e}},n[Microsoft.Office.WebExtension.Parameters.SampleData]=n[Microsoft.Office.WebExtension.Parameters.Data],t||(t={}),this.addMapping=function(e,n){var r,i;if(n.map)for(var o in i={},r=n.map){var a=r[o];"self"==a&&(a=o),i[a]=o}else r=n.toHost,i=n.fromHost;var s=t[e];if(s){var l=s.toHost;for(var u in l)r[u]=l[u];for(var c in l=s.fromHost)i[c]=l[c]}else s=t[e]={};s.toHost=r,s.fromHost=i},this.toHost=function(e,t){return i(e,t,"toHost")},this.fromHost=function(e,t){return i(e,t,"fromHost")},this.self="self",this.sourceData="sourceData",this.addComplexType=function(t){e.addComplexType(t)},this.getDynamicType=function(t){return e.getDynamicType(t)},this.setDynamicType=function(t,n){e.setDynamicType(t,n)},this.dynamicTypes=n,this.doMapValues=function(e,t){return r(e,t)}},OSF.DDA.SpecialProcessor=function(e,t){this.addComplexType=function(t){e.push(t)},this.getDynamicType=function(e){return t[e]},this.setDynamicType=function(e,n){t[e]=n},this.isComplexType=function(t){return OSF.OUtil.listContainsValue(e,t)},this.isDynamicType=function(e){return OSF.OUtil.listContainsKey(t,e)},this.preserveNesting=function(e){var t=[];return OSF.DDA.PropertyDescriptors&&t.push(OSF.DDA.PropertyDescriptors.Subset),OSF.DDA.DataNodeEventProperties&&(t=t.concat([OSF.DDA.DataNodeEventProperties.OldNode,OSF.DDA.DataNodeEventProperties.NewNode,OSF.DDA.DataNodeEventProperties.NextSiblingNode])),OSF.OUtil.listContainsValue(t,e)},this.pack=function(e,n){return this.isDynamicType(e)?t[e].toHost(n):n},this.unpack=function(e,n){return this.isDynamicType(e)?t[e].fromHost(n):n}},OSF.DDA.getDecoratedParameterMap=function(e,t){var n=new OSF.DDA.HostParameterMap(e);n.self;function r(e){var t=null;if(e){t={};for(var n=e.length,r=0;r-1||e.indexOf("Trident/")>-1||e.indexOf("Edge/")>-1}catch(e){return r("Error happens in isInternetExplorer.",e),!1}}function r(e,n){OsfMsAjaxFactory.msAjaxDebug.trace(e+" Exception details: "+t(n))}e.parseAppContextFromWindowName=function(e,t){return OSF.OUtil.parseInfoFromWindowName(e,t,OSF.WindowNameItemKeys.AppContext)},e.serializeObjectToString=t,e.isHostTrusted=function(){return new RegExp("^https://[a-z0-9-]+.(officeapps.live|officeapps-df.live|partner.officewebapps).com/").test(OSF.getClientEndPoint()._targetUrl.toLowerCase())},e.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},e.getDomainForUrl=function(e){if(!e)return null;var t=document.createElement("a");return t.href=e,t.protocol+"//"+t.host},e.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,i=0,o=e.length;i-1)return n();return!1}catch(e){return r("Error happens in shouldUseLocalStorageToPassMessage.",e),!1}},e.isInternetExplorer=n,e.removeMatchesFromLocalStorage=function(e){for(var t=OSF.OUtil.getLocalStorage(),n=t.getKeysWithPrefix(""),r=0,i=n.length;r0){for(var r=[],i=0;i=i)break;if(r=Function._validateParameter(e[o],s,l))return r.popStackFrame(),r}return null}),Function._validateParameterCount||(Function._validateParameterCount=function(e,t,r){var i,o,a=t.length,s=e.length;if(sa)for(o=!0,i=0;i0?c(e.shift()):(clearInterval(n),n=null)):OsfMsAjaxFactory.msAjaxDebug.trace("channel is not ready.")}function c(e){r=e.getInvokeBlockingFlag(),e.invoke(),t=(new Date).getTime()}function p(){if(i){var e,t,n=0,r=new Date;for(var a in s)for(var l in(e=s[a])._callbackList){var u=e._callbackList[l];if((t=u.timeout?u.timeout:o)>=0&&Math.abs(r.getTime()-u.createdOn)>=t)try{u.callback&&u.callback(Microsoft.Office.Common.InvokeResultCode.errorHandlingMethodCallTimedout,null)}finally{delete e._callbackList[l]}else n++}0===n&&(clearInterval(i),i=null)}else OsfMsAjaxFactory.msAjaxDebug.trace("channel is not ready.")}function h(){r=!1}function f(e,t){var n=!1;if(!t||"null"===t||!t.length||!e||!(e instanceof Array)||!e.length)return n;var r=document.createElement("a"),i=document.createElement("a");r.href=t;for(var o=0;os.length+1&&(u=a.slice(-(s.length+1))==="."+s),o&&i&&(l||u)}function y(e,t){return g(OSF.OUtil.parseUrl(e,!0),OSF.OUtil.parseUrl(t,!0))}function g(e,t){return e.hostname==t.hostname&&e.protocol==t.protocol&&_(e,t)}function _(e,t){return e.port==t.port||""==e.port&&"http:"==e.protocol&&"80"==t.port||""==e.port&&"https:"==e.protocol&&"443"==t.port||""==t.port&&"http:"==t.protocol&&"80"==e.port||""==t.port&&"https:"==t.protocol&&"443"==e.port}function b(i){if(OSF&&""!=i.data){var o,l=OSF.SerializerVersion.Browser,p=i.data;try{l=null!=(o=Microsoft.Office.Common.MessagePackager.unenvelope(p,OSF.SerializerVersion.Browser))._serializerVersion?o._serializerVersion:l}catch(e){return}if(o._messageType===Microsoft.Office.Common.MessageType.request){var _=null==i.origin||"null"===i.origin?o._origin:i.origin;try{var b=function(e){for(var t in a)if(a[t]._conversations[e])return a[t];throw OsfMsAjaxFactory.msAjaxDebug.trace("Unknown conversation Id."),OsfMsAjaxFactory.msAjaxError.argument("conversationId")}(o._conversationId),O=b._conversations[o._conversationId];l=null!=O.serializerVersion?O.serializerVersion:l;var v=[O.url].concat(b._appDomains[o._conversationId]);if(!f(v,i.origin))if(!OfficeExt.appSpecificCheckOrigin(v,i,o._origin,f))if(!m(O.url,i.origin))throw"Failed origin check";var S=null!=o._data?o._data:{};S.SecurityOrigin=i.origin;var C=b.getPolicyManager();if(C&&!C.checkPermission(o._conversationId,o._actionName,S))throw"Access Denied";var A=function(e,t){var n=e._methodObjectList[t._actionName];if(!n)throw OsfMsAjaxFactory.msAjaxDebug.trace("The specified method is not registered on service endpoint:"+t._actionName),OsfMsAjaxFactory.msAjaxError.argument("messageObject");return t._actionType===Microsoft.Office.Common.ActionType.invoke?n:t._actionType===Microsoft.Office.Common.ActionType.registerEvent?n.getRegisterMethodObject():n.getUnregisterMethodObject()}(b,o),P=new Microsoft.Office.Common.InvokeCompleteCallback(i.source,_,o._actionName,o._conversationId,o._correlationId,h,l),F=new Microsoft.Office.Common.Invoker(A,S,P,b._eventHandlerProxyList,o._conversationId,o._actionName,l),D=!0;null==n&&((null==t||(new Date).getTime()-t>10)&&!r?(c(F),D=!1):n=setInterval(u,10)),D&&function(t){e.push(t)}(F)}catch(e){b&&b._onHandleRequestError&&b._onHandleRequestError(o,e);var R=Microsoft.Office.Common.InvokeResultCode.errorHandlingRequest;"Access Denied"==e&&(R=Microsoft.Office.Common.InvokeResultCode.errorHandlingRequestAccessDenied);var E=new Microsoft.Office.Common.Response(o._actionName,o._conversationId,o._correlationId,R,Microsoft.Office.Common.ResponseType.forCalling,e),I=Microsoft.Office.Common.MessagePackager.envelope(E,l),x=!1;try{x=!(!i.source||!i.source.postMessage)}catch(e){}var T=!1;if(window.location.href&&i.origin&&"null"!==i.origin&&m(window.location.href,i.origin))T=!0;else if(i.origin&&"null"!==i.origin)if(OSF.OUtil.checkFlight(OSF.FlightNames.AddinEnforceHttps)){T=d(OSF.OUtil.parseUrl(i.origin,!0).hostname)}else{var N=document.createElement("a");N.href=i.origin,T=d(N.hostname)}x&&T&&i.source.postMessage(I,_)}}else{if(o._messageType!==Microsoft.Office.Common.MessageType.response)return;var w=function(e){var t=s[e];return t||OsfMsAjaxFactory.msAjaxDebug.trace("Unknown conversation Id."),t}(o._conversationId);if(!w)return;if(w._serializerVersion=l,!function(e,t){var n,r,i=!1;return e&&t&&"null"!==e&&"null"!==t&&e.length&&t.length?(OSF.OUtil.checkFlight(OSF.FlightNames.AddinEnforceHttps)?i=y(e,t):(n=document.createElement("a"),r=document.createElement("a"),n.href=e,r.href=t,i=g(n,r)),i):i}(w._targetUrl,i.origin))throw"Failed orgin check";if(o._responseType===Microsoft.Office.Common.ResponseType.forCalling){var M=w._callbackList[o._correlationId];if(M)try{M.callback&&M.callback(o._errorCode,o._data)}finally{delete w._callbackList[o._correlationId]}}else{var j=w._eventHandlerList[o._actionName];void 0!==j&&null!==j&&j(o._data)}}}}function O(){l||(!function(e){if(window.addEventListener)window.addEventListener("message",e,!1);else{if(!(navigator.userAgent.indexOf("MSIE")>-1&&window.attachEvent))throw OsfMsAjaxFactory.msAjaxDebug.trace("Browser doesn't support the required API."),OsfMsAjaxFactory.msAjaxError.argument("Browser");window.attachEvent("onmessage",e)}}(b),l=!0)}return{connect:function(e,t,n,r){var i=s[e];return i||(O(),i=new Microsoft.Office.Common.ClientEndPoint(e,t,n,r),s[e]=i),i},getClientEndPoint:function(e){var t=Function._validateParams(arguments,[{name:"conversationId",type:String,mayBeNull:!1}]);if(t)throw t;return s[e]},createServiceEndPoint:function(e){O();var t=new Microsoft.Office.Common.ServiceEndPoint(e);return a[e]=t,t},getServiceEndPoint:function(e){var t=Function._validateParams(arguments,[{name:"serviceEndPointId",type:String,mayBeNull:!1}]);if(t)throw t;return a[e]},deleteClientEndPoint:function(e){var t=Function._validateParams(arguments,[{name:"conversationId",type:String,mayBeNull:!1}]);if(t)throw t;delete s[e]},deleteServiceEndPoint:function(e){var t=Function._validateParams(arguments,[{name:"serviceEndPointId",type:String,mayBeNull:!1}]);if(t)throw t;delete a[e]},urlCompare:function(e,t){return g(e,t)},checkUrlWithAppDomains:function(e,t){return f(e,t)},isTargetSubdomainOfSourceLocation:function(e,t){return m(e,t)},_setMethodTimeout:function(e){var t=Function._validateParams(arguments,[{name:"methodTimeout",type:Number,mayBeNull:!1}]);if(t)throw t;o=e<=0?65e3:e},_startMethodTimeoutTimer:function(){i||(i=setInterval(p,2e3))},isHostNameValidWacDomain:function(e){return d(e)},_hasSamePort:function(e,t){return _(e,t)}}}(),Microsoft.Office.Common.Message=function(e,t,n,r,i){var o=Function._validateParams(arguments,[{name:"messageType",type:Number,mayBeNull:!1},{name:"actionName",type:String,mayBeNull:!1},{name:"conversationId",type:String,mayBeNull:!1},{name:"correlationId",mayBeNull:!1},{name:"data",mayBeNull:!0,optional:!0}]);if(o)throw o;this._messageType=e,this._actionName=t,this._conversationId=n,this._correlationId=r,this._origin=window.location.origin,this._data="undefined"==typeof i?null:i},Microsoft.Office.Common.Message.prototype={getActionName:function(){return this._actionName},getConversationId:function(){return this._conversationId},getCorrelationId:function(){return this._correlationId},getOrigin:function(){return this._origin},getData:function(){return this._data},getMessageType:function(){return this._messageType}},Microsoft.Office.Common.Request=function(e,t,n,r,i){Microsoft.Office.Common.Request.uber.constructor.call(this,Microsoft.Office.Common.MessageType.request,e,n,r,i),this._actionType=t},OSF.OUtil.extend(Microsoft.Office.Common.Request,Microsoft.Office.Common.Message),Microsoft.Office.Common.Request.prototype.getActionType=function(){return this._actionType},Microsoft.Office.Common.Response=function(e,t,n,r,i,o){Microsoft.Office.Common.Response.uber.constructor.call(this,Microsoft.Office.Common.MessageType.response,e,t,n,o),this._errorCode=r,this._responseType=i},OSF.OUtil.extend(Microsoft.Office.Common.Response,Microsoft.Office.Common.Message),Microsoft.Office.Common.Response.prototype.getErrorCode=function(){return this._errorCode},Microsoft.Office.Common.Response.prototype.getResponseType=function(){return this._responseType},Microsoft.Office.Common.MessagePackager={envelope:function(e,t){return"object"===typeof e&&(e._serializerVersion=OSF.SerializerVersion.Browser),JSON.stringify(e)},unenvelope:function(e,t){return JSON.parse(e)}},Microsoft.Office.Common.ResponseSender=function(e,t,n,r,i,o,a){var s=Function._validateParams(arguments,[{name:"requesterWindow",mayBeNull:!1},{name:"requesterUrl",type:String,mayBeNull:!1},{name:"actionName",type:String,mayBeNull:!1},{name:"conversationId",type:String,mayBeNull:!1},{name:"correlationId",mayBeNull:!1},{name:"responsetype",type:Number,maybeNull:!1},{name:"serializerVersion",type:Number,maybeNull:!0,optional:!0}]);if(s)throw s;this._requesterWindow=e,this._requesterUrl=t,this._actionName=n,this._conversationId=r,this._correlationId=i,this._invokeResultCode=Microsoft.Office.Common.InvokeResultCode.noError,this._responseType=o;var l=this;this._send=function(e){var t=function(e,t){var n=OSF.OUtil.parseUrl(e),r=OSF.OUtil.parseUrl(t);if(!(n&&n.hostname&&r&&r.hostname)){var i="Failed to execute 'postMessage' on 'DOMWindow': The target origin provided or the recipient window's origin are undefined.";return console.log(i),!1}if(!Microsoft.Office.Common.XdmCommunicationManager.urlCompare(n,r)){i="Failed to execute 'postMessage' on 'DOMWindow': The target origin provided ('"+(n?n.protocol+"//"+n.hostname+(n.port?":"+n.port:""):"undefined")+"') does not match the recipient window's origin ('"+(r?r.protocol+"//"+r.hostname+(r.port?":"+r.port:""):"undefined")+"').";return console.log(i),!1}return!0};try{if("dialogMessageReceived"===l._actionName&&"*"!==e.targetOrigin){if(e.targetOrigin&&!t(e.targetOrigin,l._requesterUrl))return}else if("dialogParentMessageReceived"===l._actionName&&e.targetOrigin&&"*"!==e.targetOrigin&&!t(e.targetOrigin,l._requesterUrl))return;var n=new Microsoft.Office.Common.Response(l._actionName,l._conversationId,l._correlationId,l._invokeResultCode,l._responseType,e),r=Microsoft.Office.Common.MessagePackager.envelope(n,a);l._requesterWindow.postMessage(r,l._requesterUrl)}catch(e){OsfMsAjaxFactory.msAjaxDebug.trace("ResponseSender._send error:"+e.message)}}},Microsoft.Office.Common.ResponseSender.prototype={getRequesterWindow:function(){return this._requesterWindow},getRequesterUrl:function(){return this._requesterUrl},getActionName:function(){return this._actionName},getConversationId:function(){return this._conversationId},getCorrelationId:function(){return this._correlationId},getSend:function(){return this._send},setResultCode:function(e){this._invokeResultCode=e}},Microsoft.Office.Common.InvokeCompleteCallback=function(e,t,n,r,i,o,a){Microsoft.Office.Common.InvokeCompleteCallback.uber.constructor.call(this,e,t,n,r,i,Microsoft.Office.Common.ResponseType.forCalling,a),this._postCallbackHandler=o;var s=this;this._send=function(e,t){void 0!=t&&(s._invokeResultCode=t);try{var n=new Microsoft.Office.Common.Response(s._actionName,s._conversationId,s._correlationId,s._invokeResultCode,s._responseType,e),r=Microsoft.Office.Common.MessagePackager.envelope(n,a);s._requesterWindow.postMessage(r,s._requesterUrl),s._postCallbackHandler()}catch(e){OsfMsAjaxFactory.msAjaxDebug.trace("InvokeCompleteCallback._send error:"+e.message)}}},OSF.OUtil.extend(Microsoft.Office.Common.InvokeCompleteCallback,Microsoft.Office.Common.ResponseSender),Microsoft.Office.Common.Invoker=function(e,t,n,r,i,o,a){var s=Function._validateParams(arguments,[{name:"methodObject",mayBeNull:!1},{name:"paramValue",mayBeNull:!0},{name:"invokeCompleteCallback",mayBeNull:!1},{name:"eventHandlerProxyList",mayBeNull:!0},{name:"conversationId",type:String,mayBeNull:!1},{name:"eventName",type:String,mayBeNull:!1},{name:"serializerVersion",type:Number,mayBeNull:!0,optional:!0}]);if(s)throw s;this._methodObject=e,this._param=t,this._invokeCompleteCallback=n,this._eventHandlerProxyList=r,this._conversationId=i,this._eventName=o,this._serializerVersion=a},Microsoft.Office.Common.Invoker.prototype={invoke:function(){try{var e;switch(this._methodObject.getInvokeType()){case Microsoft.Office.Common.InvokeType.async:this._methodObject.getMethod()(this._param,this._invokeCompleteCallback.getSend());break;case Microsoft.Office.Common.InvokeType.sync:e=this._methodObject.getMethod()(this._param),this._invokeCompleteCallback.getSend()(e);break;case Microsoft.Office.Common.InvokeType.syncRegisterEvent: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 Microsoft.Office.Common.InvokeType.syncUnregisterEvent: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 Microsoft.Office.Common.InvokeType.asyncRegisterEvent: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 Microsoft.Office.Common.InvokeType.asyncUnregisterEvent: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(Microsoft.Office.Common.InvokeResultCode.errorInResponse),this._invokeCompleteCallback.getSend()(e)}},getInvokeBlockingFlag:function(){return this._methodObject.getBlockingFlag()},_createEventHandlerProxyObject:function(e){return new Microsoft.Office.Common.ResponseSender(e.getRequesterWindow(),e.getRequesterUrl(),e.getActionName(),e.getConversationId(),e.getCorrelationId(),Microsoft.Office.Common.ResponseType.forEventing,this._serializerVersion)}},OSF.OUtil.setNamespace("WAC",OSF.DDA),OSF.DDA.WAC.UniqueArguments={Data:"Data",Properties:"Properties",BindingRequest:"DdaBindingsMethod",BindingResponse:"Bindings",SingleBindingResponse:"singleBindingResponse",GetData:"DdaGetBindingData",AddRowsColumns:"DdaAddRowsColumns",SetData:"DdaSetBindingData",ClearFormats:"DdaClearBindingFormats",SetFormats:"DdaSetBindingFormats",SettingsRequest:"DdaSettingsMethod",BindingEventSource:"ddaBinding",ArrayData:"ArrayData"},OSF.OUtil.setNamespace("Delegate",OSF.DDA.WAC),OSF.DDA.WAC.Delegate.SpecialProcessor=function(){var e=[OSF.DDA.WAC.UniqueArguments.SingleBindingResponse,OSF.DDA.WAC.UniqueArguments.BindingRequest,OSF.DDA.WAC.UniqueArguments.BindingResponse,OSF.DDA.WAC.UniqueArguments.GetData,OSF.DDA.WAC.UniqueArguments.AddRowsColumns,OSF.DDA.WAC.UniqueArguments.SetData,OSF.DDA.WAC.UniqueArguments.ClearFormats,OSF.DDA.WAC.UniqueArguments.SetFormats,OSF.DDA.WAC.UniqueArguments.SettingsRequest,OSF.DDA.WAC.UniqueArguments.BindingEventSource];OSF.DDA.WAC.Delegate.SpecialProcessor.uber.constructor.call(this,e,{})},OSF.OUtil.extend(OSF.DDA.WAC.Delegate.SpecialProcessor,OSF.DDA.SpecialProcessor),OSF.DDA.WAC.Delegate.ParameterMap=OSF.DDA.getDecoratedParameterMap(new OSF.DDA.WAC.Delegate.SpecialProcessor,[]),OSF.OUtil.setNamespace("WAC",OSF.DDA),OSF.OUtil.setNamespace("Delegate",OSF.DDA.WAC),OSF.DDA.WAC.getDelegateMethods=function(){var e={};return e[OSF.DDA.DispIdHost.Delegates.ExecuteAsync]=OSF.DDA.WAC.Delegate.executeAsync,e[OSF.DDA.DispIdHost.Delegates.RegisterEventAsync]=OSF.DDA.WAC.Delegate.registerEventAsync,e[OSF.DDA.DispIdHost.Delegates.UnregisterEventAsync]=OSF.DDA.WAC.Delegate.unregisterEventAsync,e[OSF.DDA.DispIdHost.Delegates.OpenDialog]=OSF.DDA.WAC.Delegate.openDialog,e[OSF.DDA.DispIdHost.Delegates.MessageParent]=OSF.DDA.WAC.Delegate.messageParent,e[OSF.DDA.DispIdHost.Delegates.SendMessage]=OSF.DDA.WAC.Delegate.sendMessage,e[OSF.DDA.DispIdHost.Delegates.CloseDialog]=OSF.DDA.WAC.Delegate.closeDialog,e},OSF.DDA.WAC.Delegate.version=1,OSF.DDA.WAC.Delegate.executeAsync=function(e){e.hostCallArgs||(e.hostCallArgs={}),e.hostCallArgs.DdaMethod={ControlId:OSF._OfficeAppFactory.getId(),Version:OSF.DDA.WAC.Delegate.version,DispatchId:e.dispId},e.hostCallArgs.__timeout__=-1,e.onCalling&&e.onCalling(),OSF.getClientEndPoint()&&OSF.getClientEndPoint().invoke("executeMethod",(function(t,n){var r;if(e.onReceiving&&e.onReceiving(),t==Microsoft.Office.Common.InvokeResultCode.noError)OSF.DDA.WAC.Delegate.version=n.Version,r=n.Error;else switch(t){case Microsoft.Office.Common.InvokeResultCode.errorHandlingRequestAccessDenied:r=OSF.DDA.ErrorCodeManager.errorCodes.ooeNoCapability;break;default:r=OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError}e.onComplete&&e.onComplete(r,n)}),e.hostCallArgs)},OSF.DDA.WAC.Delegate._getOnAfterRegisterEvent=function(e,t){var n=(new Date).getTime();return function(r,i){var o;if(t.onReceiving&&t.onReceiving(),r!=Microsoft.Office.Common.InvokeResultCode.noError)switch(r){case Microsoft.Office.Common.InvokeResultCode.errorHandlingRequestAccessDenied:o=OSF.DDA.ErrorCodeManager.errorCodes.ooeNoCapability;break;default:o=OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError}else o=i?i.Error?i.Error:OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess:OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError;t.onComplete&&t.onComplete(o),OSF.AppTelemetry&&OSF.AppTelemetry.onRegisterDone(e,t.dispId,Math.abs((new Date).getTime()-n),o)}},OSF.DDA.WAC.Delegate.registerEventAsync=function(e){e.onCalling&&e.onCalling(),OSF.getClientEndPoint()&&OSF.getClientEndPoint().registerForEvent(OSF.DDA.getXdmEventName(e.targetId,e.eventType),(function(t){e.onEvent&&e.onEvent(t),OSF.AppTelemetry&&OSF.AppTelemetry.onEventDone(e.dispId)}),OSF.DDA.WAC.Delegate._getOnAfterRegisterEvent(!0,e),{controlId:OSF._OfficeAppFactory.getId(),eventDispId:e.dispId,targetId:e.targetId})},OSF.DDA.WAC.Delegate.unregisterEventAsync=function(e){e.onCalling&&e.onCalling(),OSF.getClientEndPoint()&&OSF.getClientEndPoint().unregisterForEvent(OSF.DDA.getXdmEventName(e.targetId,e.eventType),OSF.DDA.WAC.Delegate._getOnAfterRegisterEvent(!1,e),{controlId:OSF._OfficeAppFactory.getId(),eventDispId:e.dispId,targetId:e.targetId})},OSF.OUtil.setNamespace("WebApp",OSF),OSF.OUtil.setNamespace("Messaging",OSF),OSF.OUtil.setNamespace("ExtensionLifeCycle",OSF),OSF.OUtil.setNamespace("TaskPaneAction",OSF),OSF.OUtil.setNamespace("RibbonGallery",OSF),OSF.WebApp.AddHostInfoAndXdmInfo=function(e){return OSF._OfficeAppFactory.getWindowLocationSearch&&OSF._OfficeAppFactory.getWindowLocationHash?e+OSF._OfficeAppFactory.getWindowLocationSearch()+OSF._OfficeAppFactory.getWindowLocationHash():e},OSF.WebApp._UpdateLinksForHostAndXdmInfo=function(){for(var e=document.querySelectorAll("a[data-officejs-navigate]"),t=0;t0?e.substr(0,t):null,r=null===n||("http"===n.toLowerCase()||"https"===n.toLowerCase());return r=r&&"#"!=e&&"/"!=e&&""!=e&&e!=OSF._OfficeAppFactory.getWebAppState().webAppUrl},OSF.InitializationHelper=function(e,t,n,r,i){this._hostInfo=e,this._webAppState=t,this._context=n,this._settings=r,this._hostFacade=i,this._appContext={},this._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'])",this._initializeSettings=function(e,t){var n=e.get_settings(),r=OSF.OUtil.getSessionStorage();if(r){var i=r.getItem(OSF._OfficeAppFactory.getCachedSessionSettingsKey());i?n=JSON.parse(i):(i=JSON.stringify(n),r.setItem(OSF._OfficeAppFactory.getCachedSessionSettingsKey(),i))}var o=OSF.DDA.SettingsManager.deserializeSettings(n);return t?new OSF.DDA.RefreshableSettings(o):new OSF.DDA.Settings(o)};!function(e){var t=window.open;e.open=function(e,n,r){var i=null;try{i=t(e,n,r)}catch(e){OSF.AppTelemetry&&OSF.AppTelemetry.logAppCommonMessage("Exception happens at windowOpen."+e)}if(!i){var o={strUrl:e,strWindowName:n,strWindowFeatures:r};OSF._OfficeAppFactory.getClientEndPoint()&&OSF._OfficeAppFactory.getClientEndPoint().invoke("ContextActivationManager_openWindowInHost",null,o)}return i}}(window)},OSF.InitializationHelper.prototype.saveAndSetDialogInfo=function(e){var t=OSF.OUtil.getSessionStorage();if(t){if(e||(e=OSF.OUtil.parseHostInfoFromWindowName(!0,OSF._OfficeAppFactory.getWindowName())),e&&e.indexOf("isDialog")>-1){var n=function(){var e=OSF.OUtil.parseXdmInfo(!0);return e?e.split("|")[1]:null}();return null!=n&&t.setItem(n+"IsDialog","true"),void(this._hostInfo.isDialog=!0)}this._hostInfo.isDialog=null!=t.getItem(OSF.OUtil.getXdmFieldValue(OSF.XdmFieldName.AppId,!1)+"IsDialog")}},OSF.InitializationHelper.prototype.getAppContext=function(e,t){OSF.AppTelemetry&&OSF.AppTelemetry.logAppCommonMessage("OsfControl activation lifecycle: getAppContext got called.");var n=this,r=function(e,r){var i;if(r._appName===OSF.AppName.ExcelWebApp){var o=r._settings;for(var a in i={},o){var s=o[a];i[s[0]]=s[1]}}else i=r._settings;if(r._appName===OSF.AppName.OutlookWebApp&&r._requirementMatrix&&-1==r._requirementMatrix.indexOf("react")&&(OSF.AgaveHostAction.SendTelemetryEvent=void 0),!n._hostInfo.isDialog||null==window.opener){var l=window.location.origin;n._webAppState.clientEndPoint.invoke("ContextActivationManager_notifyHost",null,[n._webAppState.id,OSF.AgaveHostAction.UpdateTargetUrl,l])}if(0!==e||void 0==r._id||void 0==r._appName||void 0==r._appVersion||void 0==r._appUILocale||void 0==r._dataLocale||void 0==r._docUrl||void 0==r._clientMode||void 0==r._settings||void 0==r._reason){var u="Function ContextActivationManager_getAppContextAsync call failed. ErrorCode is "+e+", exception: "+r;throw OSF.AppTelemetry&&OSF.AppTelemetry.logAppException(u),u}n._appContext=r;var c=r._appInstanceId?r._appInstanceId:r._id,p=0;void 0!=r._appMinorVersion&&(p=r._appMinorVersion);var h=void 0;void 0!=r._requirementMatrix&&(h=r._requirementMatrix),r.eToken=r.eToken?r.eToken:"";var f=new OSF.OfficeAppContext(r._id,r._appName,r._appVersion,r._appUILocale,r._dataLocale,r._docUrl,r._clientMode,i,r._reason,r._osfControlType,r._eToken,r._correlationId,c,!1,!0,p,h,r._hostCustomMessage,r._hostFullVersion,r._clientWindowHeight,r._clientWindowWidth,r._addinName,r._appDomains,r._dialogRequirementMatrix,r._featureGates,void 0,r._initialDisplayMode);f._wacHostEnvironment=r._wacHostEnvironment||"0",f._isFromWacAutomation=!!r._isFromWacAutomation,OSF.AppTelemetry&&OSF.AppTelemetry.initialize(f),t(f)};try{if(this._hostInfo.isDialog&&null!=window.opener)r(0,OfficeExt.WACUtils.parseAppContextFromWindowName(!1,OSF._OfficeAppFactory.getWindowName()));else this._webAppState.clientEndPoint.invoke("ContextActivationManager_getAppContextAsync",r,this._webAppState.id)}catch(e){throw OSF.AppTelemetry&&OSF.AppTelemetry.logAppException("Exception thrown when trying to invoke getAppContextAsync. Exception:["+e+"]"),e}},OSF.InitializationHelper.prototype.isHostOriginTrusted=function(e){},OSF.InitializationHelper.prototype.checkReceiverOriginAndRun=function(e){var t=this,n=OSF.OUtil.parseUrl(t._webAppState.clientEndPoint._targetUrl,!1),r="https:"==n.protocol;if(t._webAppState.clientEndPoint._hostTrustCheckStatus===Microsoft.Office.Common.HostTrustStatus.unknown&&(r||(t._webAppState.clientEndPoint._hostTrustCheckStatus=Microsoft.Office.Common.HostTrustStatus.nothttps),t._webAppState.clientEndPoint._hostTrustCheckStatus!=Microsoft.Office.Common.HostTrustStatus.nothttps)){var i=Microsoft.Office.Common.XdmCommunicationManager.isHostNameValidWacDomain(n.hostname);t.isHostOriginTrusted&&(i=i||t.isHostOriginTrusted(n.hostname)),i&&(t._webAppState.clientEndPoint._hostTrustCheckStatus=Microsoft.Office.Common.HostTrustStatus.trusted)}if(t._webAppState.clientEndPoint._checkStatusLogged||null==t._hostInfo||void 0===t._hostInfo||(OSF.AppTelemetry.onCheckWACHost(t._webAppState.clientEndPoint._hostTrustCheckStatus,t._webAppState.id,t._hostInfo.hostType,t._hostInfo.hostPlatform,t._webAppState.clientEndPoint._targetUrl),t._webAppState.clientEndPoint._checkStatusLogged=!0),t._webAppState.clientEndPoint._hostTrustCheckStatus!=Microsoft.Office.Common.HostTrustStatus.trusted){var o=function(){var i=OSF._OfficeAppFactory.getLoadScriptHelper().getOfficeJsBasePath().match(/^https?:\/\/[^:/?#]*(?::([0-9]+))?/);if(i&&i[0]){var o=OSF._OfficeAppFactory.getLoadScriptHelper().getOfficeJsBasePath()+"AgaveErrorUX/index.html#",a={error:"NotTrustedWAC",locale:OSF.getSupportedLocale(t._hostInfo.hostLocale,OSF.ConstantNames.DefaultLocale),hostname:n.hostname,noHttps:!r,validate:!1},s=document.createElement("iframe");s.style.visibility="hidden",s.style.height="0",s.style.width="0",OSF.OUtil.addEventListener(window,"message",(function n(r){if(r.source==s.contentWindow&&r.origin==i[0])try{var l=JSON.parse(r.data);Function._validateParams(l,[{name:"hostUserTrusted",type:Boolean,mayBeNull:!1}]);!0===l.hostUserTrusted?(t._webAppState.clientEndPoint._hostTrustCheckStatus=Microsoft.Office.Common.HostTrustStatus.trusted,OSF.OUtil.removeEventListener(window,"message",n),document.body.removeChild(s)):(a.validate=!1,window.location.replace(o+encodeURIComponent(JSON.stringify(a)))),e()}catch(e){document.body.innerHTML=Strings.OfficeOM.L_NotTrustedWAC}})),a.validate=!0,s.setAttribute("src",o+encodeURIComponent(JSON.stringify(a))),s.onload=function(){var e={hostname:n.hostname,noHttps:!r};s.contentWindow.postMessage(JSON.stringify(e),i[0])},document.body.appendChild(s)}else document.body.innerHTML=Strings.OfficeOM.L_NotTrustedWAC;if(OSF.OUtil.checkFlight(OSF.FlightNames.AddinEnforceHttps)&&!r)throw new Error("NotHttps")};if(document.body)o();else{var a=!1;document.addEventListener("DOMContentLoaded",(function(){a||(a=!0,o())}))}}else e()},OSF.InitializationHelper.prototype.setAgaveHostCommunication=function(){try{var e=this,t=OSF.OUtil.parseXdmInfoWithGivenFragment(!1,OSF._OfficeAppFactory.getWindowLocationHash());if(!t&&OSF._OfficeAppFactory.getWindowName&&(t=OSF.OUtil.parseXdmInfoFromWindowName(!1,OSF._OfficeAppFactory.getWindowName())),t){var n=OSF.OUtil.getInfoItems(t);void 0!=n&&n.length>=3&&(e._webAppState.conversationID=n[0],e._webAppState.id=n[1],e._webAppState.webAppUrl=n[2].indexOf(":")>=0?n[2]:decodeURIComponent(n[2]))}e._webAppState.wnd=null!=window.opener?window.opener:window.parent;var r=OSF.OUtil.parseSerializerVersionWithGivenFragment(!1,OSF._OfficeAppFactory.getWindowLocationHash());if(isNaN(r)&&OSF._OfficeAppFactory.getWindowName&&(r=OSF.OUtil.parseSerializerVersionFromWindowName(!1,OSF._OfficeAppFactory.getWindowName())),e._webAppState.serializerVersion=r,this._hostInfo.isDialog&&null!=window.opener)return;e._webAppState.clientEndPoint=Microsoft.Office.Common.XdmCommunicationManager.connect(e._webAppState.conversationID,e._webAppState.wnd,e._webAppState.webAppUrl,e._webAppState.serializerVersion),e._webAppState.serviceEndPoint=Microsoft.Office.Common.XdmCommunicationManager.createServiceEndPoint(e._webAppState.id),e._webAppState.clientEndPoint._checkReceiverOriginAndRun=function(t){e.checkReceiverOriginAndRun(t)};var i=e._webAppState.conversationID+OSF.SharedConstants.NotificationConversationIdSuffix;e._webAppState.serviceEndPoint.registerConversation(i,e._webAppState.webAppUrl);e._webAppState.serviceEndPoint.registerMethod("Office_notifyAgave",(function(t){var n;switch(n="string"==typeof t?t:t[0]){case OSF.AgaveHostAction.Select:e._webAppState.focused=!0;break;case OSF.AgaveHostAction.UnSelect:e._webAppState.focused=!1;break;case OSF.AgaveHostAction.TabIn:case OSF.AgaveHostAction.CtrlF6In:window.focus();var r=document.querySelectorAll(e._tabbableElements);OSF.OUtil.focusToFirstTabbable(r,!1)||(window.blur(),e._webAppState.focused=!1,e._webAppState.clientEndPoint.invoke("ContextActivationManager_notifyHost",null,[e._webAppState.id,OSF.AgaveHostAction.ExitNoFocusable]));break;case OSF.AgaveHostAction.TabInShift:window.focus();r=document.querySelectorAll(e._tabbableElements);OSF.OUtil.focusToFirstTabbable(r,!0)||(window.blur(),e._webAppState.focused=!1,e._webAppState.clientEndPoint.invoke("ContextActivationManager_notifyHost",null,[e._webAppState.id,OSF.AgaveHostAction.ExitNoFocusableShift]));break;case OSF.AgaveHostAction.SendMessage:if(window.Office.context.messaging.onMessage){var i=t[1];window.Office.context.messaging.onMessage(i)}break;case OSF.AgaveHostAction.TaskPaneHeaderButtonClicked:window.Office.context.ui.taskPaneAction.onHeaderButtonClick&&window.Office.context.ui.taskPaneAction.onHeaderButtonClick();break;default:OsfMsAjaxFactory.msAjaxDebug.trace("actionId "+n+" notifyAgave is wrong.")}}),Microsoft.Office.Common.InvokeType.async,!1),e.addOrRemoveEventListenersForWindow(!0)}catch(e){throw OSF.AppTelemetry&&OSF.AppTelemetry.logAppException("Exception thrown in setAgaveHostCommunication. Exception:["+e+"]"),e}},OSF.InitializationHelper.prototype.addOrRemoveEventListenersForWindow=function(e){var t=this,n=function(){t._webAppState.focused||(t._webAppState.focused=!0),t._webAppState.clientEndPoint.invoke("ContextActivationManager_notifyHost",null,[t._webAppState.id,OSF.AgaveHostAction.Select])},r=function(){OSF&&(t._webAppState.focused&&(t._webAppState.focused=!1),t._webAppState.clientEndPoint.invoke("ContextActivationManager_notifyHost",null,[t._webAppState.id,OSF.AgaveHostAction.UnSelect]))},i=function(e){if(e.preventDefault=e.preventDefault||function(){e.returnValue=!1},117==e.keyCode&&(e.ctrlKey||e.metaKey)){e.preventDefault();var n=OSF.AgaveHostAction.CtrlF6Exit;e.shiftKey&&(n=OSF.AgaveHostAction.CtrlF6ExitShift),t._webAppState.clientEndPoint.invoke("ContextActivationManager_notifyHost",null,[t._webAppState.id,n])}else if(9==e.keyCode){var r=t._appContext._appSettings&&(t._appContext._appSettings.PowerPointModernSlideShowEnabled||!1)&&t._appContext._appName==OSF.AppName.PowerpointWebApp&&t._appContext._clientMode==OSF.ClientMode.ReadOnly&&t._appContext._osfControlType==OSF.OsfControlType.DocumentLevel;r||e.preventDefault();var i=document.querySelectorAll(t._tabbableElements);OSF.OUtil.focusToNextTabbable(i,e.target||e.srcElement,e.shiftKey)?r&&e.preventDefault():t._hostInfo.isDialog?OSF.OUtil.focusToFirstTabbable(i,e.shiftKey):e.shiftKey?r||t._webAppState.clientEndPoint.invoke("ContextActivationManager_notifyHost",null,[t._webAppState.id,OSF.AgaveHostAction.TabExitShift]):OSF.OUtil.checkFlight(OSF.FlightNames.SetFocusToTaskpaneIsEnabled)&&e.target&&"BODY"===e.target.tagName.toUpperCase()?OSF.OUtil.focusToFirstTabbable(i,e.shiftKey):r||t._webAppState.clientEndPoint.invoke("ContextActivationManager_notifyHost",null,[t._webAppState.id,OSF.AgaveHostAction.TabExit])}else if(27==e.keyCode)e.preventDefault(),t.dismissDialogNotification&&t.dismissDialogNotification(),t._webAppState.clientEndPoint.invoke("ContextActivationManager_notifyHost",null,[t._webAppState.id,OSF.AgaveHostAction.EscExit]);else if(113==e.keyCode)e.preventDefault(),t._webAppState.clientEndPoint.invoke("ContextActivationManager_notifyHost",null,[t._webAppState.id,OSF.AgaveHostAction.F2Exit]);else if((e.ctrlKey||e.metaKey||e.shiftKey||e.altKey)&&e.keyCode>=1&&e.keyCode<=255){var o={keyCode:e.keyCode,shiftKey:e.shiftKey,altKey:e.altKey,ctrlKey:e.ctrlKey,metaKey:e.metaKey};t._webAppState.clientEndPoint.invoke("ContextActivationManager_notifyHost",null,[t._webAppState.id,OSF.AgaveHostAction.KeyboardShortcuts,o])}},o=function(e){117==e.keyCode&&e.ctrlKey&&(e.preventDefault?e.preventDefault():e.returnValue=!1)};e?(OSF.OUtil.addEventListener(window,"focus",n),OSF.OUtil.addEventListener(window,"blur",r),OSF.OUtil.addEventListener(window,"keydown",i),OSF.OUtil.addEventListener(window,"keypress",o)):(OSF.OUtil.removeEventListener(window,"focus",n),OSF.OUtil.removeEventListener(window,"blur",r),OSF.OUtil.removeEventListener(window,"keydown",i),OSF.OUtil.removeEventListener(window,"keypress",o))},OSF.InitializationHelper.prototype.initWebDialog=function(e){if(e.get_isDialog()){if(OSF.DDA.UI.ChildUI){var t=null!=window.opener;e.ui=new OSF.DDA.UI.ChildUI(t),t&&this.registerMessageReceivedEventForWindowDialog&&this.registerMessageReceivedEventForWindowDialog()}}else OSF.DDA.UI.ParentUI&&(e.ui=new OSF.DDA.UI.ParentUI,OfficeExt.Container&&OSF.DDA.DispIdHost.addAsyncMethods(e.ui,[OSF.DDA.AsyncMethodNames.CloseContainerAsync]))},OSF.InitializationHelper.prototype.initWebAuth=function(e){OSF.DDA.Auth&&(e.auth=new OSF.DDA.Auth,OSF.DDA.DispIdHost.addAsyncMethods(e.auth,[OSF.DDA.AsyncMethodNames.GetAccessTokenAsync]))},OSF.InitializationHelper.prototype.initWebAuthImplicit=function(e){OSF.DDA.WebAuth&&(e.webAuth=new OSF.DDA.WebAuth,OSF.DDA.DispIdHost.addAsyncMethods(e.webAuth,[OSF.DDA.AsyncMethodNames.GetAuthContextAsync]))},OSF.getClientEndPoint=function(){return OSF._OfficeAppFactory.getInitializationHelper()._webAppState.clientEndPoint},OSF.InitializationHelper.prototype.prepareRightAfterWebExtensionInitialize=function(){if(this._hostInfo.isDialog){window.focus();var e=document.querySelectorAll(this._tabbableElements);OSF.OUtil.focusToFirstTabbable(e,!1)||(window.blur(),this._webAppState.focused=!1,this._webAppState.clientEndPoint&&this._webAppState.clientEndPoint.invoke("ContextActivationManager_notifyHost",null,[this._webAppState.id,OSF.AgaveHostAction.ExitNoFocusable]))}},OSF.Messaging.sendMessage=function(e){OSF.getClientEndPoint().invoke("ContextActivationManager_notifyHost",null,[OSF._OfficeAppFactory.getWebAppState().id,OSF.AgaveHostAction.SendMessage,e])},OSF.ExtensionLifeCycle.launchExtensionComponent=function(e){OSF.getClientEndPoint().invoke("ContextActivationManager_notifyHost",null,[OSF._OfficeAppFactory.getWebAppState().id,OSF.AgaveHostAction.LaunchExtensionComponent,e])},OSF.ExtensionLifeCycle.stopExtensionComponent=function(e){OSF.getClientEndPoint().invoke("ContextActivationManager_notifyHost",null,[OSF._OfficeAppFactory.getWebAppState().id,OSF.AgaveHostAction.StopExtensionComponent,e])},OSF.ExtensionLifeCycle.restartExtensionComponent=function(e){OSF.getClientEndPoint().invoke("ContextActivationManager_notifyHost",null,[OSF._OfficeAppFactory.getWebAppState().id,OSF.AgaveHostAction.RestartExtensionComponent,e])},OSF.TaskPaneAction.enableHeaderButton=function(e){OSF.getClientEndPoint().invoke("ContextActivationManager_notifyHost",null,[OSF._OfficeAppFactory.getWebAppState().id,OSF.AgaveHostAction.EnableTaskPaneHeaderButton,e])},OSF.TaskPaneAction.disableHeaderButton=function(){OSF.getClientEndPoint().invoke("ContextActivationManager_notifyHost",null,[OSF._OfficeAppFactory.getWebAppState().id,OSF.AgaveHostAction.DisableTaskPaneHeaderButton])},OSF.RibbonGallery.refreshRibbon=function(e){OSF.getClientEndPoint().invoke("ContextActivationManager_notifyHost",null,[OSF._OfficeAppFactory.getWebAppState().id,OSF.AgaveHostAction.RefreshRibbonGallery,e])},OSF.CommonUI={HostButtonBorderColor:"#86bfa0",HostButtonBackgroundColor:"#d3f0e0"},function(e){var t=function(){function e(e){this._table=e,this._fields={}}return Object.defineProperty(e.prototype,"Fields",{get:function(){return this._fields},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"Table",{get:function(){return this._table},enumerable:!0,configurable:!0}),e.prototype.SerializeFields=function(){},e.prototype.SetSerializedField=function(e,t){"undefined"!==typeof t&&null!==t&&(this._serializedFields[e]=t.toString())},e.prototype.SerializeRow=function(){return this._serializedFields={},this.SetSerializedField("Table",this._table),this.SerializeFields(),JSON.stringify(this._serializedFields)},e}();e.BaseUsageData=t;var n=function(e){function t(){return e.call(this,"AppActivated")||this}return __extends(t,e),Object.defineProperty(t.prototype,"CorrelationId",{get:function(){return this.Fields.CorrelationId},set:function(e){this.Fields.CorrelationId=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"SessionId",{get:function(){return this.Fields.SessionId},set:function(e){this.Fields.SessionId=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"AppId",{get:function(){return this.Fields.AppId},set:function(e){this.Fields.AppId=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"AppInstanceId",{get:function(){return this.Fields.AppInstanceId},set:function(e){this.Fields.AppInstanceId=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"AppURL",{get:function(){return this.Fields.AppURL},set:function(e){this.Fields.AppURL=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"AssetId",{get:function(){return this.Fields.AssetId},set:function(e){this.Fields.AssetId=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"Browser",{get:function(){return this.Fields.Browser},set:function(e){this.Fields.Browser=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"UserId",{get:function(){return this.Fields.UserId},set:function(e){this.Fields.UserId=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"Host",{get:function(){return this.Fields.Host},set:function(e){this.Fields.Host=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"HostVersion",{get:function(){return this.Fields.HostVersion},set:function(e){this.Fields.HostVersion=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"ClientId",{get:function(){return this.Fields.ClientId},set:function(e){this.Fields.ClientId=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"AppSizeWidth",{get:function(){return this.Fields.AppSizeWidth},set:function(e){this.Fields.AppSizeWidth=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"AppSizeHeight",{get:function(){return this.Fields.AppSizeHeight},set:function(e){this.Fields.AppSizeHeight=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"Message",{get:function(){return this.Fields.Message},set:function(e){this.Fields.Message=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"DocUrl",{get:function(){return this.Fields.DocUrl},set:function(e){this.Fields.DocUrl=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"OfficeJSVersion",{get:function(){return this.Fields.OfficeJSVersion},set:function(e){this.Fields.OfficeJSVersion=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"HostJSVersion",{get:function(){return this.Fields.HostJSVersion},set:function(e){this.Fields.HostJSVersion=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"WacHostEnvironment",{get:function(){return this.Fields.WacHostEnvironment},set:function(e){this.Fields.WacHostEnvironment=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"IsFromWacAutomation",{get:function(){return this.Fields.IsFromWacAutomation},set:function(e){this.Fields.IsFromWacAutomation=e},enumerable:!0,configurable:!0}),t.prototype.SerializeFields=function(){this.SetSerializedField("CorrelationId",this.CorrelationId),this.SetSerializedField("SessionId",this.SessionId),this.SetSerializedField("AppId",this.AppId),this.SetSerializedField("AppInstanceId",this.AppInstanceId),this.SetSerializedField("AppURL",this.AppURL),this.SetSerializedField("AssetId",this.AssetId),this.SetSerializedField("Browser",this.Browser),this.SetSerializedField("UserId",this.UserId),this.SetSerializedField("Host",this.Host),this.SetSerializedField("HostVersion",this.HostVersion),this.SetSerializedField("ClientId",this.ClientId),this.SetSerializedField("AppSizeWidth",this.AppSizeWidth),this.SetSerializedField("AppSizeHeight",this.AppSizeHeight),this.SetSerializedField("Message",this.Message),this.SetSerializedField("DocUrl",this.DocUrl),this.SetSerializedField("OfficeJSVersion",this.OfficeJSVersion),this.SetSerializedField("HostJSVersion",this.HostJSVersion),this.SetSerializedField("WacHostEnvironment",this.WacHostEnvironment),this.SetSerializedField("IsFromWacAutomation",this.IsFromWacAutomation)},t}(t);e.AppActivatedUsageData=n;var r=function(e){function t(){return e.call(this,"ScriptLoad")||this}return __extends(t,e),Object.defineProperty(t.prototype,"CorrelationId",{get:function(){return this.Fields.CorrelationId},set:function(e){this.Fields.CorrelationId=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"SessionId",{get:function(){return this.Fields.SessionId},set:function(e){this.Fields.SessionId=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"ScriptId",{get:function(){return this.Fields.ScriptId},set:function(e){this.Fields.ScriptId=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"StartTime",{get:function(){return this.Fields.StartTime},set:function(e){this.Fields.StartTime=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"ResponseTime",{get:function(){return this.Fields.ResponseTime},set:function(e){this.Fields.ResponseTime=e},enumerable:!0,configurable:!0}),t.prototype.SerializeFields=function(){this.SetSerializedField("CorrelationId",this.CorrelationId),this.SetSerializedField("SessionId",this.SessionId),this.SetSerializedField("ScriptId",this.ScriptId),this.SetSerializedField("StartTime",this.StartTime),this.SetSerializedField("ResponseTime",this.ResponseTime)},t}(t);e.ScriptLoadUsageData=r;var i=function(e){function t(){return e.call(this,"AppClosed")||this}return __extends(t,e),Object.defineProperty(t.prototype,"CorrelationId",{get:function(){return this.Fields.CorrelationId},set:function(e){this.Fields.CorrelationId=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"SessionId",{get:function(){return this.Fields.SessionId},set:function(e){this.Fields.SessionId=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"FocusTime",{get:function(){return this.Fields.FocusTime},set:function(e){this.Fields.FocusTime=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"AppSizeFinalWidth",{get:function(){return this.Fields.AppSizeFinalWidth},set:function(e){this.Fields.AppSizeFinalWidth=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"AppSizeFinalHeight",{get:function(){return this.Fields.AppSizeFinalHeight},set:function(e){this.Fields.AppSizeFinalHeight=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"OpenTime",{get:function(){return this.Fields.OpenTime},set:function(e){this.Fields.OpenTime=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"CloseMethod",{get:function(){return this.Fields.CloseMethod},set:function(e){this.Fields.CloseMethod=e},enumerable:!0,configurable:!0}),t.prototype.SerializeFields=function(){this.SetSerializedField("CorrelationId",this.CorrelationId),this.SetSerializedField("SessionId",this.SessionId),this.SetSerializedField("FocusTime",this.FocusTime),this.SetSerializedField("AppSizeFinalWidth",this.AppSizeFinalWidth),this.SetSerializedField("AppSizeFinalHeight",this.AppSizeFinalHeight),this.SetSerializedField("OpenTime",this.OpenTime),this.SetSerializedField("CloseMethod",this.CloseMethod)},t}(t);e.AppClosedUsageData=i;var o=function(e){function t(){return e.call(this,"APIUsage")||this}return __extends(t,e),Object.defineProperty(t.prototype,"CorrelationId",{get:function(){return this.Fields.CorrelationId},set:function(e){this.Fields.CorrelationId=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"SessionId",{get:function(){return this.Fields.SessionId},set:function(e){this.Fields.SessionId=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"APIType",{get:function(){return this.Fields.APIType},set:function(e){this.Fields.APIType=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"APIID",{get:function(){return this.Fields.APIID},set:function(e){this.Fields.APIID=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"Parameters",{get:function(){return this.Fields.Parameters},set:function(e){this.Fields.Parameters=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"ResponseTime",{get:function(){return this.Fields.ResponseTime},set:function(e){this.Fields.ResponseTime=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"ErrorType",{get:function(){return this.Fields.ErrorType},set:function(e){this.Fields.ErrorType=e},enumerable:!0,configurable:!0}),t.prototype.SerializeFields=function(){this.SetSerializedField("CorrelationId",this.CorrelationId),this.SetSerializedField("SessionId",this.SessionId),this.SetSerializedField("APIType",this.APIType),this.SetSerializedField("APIID",this.APIID),this.SetSerializedField("Parameters",this.Parameters),this.SetSerializedField("ResponseTime",this.ResponseTime),this.SetSerializedField("ErrorType",this.ErrorType)},t}(t);e.APIUsageUsageData=o;var a=function(e){function t(){return e.call(this,"AppInitialization")||this}return __extends(t,e),Object.defineProperty(t.prototype,"CorrelationId",{get:function(){return this.Fields.CorrelationId},set:function(e){this.Fields.CorrelationId=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"SessionId",{get:function(){return this.Fields.SessionId},set:function(e){this.Fields.SessionId=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"SuccessCode",{get:function(){return this.Fields.SuccessCode},set:function(e){this.Fields.SuccessCode=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"Message",{get:function(){return this.Fields.Message},set:function(e){this.Fields.Message=e},enumerable:!0,configurable:!0}),t.prototype.SerializeFields=function(){this.SetSerializedField("CorrelationId",this.CorrelationId),this.SetSerializedField("SessionId",this.SessionId),this.SetSerializedField("SuccessCode",this.SuccessCode),this.SetSerializedField("Message",this.Message)},t}(t);e.AppInitializationUsageData=a;var s=function(e){function t(){return e.call(this,"CheckWACHost")||this}return __extends(t,e),Object.defineProperty(t.prototype,"isWacKnownHost",{get:function(){return this.Fields.isWacKnownHost},set:function(e){this.Fields.isWacKnownHost=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"instanceId",{get:function(){return this.Fields.instanceId},set:function(e){this.Fields.instanceId=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"hostType",{get:function(){return this.Fields.hostType},set:function(e){this.Fields.hostType=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"hostPlatform",{get:function(){return this.Fields.hostPlatform},set:function(e){this.Fields.hostPlatform=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"wacDomain",{get:function(){return this.Fields.wacDomain},set:function(e){this.Fields.wacDomain=e},enumerable:!0,configurable:!0}),t.prototype.SerializeFields=function(){this.SetSerializedField("isWacKnownHost",this.isWacKnownHost),this.SetSerializedField("instanceId",this.instanceId),this.SetSerializedField("hostType",this.hostType),this.SetSerializedField("hostPlatform",this.hostPlatform),this.SetSerializedField("wacDomain",this.wacDomain)},t}(t);e.CheckWACHostUsageData=s}(OSFLog||(OSFLog={})),function(e){"use strict";!function(e){e[e.info=0]="info",e[e.warning=1]="warning",e[e.error=2]="error"}(e.TraceLevel||(e.TraceLevel={})),function(e){e[e.none=0]="none",e[e.flush=1]="flush"}(e.SendFlag||(e.SendFlag={})),e.allowUploadingData=function(){},e.sendLog=function(e,t,n){};var t=function(){function e(){}return e.prototype.writeLog=function(e){},e.prototype.loadProxyFrame=function(){},e}();OSF.Logger||(OSF.Logger=e),e.ulsEndpoint=function(){try{return new t}catch(e){return null}}()}(Logger||(Logger={})),function(e){var t=[{name:"AppActivated",enabled:!0,critical:!0,points:[{name:"Browser",type:"string"},{name:"Message",type:"string"},{name:"Host",type:"string"},{name:"AppSizeWidth",type:"int64"},{name:"AppSizeHeight",type:"int64"},{name:"IsFromWacAutomation",type:"string"}]},{name:"ScriptLoad",enabled:!0,critical:!1,points:[{name:"ScriptId",type:"string"},{name:"StartTime",type:"double"},{name:"ResponseTime",type:"double"}]},{name:"APIUsage",enabled:function(){if(!OSF._OfficeAppFactory||!OSF._OfficeAppFactory.getHostInfo)return!1;var e=OSF._OfficeAppFactory.getHostInfo();if(!e)return!1;switch(e.hostType){case"outlook":switch(e.hostPlatform){case"mac":case"web":return!0;default:return!1}default:return!1}}(),critical:!1,points:[{name:"APIType",type:"string"},{name:"APIID",type:"int64"},{name:"Parameters",type:"string"},{name:"ResponseTime",type:"int64"},{name:"ErrorType",type:"int64"}]},{name:"AppInitialization",enabled:!0,critical:!1,points:[{name:"SuccessCode",type:"int64"},{name:"Message",type:"string"}]},{name:"AppClosed",enabled:!0,critical:!1,points:[{name:"FocusTime",type:"int64"},{name:"AppSizeFinalWidth",type:"int64"},{name:"AppSizeFinalHeight",type:"int64"},{name:"OpenTime",type:"int64"}]},{name:"CheckWACHost",enabled:!0,critical:!1,points:[{name:"isWacKnownHost",type:"int64"},{name:"solutionId",type:"string"},{name:"hostType",type:"string"},{name:"hostPlatform",type:"string"},{name:"correlationId",type:"string"}]}];function n(e,t){var n=void 0===t.rename?t.name:t.rename,r=void 0;switch(t.type){case"string":r=oteljs.makeStringDataField(n,e);break;case"double":"string"===typeof e&&(e=parseFloat(e)),r=oteljs.makeDoubleDataField(n,e);break;case"int64":"string"===typeof e&&(e=parseInt(e)),r=oteljs.makeInt64DataField(n,e);break;case"boolean":"string"===typeof e&&(e="true"===e),r=oteljs.makeBooleanDataField(n,e)}return r}function r(e){for(var n=0,r=t;nn[i])return!1}return!1},e.prototype.isDirectToAriaEnabled=function(){if(void 0===this.EnableDirectToAria||null===this.EnableDirectToAria){var e=void 0,t=void 0;OSF._OfficeAppFactory&&OSF._OfficeAppFactory.getHostInfo&&(e=OSF._OfficeAppFactory.getHostInfo().hostPlatform),window.external&&"undefined"!==typeof window.external.GetContext&&"undefined"!==typeof window.external.GetContext().GetHostFullVersion&&(t=window.external.GetContext().GetHostFullVersion()),this.EnableDirectToAria=this.shouldSendDirectToAria(e,t)}return this.EnableDirectToAria},e.prototype.sendTelemetry=function(t,n){e.EnableSendingTelemetryWithLegacyAria&&this.isDirectToAriaEnabled()&&OSF.OUtil.loadScript(this.getAriaCDNLocation(),(function(){try{if(!this.ALogger){this.ALogger=AWTLogManager.initialize("db334b301e7b474db5e0f02f07c51a47-a1b5bc36-1bbe-482f-a64a-c2d9cb606706-7439")}var e=new AWTEventProperties;for(var r in e.setName("Office.Extensibility.OfficeJS."+t),n)"table"!==r.toLowerCase()&&e.setProperty(r,n[r]);var i=new Date;e.setProperty("Date",i.toISOString()),this.ALogger.logEvent(e)}catch(e){}}),1e3),e.EnableSendingTelemetryWithOTel&&i(t,n)},e.prototype.logData=function(e){this.isIUsageData(e)?this.sendTelemetry(e.Table,e.Fields):this.sendTelemetry(e.Table,e)},e.EnableSendingTelemetryWithOTel=!0,e.EnableSendingTelemetryWithLegacyAria=!1,e}();e.AriaLogger=o}(OSFAriaLogger||(OSFAriaLogger={})),function(e){"use strict";var t,n=OSF.OUtil.Guid.generateNewGuid(),r="",i=new RegExp("^https?://store\\.office(ppe|-int)?\\.com/","i");e.enableTelemetry=!0;var o=function(){return function(){}}();e.AppInfo=o;var a=function(){return function(e,t){this.name=e,this.handler=t}}(),s=function(){function e(){this.clientIDKey="Office API client",this.logIdSetKey="Office App Log Id Set"}return e.prototype.getClientId=function(){var e=this.getValue(this.clientIDKey);return(!e||e.length<=0||e.length>40)&&(e=OSF.OUtil.Guid.generateNewGuid(),this.setValue(this.clientIDKey,e)),e},e.prototype.saveLog=function(e,t){var n=this.getValue(this.logIdSetKey);n=(n&&n.length>0?n+";":"")+e,this.setValue(this.logIdSetKey,n),this.setValue(e,t)},e.prototype.enumerateLog=function(e,t){var n=this.getValue(this.logIdSetKey);if(n){var r=n.split(";");for(var i in r){var o=r[i],a=this.getValue(o);a&&(e&&e(o,a),t&&this.remove(o))}t&&this.remove(this.logIdSetKey)}},e.prototype.getValue=function(e){var t=OSF.OUtil.getLocalStorage(),n="";return t&&(n=t.getItem(e)),n},e.prototype.setValue=function(e,t){var n=OSF.OUtil.getLocalStorage();n&&n.setItem(e,t)},e.prototype.remove=function(e){var t=OSF.OUtil.getLocalStorage();if(t)try{t.removeItem(e)}catch(e){}},e}(),l=function(){function t(){}return t.prototype.LogData=function(t){if(e.enableTelemetry)try{OSFAriaLogger.AriaLogger.getInstance().logData(t)}catch(e){}},t.prototype.LogRawData=function(t){if(e.enableTelemetry)try{OSFAriaLogger.AriaLogger.getInstance().logData(JSON.parse(t))}catch(e){}},t}();function u(e){return e&&(e=e.replace(/[{}]/g,"").toLowerCase()),e||""}function c(e,t){var i=new OSFLog.AppInitializationUsageData;i.CorrelationId=u(r),i.SessionId=n,i.SuccessCode=e?1:0,i.Message=t,(new l).LogData(i)}function p(){var e=0!=(OSF._OfficeAppFactory.getHostInfo().flags&OSF.HostInfoFlags.PublicAddin);return e||!!t&&f(OSF._OfficeAppFactory.getHostInfo().hostPlatform,t.hostVersion)}function h(e,t){return p()||t!==e?t:"PRIVATE"}function f(e,t){var n=!1,r=/^(\d+)\.(\d+)\.(\d+)\.(\d+)$/.exec(t);if(r){var i=parseInt(r[1]),o=parseInt(r[2]),a=parseInt(r[3]);"win32"==e?(i<16||16==i&&a<14225)&&(n=!0):"mac"==e&&(i<16||16==i&&(o<52||52==o&&a<808))&&(n=!0)}return n}e.initialize=function(r){if(e.enableTelemetry&&!t){t=new o,r.get_hostFullVersion()?t.hostVersion=r.get_hostFullVersion():t.hostVersion=r.get_appVersion(),t.appId=p()?r.get_id():"PRIVATE",t.browser=window.navigator.userAgent,t.correlationId=u(r.get_correlationId()),t.clientId=(new s).getClientId(),t.appInstanceId=r.get_appInstanceId(),t.appInstanceId&&(t.appInstanceId=u(t.appInstanceId),t.appInstanceId=h(r.get_id(),t.appInstanceId)),t.message=r.get_hostCustomMessage(),t.officeJSVersion=OSF.ConstantNames.FileVersion,t.hostJSVersion="16.0.14621.10000",r._wacHostEnvironment&&(t.wacHostEnvironment=r._wacHostEnvironment),void 0!==r._isFromWacAutomation&&null!==r._isFromWacAutomation&&(t.isFromWacAutomation=r._isFromWacAutomation.toString().toLowerCase());var l=r.get_docUrl();t.docUrl=i.test(l)?l:"";var c=location.href;c&&(c=c.split("?")[0].split("#")[0]),t.appURL="",function(e,t){var n,r;t.assetId="",t.userId="";try{n=decodeURIComponent(e);var i=(r=(new DOMParser).parseFromString(n,"text/xml")).getElementsByTagName("t")[0].attributes.getNamedItem("cid"),o=r.getElementsByTagName("t")[0].attributes.getNamedItem("oid");i&&i.nodeValue?t.userId=i.nodeValue:o&&o.nodeValue&&(t.userId=o.nodeValue),t.assetId=r.getElementsByTagName("t")[0].attributes.getNamedItem("aid").nodeValue}catch(e){}finally{n=null,r=null,null}}(r.get_eToken(),t),t.sessionId=n,"undefined"!==typeof OTel&&OTel.OTelLogger.initialize(t),function(){var t=new Date,n=null,r=0,i=!1,o=function(){document.hasFocus()?null==n&&(n=new Date):n&&(r+=Math.abs((new Date).getTime()-n.getTime()),n=null)},s=[];s.push(new a("focus",o)),s.push(new a("blur",o)),s.push(new a("focusout",o)),s.push(new a("focusin",o));var l=function(){for(var o=0;oe.config.loadDelay)&&(a(t,n),clearInterval(s))}),500);else a(t,n)}))}))}():function(){e.loadAttempts++;var t=OSF._OfficeAppFactory.getLoadScriptHelper().getOfficeJsBasePath()+(e.config&&e.config.debugging?"webauth/webauth.implicit.debug.js":"webauth/webauth.implicit.js");return new OfficeExtension.Promise((function(n,r){OSF.OUtil.loadScript(t,(function(t){"boolean"!==typeof t||t||r(t),"boolean"!==typeof t&&t&&r(t),Implicit||r(new Error("Missing Implicit namespace, Implicit is not loaded.")),e.config?n(Implicit.Load(e.config,OSF._OfficeAppFactory.getHostInfo().osfControlAppCorrelationId)):Implicit.GetAuthConfig().then((function(t){e.config=t,n(Implicit.Load(e.config,OSF._OfficeAppFactory.getHostInfo().osfControlAppCorrelationId))}),(function(){r(null)}))}))}))}()},e.getToken=function(n,r,i,o){return(e.config&&e.config.authFlow===t.AuthCode?BrowserAuth:Implicit).GetToken(n,r,i,!!o)},OSF.WebAuth=e}(OSFWebAuth||(OSFWebAuth={})),function(e){!function(e){var t=function(){return function(e,t,n,r){this.Id=e,this.StoreId=t,this.StoreType=n,this.AppVersion=r}}();e.ExtensionIdentity=t;var n=function(){return function(e,t,n){this.HostType=e,this.FormFactor=t,this.Locale=n}}();e.HostProperties=n;var r=function(){return function(e,t){this.OptionalProperties=e,this.DevProperties=t}}();e.ExtensionLaunchProperties=r;var i=function(){return function(e,t,n,r,i){this.ExtId=e,this.ComponentType=t,this.ComponentId=n,this.HostProps=r,this.OptionalProps=i}}();e.LaunchParameters=i;var o=function(){function e(e,t,n,r,i){this.Id=e,this.ComponentType=t,this.ComponentId=n,this.InstanceToken=r,this.LaunchProperties=i}return e.prototype.SetLaunchProperties=function(e){this.LaunchProperties=e},e.prototype.stop=function(){OSF.ExtensionLifeCycle&&OSF.ExtensionLifeCycle.stopExtensionComponent&&OSF.ExtensionLifeCycle.stopExtensionComponent(this)},e.prototype.restart=function(){OSF.ExtensionLifeCycle&&OSF.ExtensionLifeCycle.restartExtensionComponent&&OSF.ExtensionLifeCycle.restartExtensionComponent(this)},e}();e.ExtensionComponentInstance=o;var a=function(){function e(){}return e.prototype.launchExtensionComponent=function(e,t,n,a,s){if(OSF.ExtensionLifeCycle&&OSF.ExtensionLifeCycle.launchExtensionComponent){var l=OSF.OUtil.Guid.generateNewGuid();null==s&&(s=new r({},{})),s.OptionalProperties.InstanceToken=l;var u=new i(e,t,n,a,s);OSF.ExtensionLifeCycle.launchExtensionComponent(u);var c=new o(e,t,n,l,s);return c.SetLaunchProperties(s),c}},e}();e.ExtensionLifeCycleManager=a}(e.LifeCycle||(e.LifeCycle={}))}(OfficeExt||(OfficeExt={})),Microsoft.Office.WebExtension.FileType={Text:"text",Compressed:"compressed",Pdf:"pdf"},OSF.OUtil.augmentList(OSF.DDA.PropertyDescriptors,{FileProperties:"FileProperties",FileSliceProperties:"FileSliceProperties"}),OSF.DDA.FileProperties={Handle:"FileHandle",FileSize:"FileSize",SliceSize:Microsoft.Office.WebExtension.Parameters.SliceSize},OSF.DDA.File=function(e,t,n){OSF.OUtil.defineEnumerableProperties(this,{size:{value:t},sliceCount:{value:Math.ceil(t/n)}});var r={};r[OSF.DDA.FileProperties.Handle]=e,r[OSF.DDA.FileProperties.SliceSize]=n;var i=OSF.DDA.AsyncMethodNames;OSF.DDA.DispIdHost.addAsyncMethods(this,[i.GetDocumentCopyChunkAsync,i.ReleaseDocumentCopyAsync],r)},OSF.DDA.FileSliceOffset="fileSliceoffset",OSF.DDA.AsyncMethodNames.addNames({GetDocumentCopyAsync:"getFileAsync",GetDocumentCopyChunkAsync:"getSliceAsync",ReleaseDocumentCopyAsync:"closeAsync"}),OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.GetDocumentCopyAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.FileType,enum:Microsoft.Office.WebExtension.FileType}],supportedOptions:[{name:Microsoft.Office.WebExtension.Parameters.SliceSize,value:{types:["number"],defaultValue:4194304}}],checkCallArgs:function(e,t,n){var r=e[Microsoft.Office.WebExtension.Parameters.SliceSize];if(r<=0||r>4194304)throw OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSliceSize;return e},onSucceeded:function(e,t,n){return new OSF.DDA.File(e[OSF.DDA.FileProperties.Handle],e[OSF.DDA.FileProperties.FileSize],n[Microsoft.Office.WebExtension.Parameters.SliceSize])}}),OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.GetDocumentCopyChunkAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.SliceIndex,types:["number"]}],privateStateCallbacks:[{name:OSF.DDA.FileProperties.Handle,value:function(e,t){return t[OSF.DDA.FileProperties.Handle]}},{name:OSF.DDA.FileProperties.SliceSize,value:function(e,t){return t[OSF.DDA.FileProperties.SliceSize]}}],checkCallArgs:function(e,t,n){var r=e[Microsoft.Office.WebExtension.Parameters.SliceIndex];if(r<0||r>=t.sliceCount)throw OSF.DDA.ErrorCodeManager.errorCodes.ooeIndexOutOfRange;return e[OSF.DDA.FileSliceOffset]=parseInt((r*n[OSF.DDA.FileProperties.SliceSize]).toString()),e},onSucceeded:function(e,t,n){var r={};return OSF.OUtil.defineEnumerableProperties(r,{data:{value:e[Microsoft.Office.WebExtension.Parameters.Data]},index:{value:n[Microsoft.Office.WebExtension.Parameters.SliceIndex]},size:{value:e[OSF.DDA.FileProperties.SliceSize]}}),r}}),OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.ReleaseDocumentCopyAsync,privateStateCallbacks:[{name:OSF.DDA.FileProperties.Handle,value:function(e,t){return t[OSF.DDA.FileProperties.Handle]}}]}),OSF.OUtil.setNamespace("Marshaling",OSF.DDA),OSF.OUtil.setNamespace("File",OSF.DDA.Marshaling),function(e){e[e.Handle=0]="Handle",e[e.FileSize=1]="FileSize"}(OSF_DDA_Marshaling_File_FilePropertiesKeys||(OSF_DDA_Marshaling_File_FilePropertiesKeys={})),OSF.DDA.Marshaling.File.FilePropertiesKeys=OSF_DDA_Marshaling_File_FilePropertiesKeys,function(e){e[e.Data=0]="Data",e[e.SliceSize=1]="SliceSize"}(OSF_DDA_Marshaling_File_SlicePropertiesKeys||(OSF_DDA_Marshaling_File_SlicePropertiesKeys={})),OSF.DDA.Marshaling.File.SlicePropertiesKeys=OSF_DDA_Marshaling_File_SlicePropertiesKeys,function(e){e[e.Text=0]="Text",e[e.Compressed=1]="Compressed",e[e.Pdf=2]="Pdf"}(OSF_DDA_Marshaling_File_FileType||(OSF_DDA_Marshaling_File_FileType={})),OSF.DDA.Marshaling.File.FileType=OSF_DDA_Marshaling_File_FileType,function(e){e[e.FileType=0]="FileType",e[e.SliceSize=1]="SliceSize",e[e.Handle=2]="Handle",e[e.SliceIndex=3]="SliceIndex"}(OSF_DDA_Marshaling_File_ParameterKeys||(OSF_DDA_Marshaling_File_ParameterKeys={})),OSF.DDA.Marshaling.File.ParameterKeys=OSF_DDA_Marshaling_File_ParameterKeys,OSF.DDA.WAC.Delegate.ParameterMap.addComplexType(OSF.DDA.PropertyDescriptors.FileProperties),OSF.DDA.WAC.Delegate.ParameterMap.addComplexType(OSF.DDA.PropertyDescriptors.FileSliceProperties),OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.PropertyDescriptors.FileProperties,fromHost:[{name:OSF.DDA.FileProperties.Handle,value:OSF.DDA.Marshaling.File.FilePropertiesKeys.Handle},{name:OSF.DDA.FileProperties.FileSize,value:OSF.DDA.Marshaling.File.FilePropertiesKeys.FileSize}]}),OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.PropertyDescriptors.FileSliceProperties,fromHost:[{name:Microsoft.Office.WebExtension.Parameters.Data,value:OSF.DDA.Marshaling.File.SlicePropertiesKeys.Data},{name:OSF.DDA.FileProperties.SliceSize,value:OSF.DDA.Marshaling.File.SlicePropertiesKeys.SliceSize}]}),OSF.DDA.WAC.Delegate.ParameterMap.define({type:Microsoft.Office.WebExtension.Parameters.FileType,toHost:[{name:Microsoft.Office.WebExtension.FileType.Text,value:OSF.DDA.Marshaling.File.FileType.Text},{name:Microsoft.Office.WebExtension.FileType.Compressed,value:OSF.DDA.Marshaling.File.FileType.Compressed},{name:Microsoft.Office.WebExtension.FileType.Pdf,value:OSF.DDA.Marshaling.File.FileType.Pdf}]}),OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidGetDocumentCopyMethod,toHost:[{name:Microsoft.Office.WebExtension.Parameters.FileType,value:OSF.DDA.Marshaling.File.ParameterKeys.FileType},{name:Microsoft.Office.WebExtension.Parameters.SliceSize,value:OSF.DDA.Marshaling.File.ParameterKeys.SliceSize}],fromHost:[{name:OSF.DDA.PropertyDescriptors.FileProperties,value:OSF.DDA.WAC.Delegate.ParameterMap.self}]}),OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidGetDocumentCopyChunkMethod,toHost:[{name:OSF.DDA.FileProperties.Handle,value:OSF.DDA.Marshaling.File.ParameterKeys.Handle},{name:Microsoft.Office.WebExtension.Parameters.SliceIndex,value:OSF.DDA.Marshaling.File.ParameterKeys.SliceIndex}],fromHost:[{name:OSF.DDA.PropertyDescriptors.FileSliceProperties,value:OSF.DDA.WAC.Delegate.ParameterMap.self}]}),OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidReleaseDocumentCopyMethod,toHost:[{name:OSF.DDA.FileProperties.Handle,value:OSF.DDA.Marshaling.File.ParameterKeys.Handle}]}),Microsoft.Office.WebExtension.TableData=function(e,t){function n(e){if(null==e||void 0==e)return null;try{for(var t=OSF.DDA.DataCoercion.findArrayDimensionality(e,2);t<2;t++)e=[e];return e}catch(e){}}OSF.OUtil.defineEnumerableProperties(this,{headers:{get:function(){return t},set:function(e){t=n(e)}},rows:{get:function(){return e},set:function(t){e=null==t||OSF.OUtil.isArray(t)&&0==t.length?[]:n(t)}}}),this.headers=t,this.rows=e},OSF.DDA.OMFactory=OSF.DDA.OMFactory||{},OSF.DDA.OMFactory.manufactureTableData=function(e){return new Microsoft.Office.WebExtension.TableData(e[OSF.DDA.TableDataProperties.TableRows],e[OSF.DDA.TableDataProperties.TableHeaders])},Microsoft.Office.WebExtension.CoercionType={Text:"text",Matrix:"matrix",Table:"table"},OSF.DDA.DataCoercion=function(){return{findArrayDimensionality:function(e){if(OSF.OUtil.isArray(e)){for(var t=0,n=0;n0)for(var r=0;r0)for(var r=0;r0&&(this._eventHandlers[e]=[],!0)},clearObjectEventHandlers:function(e,t){return null!=this._objectEventHandlers[e]&&null!=this._objectEventHandlers[e][t]&&(this._objectEventHandlers[e][t]=[],!0)},getEventHandlerCount:function(e){return void 0!=this._eventHandlers[e]?this._eventHandlers[e].length:-1},getObjectEventHandlerCount:function(e,t){return null==this._objectEventHandlers[e]||null==this._objectEventHandlers[e][t]?0:this._objectEventHandlers[e][t].length},fireEvent:function(e){if(void 0==e.type)return!1;var t=e.type;if(t&&this._eventHandlers[t]){for(var n=this._eventHandlers[t],r=0;r0){for(var r=t[0];n.length>0;){r(n.shift())}return!0}}return!1},clearQueuedEvent:function(e){e&&this._eventHandlers[e]&&(this._queuedEventsArgs[e]&&(this._queuedEventsArgs[e]=[]))}},OSF.DDA.OMFactory=OSF.DDA.OMFactory||{},OSF.DDA.OMFactory.manufactureEventArgs=function(e,t,n){var r;switch(e){case Microsoft.Office.WebExtension.EventType.DocumentSelectionChanged:r=new OSF.DDA.DocumentSelectionChangedEventArgs(t);break;case Microsoft.Office.WebExtension.EventType.BindingSelectionChanged:r=new OSF.DDA.BindingSelectionChangedEventArgs(this.manufactureBinding(n,t.document),n[OSF.DDA.PropertyDescriptors.Subset]);break;case Microsoft.Office.WebExtension.EventType.BindingDataChanged:r=new OSF.DDA.BindingDataChangedEventArgs(this.manufactureBinding(n,t.document));break;case Microsoft.Office.WebExtension.EventType.SettingsChanged:r=new OSF.DDA.SettingsChangedEventArgs(t);break;case Microsoft.Office.WebExtension.EventType.ActiveViewChanged:r=new OSF.DDA.ActiveViewChangedEventArgs(n);break;case Microsoft.Office.WebExtension.EventType.OfficeThemeChanged:r=new OSF.DDA.Theming.OfficeThemeChangedEventArgs(n);break;case Microsoft.Office.WebExtension.EventType.DocumentThemeChanged:r=new OSF.DDA.Theming.DocumentThemeChangedEventArgs(n);break;case Microsoft.Office.WebExtension.EventType.AppCommandInvoked:r=OSF.DDA.AppCommand.AppCommandInvokedEventArgs.create(n);break;case Microsoft.Office.WebExtension.EventType.ObjectDeleted:case Microsoft.Office.WebExtension.EventType.ObjectSelectionChanged:case Microsoft.Office.WebExtension.EventType.ObjectDataChanged:case Microsoft.Office.WebExtension.EventType.ContentControlAdded:r=new OSF.DDA.ObjectEventArgs(e,n[Microsoft.Office.WebExtension.Parameters.Id]);break;case Microsoft.Office.WebExtension.EventType.RichApiMessage:r=new OSF.DDA.RichApiMessageEventArgs(e,n);break;case Microsoft.Office.WebExtension.EventType.DataNodeInserted:r=new OSF.DDA.NodeInsertedEventArgs(this.manufactureDataNode(n[OSF.DDA.DataNodeEventProperties.NewNode]),n[OSF.DDA.DataNodeEventProperties.InUndoRedo]);break;case Microsoft.Office.WebExtension.EventType.DataNodeReplaced:r=new OSF.DDA.NodeReplacedEventArgs(this.manufactureDataNode(n[OSF.DDA.DataNodeEventProperties.OldNode]),this.manufactureDataNode(n[OSF.DDA.DataNodeEventProperties.NewNode]),n[OSF.DDA.DataNodeEventProperties.InUndoRedo]);break;case Microsoft.Office.WebExtension.EventType.DataNodeDeleted:r=new OSF.DDA.NodeDeletedEventArgs(this.manufactureDataNode(n[OSF.DDA.DataNodeEventProperties.OldNode]),this.manufactureDataNode(n[OSF.DDA.DataNodeEventProperties.NextSiblingNode]),n[OSF.DDA.DataNodeEventProperties.InUndoRedo]);break;case Microsoft.Office.WebExtension.EventType.TaskSelectionChanged:r=new OSF.DDA.TaskSelectionChangedEventArgs(t);break;case Microsoft.Office.WebExtension.EventType.ResourceSelectionChanged:r=new OSF.DDA.ResourceSelectionChangedEventArgs(t);break;case Microsoft.Office.WebExtension.EventType.ViewSelectionChanged:r=new OSF.DDA.ViewSelectionChangedEventArgs(t);break;case Microsoft.Office.WebExtension.EventType.DialogMessageReceived:r=new OSF.DDA.DialogEventArgs(n);break;case Microsoft.Office.WebExtension.EventType.DialogParentMessageReceived:r=new OSF.DDA.DialogParentEventArgs(n);break;case Microsoft.Office.WebExtension.EventType.ItemChanged:if("outlook"!=OSF._OfficeAppFactory.getHostInfo().hostType)throw OsfMsAjaxFactory.msAjaxError.argument(Microsoft.Office.WebExtension.Parameters.EventType,OSF.OUtil.formatString(Strings.OfficeOM.L_NotSupportedEventType,e));r=new OSF.DDA.OlkItemSelectedChangedEventArgs(n),t.initialize(r.initialData),"win32"!=OSF._OfficeAppFactory.getHostInfo().hostPlatform&&"mac"!=OSF._OfficeAppFactory.getHostInfo().hostPlatform||t.setCurrentItemNumber(r.itemNumber.itemNumber);break;case Microsoft.Office.WebExtension.EventType.RecipientsChanged:if("outlook"!=OSF._OfficeAppFactory.getHostInfo().hostType)throw OsfMsAjaxFactory.msAjaxError.argument(Microsoft.Office.WebExtension.Parameters.EventType,OSF.OUtil.formatString(Strings.OfficeOM.L_NotSupportedEventType,e));r=new OSF.DDA.OlkRecipientsChangedEventArgs(n);break;case Microsoft.Office.WebExtension.EventType.AppointmentTimeChanged:if("outlook"!=OSF._OfficeAppFactory.getHostInfo().hostType)throw OsfMsAjaxFactory.msAjaxError.argument(Microsoft.Office.WebExtension.Parameters.EventType,OSF.OUtil.formatString(Strings.OfficeOM.L_NotSupportedEventType,e));r=new OSF.DDA.OlkAppointmentTimeChangedEventArgs(n);break;case Microsoft.Office.WebExtension.EventType.RecurrenceChanged:if("outlook"!=OSF._OfficeAppFactory.getHostInfo().hostType)throw OsfMsAjaxFactory.msAjaxError.argument(Microsoft.Office.WebExtension.Parameters.EventType,OSF.OUtil.formatString(Strings.OfficeOM.L_NotSupportedEventType,e));r=new OSF.DDA.OlkRecurrenceChangedEventArgs(n);break;case Microsoft.Office.WebExtension.EventType.AttachmentsChanged:if("outlook"!=OSF._OfficeAppFactory.getHostInfo().hostType)throw OsfMsAjaxFactory.msAjaxError.argument(Microsoft.Office.WebExtension.Parameters.EventType,OSF.OUtil.formatString(Strings.OfficeOM.L_NotSupportedEventType,e));r=new OSF.DDA.OlkAttachmentsChangedEventArgs(n);break;case Microsoft.Office.WebExtension.EventType.EnhancedLocationsChanged:if("outlook"!=OSF._OfficeAppFactory.getHostInfo().hostType)throw OsfMsAjaxFactory.msAjaxError.argument(Microsoft.Office.WebExtension.Parameters.EventType,OSF.OUtil.formatString(Strings.OfficeOM.L_NotSupportedEventType,e));r=new OSF.DDA.OlkEnhancedLocationsChangedEventArgs(n);break;case Microsoft.Office.WebExtension.EventType.InfobarClicked:if("outlook"!=OSF._OfficeAppFactory.getHostInfo().hostType)throw OsfMsAjaxFactory.msAjaxError.argument(Microsoft.Office.WebExtension.Parameters.EventType,OSF.OUtil.formatString(Strings.OfficeOM.L_NotSupportedEventType,e));r=new OSF.DDA.OlkInfobarClickedEventArgs(n);break;default:throw OsfMsAjaxFactory.msAjaxError.argument(Microsoft.Office.WebExtension.Parameters.EventType,OSF.OUtil.formatString(Strings.OfficeOM.L_NotSupportedEventType,e))}return r},OSF.DDA.AsyncMethodNames.addNames({AddHandlerAsync:"addHandlerAsync",RemoveHandlerAsync:"removeHandlerAsync"}),OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.AddHandlerAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.EventType,enum:Microsoft.Office.WebExtension.EventType,verify:function(e,t,n){return n.supportsEvent(e)}},{name:Microsoft.Office.WebExtension.Parameters.Handler,types:["function"]}],supportedOptions:[],privateStateCallbacks:[]}),OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.RemoveHandlerAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.EventType,enum:Microsoft.Office.WebExtension.EventType,verify:function(e,t,n){return n.supportsEvent(e)}}],supportedOptions:[{name:Microsoft.Office.WebExtension.Parameters.Handler,value:{types:["function","object"],defaultValue:null}}],privateStateCallbacks:[]}),OSF.OUtil.augmentList(Microsoft.Office.WebExtension.EventType,{SettingsChanged:"settingsChanged"}),OSF.DDA.SettingsChangedEventArgs=function(e){OSF.OUtil.defineEnumerableProperties(this,{type:{value:Microsoft.Office.WebExtension.EventType.SettingsChanged},settings:{value:e}})},OSF.DDA.AsyncMethodNames.addNames({RefreshAsync:"refreshAsync",SaveAsync:"saveAsync"}),OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.RefreshAsync,requiredArguments:[],supportedOptions:[],privateStateCallbacks:[{name:OSF.DDA.SettingsManager.RefreshingSettings,value:function(e,t){return t}}],onSucceeded:function(e,t,n){var r=e[OSF.DDA.SettingsManager.SerializedSettings],i=OSF.DDA.SettingsManager.deserializeSettings(r),o=n[OSF.DDA.SettingsManager.RefreshingSettings];for(var a in o)t.remove(a);for(var a in i)t.set(a,i[a]);return t}}),OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.SaveAsync,requiredArguments:[],supportedOptions:[{name:Microsoft.Office.WebExtension.Parameters.OverwriteIfStale,value:{types:["boolean"],defaultValue:!0}}],privateStateCallbacks:[{name:OSF.DDA.SettingsManager.SerializedSettings,value:function(e,t){return OSF.DDA.SettingsManager.serializeSettings(t)}}]}),OSF.DDA.WAC.SettingsTranslator=function(){return{read:function(e){var t=OSF.DDA.ExcelDocument&&Microsoft.Office.WebExtension.context.document&&Microsoft.Office.WebExtension.context.document instanceof OSF.DDA.ExcelDocument,n={},r=e.Settings;for(var i in r){var o=r[i];t?n[o.Name]=o.Value:n[o[0]]=o[1]}return n},write:function(e){var t=[];for(var n in e){var r=[];r[0]=n,r[1]=e[n],t.push(r)}return t}}}(),OSF.DDA.WAC.Delegate.ParameterMap.setDynamicType(OSF.DDA.SettingsManager.SerializedSettings,{toHost:OSF.DDA.WAC.SettingsTranslator.write,fromHost:OSF.DDA.WAC.SettingsTranslator.read}),OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.WAC.UniqueArguments.SettingsRequest,toHost:[{name:Microsoft.Office.WebExtension.Parameters.OverwriteIfStale,value:"OverwriteIfStale"},{name:OSF.DDA.SettingsManager.SerializedSettings,value:OSF.DDA.WAC.UniqueArguments.Properties}],invertible:!0}),OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidLoadSettingsMethod,fromHost:[{name:OSF.DDA.SettingsManager.SerializedSettings,value:OSF.DDA.WAC.UniqueArguments.Properties}]}),OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidSaveSettingsMethod,toHost:[{name:OSF.DDA.WAC.UniqueArguments.SettingsRequest,value:OSF.DDA.WAC.Delegate.ParameterMap.self}]}),OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.EventDispId.dispidSettingsChangedEvent}),Microsoft.Office.WebExtension.BindingType={Table:"table",Text:"text",Matrix:"matrix"},OSF.DDA.BindingProperties={Id:"BindingId",Type:Microsoft.Office.WebExtension.Parameters.BindingType},OSF.OUtil.augmentList(OSF.DDA.ListDescriptors,{BindingList:"BindingList"}),OSF.OUtil.augmentList(OSF.DDA.PropertyDescriptors,{Subset:"subset",BindingProperties:"BindingProperties"}),OSF.DDA.ListType.setListType(OSF.DDA.ListDescriptors.BindingList,OSF.DDA.PropertyDescriptors.BindingProperties),OSF.DDA.BindingPromise=function(e,t){this._id=e,OSF.OUtil.defineEnumerableProperty(this,"onFail",{get:function(){return t},set:function(e){var n=typeof e;if("undefined"!=n&&"function"!=n)throw OSF.OUtil.formatString(Strings.OfficeOM.L_CallbackNotAFunction,n);t=e}})},OSF.DDA.BindingPromise.prototype={_fetch:function(e){if(this.binding)e&&e(this.binding);else if(!this._binding){var t=this;Microsoft.Office.WebExtension.context.document.bindings.getByIdAsync(this._id,(function(n){n.status==Microsoft.Office.WebExtension.AsyncResultStatus.Succeeded?(OSF.OUtil.defineEnumerableProperty(t,"binding",{value:n.value}),e&&e(t.binding)):t.onFail&&t.onFail(n)}))}return this},getDataAsync:function(){var e=arguments;return this._fetch((function(t){t.getDataAsync.apply(t,e)})),this},setDataAsync:function(){var e=arguments;return this._fetch((function(t){t.setDataAsync.apply(t,e)})),this},addHandlerAsync:function(){var e=arguments;return this._fetch((function(t){t.addHandlerAsync.apply(t,e)})),this},removeHandlerAsync:function(){var e=arguments;return this._fetch((function(t){t.removeHandlerAsync.apply(t,e)})),this}},OSF.DDA.BindingFacade=function(e){this._eventDispatches=[],OSF.OUtil.defineEnumerableProperty(this,"document",{value:e});var t=OSF.DDA.AsyncMethodNames;OSF.DDA.DispIdHost.addAsyncMethods(this,[t.AddFromSelectionAsync,t.AddFromNamedItemAsync,t.GetAllAsync,t.GetByIdAsync,t.ReleaseByIdAsync])},OSF.DDA.UnknownBinding=function(e,t){OSF.OUtil.defineEnumerableProperties(this,{document:{value:t},id:{value:e}})},OSF.DDA.Binding=function(e,t){OSF.OUtil.defineEnumerableProperties(this,{document:{value:t},id:{value:e}});var n=OSF.DDA.AsyncMethodNames;OSF.DDA.DispIdHost.addAsyncMethods(this,[n.GetDataAsync,n.SetDataAsync]);var r=Microsoft.Office.WebExtension.EventType,i=t.bindings._eventDispatches;i[e]||(i[e]=new OSF.EventDispatch([r.BindingSelectionChanged,r.BindingDataChanged]));var o=i[e];OSF.DDA.DispIdHost.addEventSupport(this,o)},OSF.DDA.generateBindingId=function(){return"UnnamedBinding_"+OSF.OUtil.getUniqueId()+"_"+(new Date).getTime()},OSF.DDA.OMFactory=OSF.DDA.OMFactory||{},OSF.DDA.OMFactory.manufactureBinding=function(e,t){var n,r=e[OSF.DDA.BindingProperties.Id],i=e[OSF.DDA.BindingProperties.RowCount],o=e[OSF.DDA.BindingProperties.ColumnCount],a=e[OSF.DDA.BindingProperties.HasHeaders];switch(e[OSF.DDA.BindingProperties.Type]){case Microsoft.Office.WebExtension.BindingType.Text:n=new OSF.DDA.TextBinding(r,t);break;case Microsoft.Office.WebExtension.BindingType.Matrix:n=new OSF.DDA.MatrixBinding(r,t,i,o);break;case Microsoft.Office.WebExtension.BindingType.Table:n=new(function(){return OSF.DDA.ExcelDocument&&Microsoft.Office.WebExtension.context.document&&Microsoft.Office.WebExtension.context.document instanceof OSF.DDA.ExcelDocument}()&&OSF.DDA.ExcelTableBinding?OSF.DDA.ExcelTableBinding:OSF.DDA.TableBinding)(r,t,i,o,a);break;default:n=new OSF.DDA.UnknownBinding(r,t)}return n},OSF.DDA.AsyncMethodNames.addNames({AddFromSelectionAsync:"addFromSelectionAsync",AddFromNamedItemAsync:"addFromNamedItemAsync",GetAllAsync:"getAllAsync",GetByIdAsync:"getByIdAsync",ReleaseByIdAsync:"releaseByIdAsync",GetDataAsync:"getDataAsync",SetDataAsync:"setDataAsync"}),function(){function e(e){return OSF.DDA.OMFactory.manufactureBinding(e,Microsoft.Office.WebExtension.context.document)}function t(e){return e.id}OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.AddFromSelectionAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.BindingType,enum:Microsoft.Office.WebExtension.BindingType}],supportedOptions:[{name:Microsoft.Office.WebExtension.Parameters.Id,value:{types:["string"],calculate:OSF.DDA.generateBindingId}},{name:Microsoft.Office.WebExtension.Parameters.Columns,value:{types:["object"],defaultValue:null}}],privateStateCallbacks:[],onSucceeded:e}),OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.AddFromNamedItemAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.ItemName,types:["string"]},{name:Microsoft.Office.WebExtension.Parameters.BindingType,enum:Microsoft.Office.WebExtension.BindingType}],supportedOptions:[{name:Microsoft.Office.WebExtension.Parameters.Id,value:{types:["string"],calculate:OSF.DDA.generateBindingId}},{name:Microsoft.Office.WebExtension.Parameters.Columns,value:{types:["object"],defaultValue:null}}],privateStateCallbacks:[{name:Microsoft.Office.WebExtension.Parameters.FailOnCollision,value:function(){return!0}}],onSucceeded:e}),OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.GetAllAsync,requiredArguments:[],supportedOptions:[],privateStateCallbacks:[],onSucceeded:function(t){return OSF.OUtil.mapList(t[OSF.DDA.ListDescriptors.BindingList],e)}}),OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.GetByIdAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.Id,types:["string"]}],supportedOptions:[],privateStateCallbacks:[],onSucceeded:e}),OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.ReleaseByIdAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.Id,types:["string"]}],supportedOptions:[],privateStateCallbacks:[],onSucceeded:function(e,t,n){var r=n[Microsoft.Office.WebExtension.Parameters.Id];delete t._eventDispatches[r]}}),OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.GetDataAsync,requiredArguments:[],supportedOptions:[{name:Microsoft.Office.WebExtension.Parameters.CoercionType,value:{enum:Microsoft.Office.WebExtension.CoercionType,calculate:function(e,t){return OSF.DDA.DataCoercion.getCoercionDefaultForBinding(t.type)}}},{name:Microsoft.Office.WebExtension.Parameters.ValueFormat,value:{enum:Microsoft.Office.WebExtension.ValueFormat,defaultValue:Microsoft.Office.WebExtension.ValueFormat.Unformatted}},{name:Microsoft.Office.WebExtension.Parameters.FilterType,value:{enum:Microsoft.Office.WebExtension.FilterType,defaultValue:Microsoft.Office.WebExtension.FilterType.All}},{name:Microsoft.Office.WebExtension.Parameters.Rows,value:{types:["object","string"],defaultValue:null}},{name:Microsoft.Office.WebExtension.Parameters.Columns,value:{types:["object"],defaultValue:null}},{name:Microsoft.Office.WebExtension.Parameters.StartRow,value:{types:["number"],defaultValue:0}},{name:Microsoft.Office.WebExtension.Parameters.StartColumn,value:{types:["number"],defaultValue:0}},{name:Microsoft.Office.WebExtension.Parameters.RowCount,value:{types:["number"],defaultValue:0}},{name:Microsoft.Office.WebExtension.Parameters.ColumnCount,value:{types:["number"],defaultValue:0}}],checkCallArgs:function(e,t,n){if(0==e[Microsoft.Office.WebExtension.Parameters.StartRow]&&0==e[Microsoft.Office.WebExtension.Parameters.StartColumn]&&0==e[Microsoft.Office.WebExtension.Parameters.RowCount]&&0==e[Microsoft.Office.WebExtension.Parameters.ColumnCount]&&(delete e[Microsoft.Office.WebExtension.Parameters.StartRow],delete e[Microsoft.Office.WebExtension.Parameters.StartColumn],delete e[Microsoft.Office.WebExtension.Parameters.RowCount],delete e[Microsoft.Office.WebExtension.Parameters.ColumnCount]),e[Microsoft.Office.WebExtension.Parameters.CoercionType]!=OSF.DDA.DataCoercion.getCoercionDefaultForBinding(t.type)&&(e[Microsoft.Office.WebExtension.Parameters.StartRow]||e[Microsoft.Office.WebExtension.Parameters.StartColumn]||e[Microsoft.Office.WebExtension.Parameters.RowCount]||e[Microsoft.Office.WebExtension.Parameters.ColumnCount]))throw OSF.DDA.ErrorCodeManager.errorCodes.ooeCoercionTypeNotMatchBinding;return e},privateStateCallbacks:[{name:Microsoft.Office.WebExtension.Parameters.Id,value:t}],onSucceeded:function(e,t,n){var r=e[Microsoft.Office.WebExtension.Parameters.Data];return OSF.DDA.TableDataProperties&&r&&(void 0!=r[OSF.DDA.TableDataProperties.TableRows]||void 0!=r[OSF.DDA.TableDataProperties.TableHeaders])&&(r=OSF.DDA.OMFactory.manufactureTableData(r)),void 0==(r=OSF.DDA.DataCoercion.coerceData(r,n[Microsoft.Office.WebExtension.Parameters.CoercionType]))?null:r}}),OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.SetDataAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.Data,types:["string","object","number","boolean"]}],supportedOptions:[{name:Microsoft.Office.WebExtension.Parameters.CoercionType,value:{enum:Microsoft.Office.WebExtension.CoercionType,calculate:function(e){return OSF.DDA.DataCoercion.determineCoercionType(e[Microsoft.Office.WebExtension.Parameters.Data])}}},{name:Microsoft.Office.WebExtension.Parameters.Rows,value:{types:["object","string"],defaultValue:null}},{name:Microsoft.Office.WebExtension.Parameters.Columns,value:{types:["object"],defaultValue:null}},{name:Microsoft.Office.WebExtension.Parameters.StartRow,value:{types:["number"],defaultValue:0}},{name:Microsoft.Office.WebExtension.Parameters.StartColumn,value:{types:["number"],defaultValue:0}}],checkCallArgs:function(e,t,n){if(0==e[Microsoft.Office.WebExtension.Parameters.StartRow]&&0==e[Microsoft.Office.WebExtension.Parameters.StartColumn]&&(delete e[Microsoft.Office.WebExtension.Parameters.StartRow],delete e[Microsoft.Office.WebExtension.Parameters.StartColumn]),e[Microsoft.Office.WebExtension.Parameters.CoercionType]!=OSF.DDA.DataCoercion.getCoercionDefaultForBinding(t.type)&&(e[Microsoft.Office.WebExtension.Parameters.StartRow]||e[Microsoft.Office.WebExtension.Parameters.StartColumn]))throw OSF.DDA.ErrorCodeManager.errorCodes.ooeCoercionTypeNotMatchBinding;return e},privateStateCallbacks:[{name:Microsoft.Office.WebExtension.Parameters.Id,value:t}]})}(),OSF.OUtil.augmentList(OSF.DDA.PropertyDescriptors,{TableDataProperties:"TableDataProperties"}),OSF.OUtil.augmentList(OSF.DDA.BindingProperties,{RowCount:"BindingRowCount",ColumnCount:"BindingColumnCount",HasHeaders:"HasHeaders"}),OSF.DDA.TableDataProperties={TableRows:"TableRows",TableHeaders:"TableHeaders"},OSF.DDA.TableBinding=function(e,t,n,r,i){OSF.DDA.TableBinding.uber.constructor.call(this,e,t),OSF.OUtil.defineEnumerableProperties(this,{type:{value:Microsoft.Office.WebExtension.BindingType.Table},rowCount:{value:n||0},columnCount:{value:r||0},hasHeaders:{value:i||!1}});var o=OSF.DDA.AsyncMethodNames;OSF.DDA.DispIdHost.addAsyncMethods(this,[o.AddRowsAsync,o.AddColumnsAsync,o.DeleteAllDataValuesAsync])},OSF.OUtil.extend(OSF.DDA.TableBinding,OSF.DDA.Binding),OSF.DDA.AsyncMethodNames.addNames({AddRowsAsync:"addRowsAsync",AddColumnsAsync:"addColumnsAsync",DeleteAllDataValuesAsync:"deleteAllDataValuesAsync"}),function(){function e(e){return e.id}OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.AddRowsAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.Data,types:["object"]}],supportedOptions:[],privateStateCallbacks:[{name:Microsoft.Office.WebExtension.Parameters.Id,value:e}]}),OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.AddColumnsAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.Data,types:["object"]}],supportedOptions:[],privateStateCallbacks:[{name:Microsoft.Office.WebExtension.Parameters.Id,value:e}]}),OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.DeleteAllDataValuesAsync,requiredArguments:[],supportedOptions:[],privateStateCallbacks:[{name:Microsoft.Office.WebExtension.Parameters.Id,value:e}]})}(),OSF.DDA.WAC.Delegate.ParameterMap.addComplexType(OSF.DDA.PropertyDescriptors.BindingProperties),OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.WAC.UniqueArguments.BindingRequest,toHost:[{name:Microsoft.Office.WebExtension.Parameters.ItemName,value:"ItemName"},{name:Microsoft.Office.WebExtension.Parameters.Id,value:"BindingId"},{name:Microsoft.Office.WebExtension.Parameters.BindingType,value:"BindingType"},{name:Microsoft.Office.WebExtension.Parameters.PromptText,value:"PromptText"},{name:Microsoft.Office.WebExtension.Parameters.Columns,value:"Columns"},{name:Microsoft.Office.WebExtension.Parameters.SampleData,value:"SampleData"},{name:Microsoft.Office.WebExtension.Parameters.FailOnCollision,value:"FailOnCollision"}]}),OSF.DDA.WAC.Delegate.ParameterMap.define({type:Microsoft.Office.WebExtension.Parameters.BindingType,toHost:[{name:Microsoft.Office.WebExtension.BindingType.Text,value:2},{name:Microsoft.Office.WebExtension.BindingType.Matrix,value:3},{name:Microsoft.Office.WebExtension.BindingType.Table,value:1}],invertible:!0}),OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.PropertyDescriptors.BindingProperties,fromHost:[{name:OSF.DDA.BindingProperties.Id,value:"Name"},{name:OSF.DDA.BindingProperties.Type,value:"BindingType"},{name:OSF.DDA.BindingProperties.RowCount,value:"RowCount"},{name:OSF.DDA.BindingProperties.ColumnCount,value:"ColCount"},{name:OSF.DDA.BindingProperties.HasHeaders,value:"HasHeaders"}]}),OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.WAC.UniqueArguments.SingleBindingResponse,fromHost:[{name:OSF.DDA.PropertyDescriptors.BindingProperties,value:0}]}),OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidAddBindingFromSelectionMethod,fromHost:[{name:OSF.DDA.WAC.UniqueArguments.SingleBindingResponse,value:OSF.DDA.WAC.UniqueArguments.BindingResponse}],toHost:[{name:OSF.DDA.WAC.UniqueArguments.BindingRequest,value:OSF.DDA.WAC.Delegate.ParameterMap.self}]}),OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidAddBindingFromNamedItemMethod,fromHost:[{name:OSF.DDA.WAC.UniqueArguments.SingleBindingResponse,value:OSF.DDA.WAC.UniqueArguments.BindingResponse}],toHost:[{name:OSF.DDA.WAC.UniqueArguments.BindingRequest,value:OSF.DDA.WAC.Delegate.ParameterMap.self}]}),OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidReleaseBindingMethod,toHost:[{name:OSF.DDA.WAC.UniqueArguments.BindingRequest,value:OSF.DDA.WAC.Delegate.ParameterMap.self}]}),OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidGetBindingMethod,fromHost:[{name:OSF.DDA.WAC.UniqueArguments.SingleBindingResponse,value:OSF.DDA.WAC.UniqueArguments.BindingResponse}],toHost:[{name:OSF.DDA.WAC.UniqueArguments.BindingRequest,value:OSF.DDA.WAC.Delegate.ParameterMap.self}]}),OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidGetAllBindingsMethod,fromHost:[{name:OSF.DDA.ListDescriptors.BindingList,value:OSF.DDA.WAC.UniqueArguments.BindingResponse}]}),OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidGetBindingDataMethod,fromHost:[{name:Microsoft.Office.WebExtension.Parameters.Data,value:OSF.DDA.WAC.UniqueArguments.Data}],toHost:[{name:OSF.DDA.WAC.UniqueArguments.GetData,value:OSF.DDA.WAC.Delegate.ParameterMap.self}]}),OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidSetBindingDataMethod,toHost:[{name:OSF.DDA.WAC.UniqueArguments.SetData,value:OSF.DDA.WAC.Delegate.ParameterMap.self}]}),OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidAddRowsMethod,toHost:[{name:OSF.DDA.WAC.UniqueArguments.AddRowsColumns,value:OSF.DDA.WAC.Delegate.ParameterMap.self}]}),OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidAddColumnsMethod,toHost:[{name:OSF.DDA.WAC.UniqueArguments.AddRowsColumns,value:OSF.DDA.WAC.Delegate.ParameterMap.self}]}),OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidClearAllRowsMethod,toHost:[{name:OSF.DDA.WAC.UniqueArguments.BindingRequest,value:OSF.DDA.WAC.Delegate.ParameterMap.self}]}),OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.WAC.UniqueArguments.AddRowsColumns,toHost:[{name:Microsoft.Office.WebExtension.Parameters.Id,value:"BindingId"},{name:Microsoft.Office.WebExtension.Parameters.Data,value:OSF.DDA.WAC.UniqueArguments.Data}]}),OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.PropertyDescriptors.Subset,fromHost:[{name:Microsoft.Office.WebExtension.Parameters.StartRow,value:"StartRow"},{name:Microsoft.Office.WebExtension.Parameters.StartColumn,value:"StartCol"},{name:Microsoft.Office.WebExtension.Parameters.RowCount,value:"RowCount"},{name:Microsoft.Office.WebExtension.Parameters.ColumnCount,value:"ColCount"}]}),OSF.OUtil.augmentList(OSF.DDA.BindingProperties,{RowCount:"BindingRowCount",ColumnCount:"BindingColumnCount",HasHeaders:"HasHeaders"}),OSF.DDA.MatrixBinding=function(e,t,n,r){OSF.DDA.MatrixBinding.uber.constructor.call(this,e,t),OSF.OUtil.defineEnumerableProperties(this,{type:{value:Microsoft.Office.WebExtension.BindingType.Matrix},rowCount:{value:n||0},columnCount:{value:r||0}})},OSF.OUtil.extend(OSF.DDA.MatrixBinding,OSF.DDA.Binding),OSF.DDA.TextBinding=function(e,t){OSF.DDA.TextBinding.uber.constructor.call(this,e,t),OSF.OUtil.defineEnumerableProperty(this,"type",{value:Microsoft.Office.WebExtension.BindingType.Text})},OSF.OUtil.extend(OSF.DDA.TextBinding,OSF.DDA.Binding),OSF.DDA.AsyncMethodNames.addNames({AddFromPromptAsync:"addFromPromptAsync"}),OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.AddFromPromptAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.BindingType,enum:Microsoft.Office.WebExtension.BindingType}],supportedOptions:[{name:Microsoft.Office.WebExtension.Parameters.Id,value:{types:["string"],calculate:OSF.DDA.generateBindingId}},{name:Microsoft.Office.WebExtension.Parameters.PromptText,value:{types:["string"],calculate:function(){return Strings.OfficeOM.L_AddBindingFromPromptDefaultText}}},{name:Microsoft.Office.WebExtension.Parameters.SampleData,value:{types:["object"],defaultValue:null}}],privateStateCallbacks:[],onSucceeded:function(e){return OSF.DDA.OMFactory.manufactureBinding(e,Microsoft.Office.WebExtension.context.document)}}),OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidAddBindingFromPromptMethod,fromHost:[{name:OSF.DDA.WAC.UniqueArguments.SingleBindingResponse,value:OSF.DDA.WAC.UniqueArguments.BindingResponse}],toHost:[{name:OSF.DDA.WAC.UniqueArguments.BindingRequest,value:OSF.DDA.WAC.Delegate.ParameterMap.self}]}),OSF.OUtil.augmentList(Microsoft.Office.WebExtension.EventType,{DocumentSelectionChanged:"documentSelectionChanged"}),OSF.DDA.DocumentSelectionChangedEventArgs=function(e){OSF.OUtil.defineEnumerableProperties(this,{type:{value:Microsoft.Office.WebExtension.EventType.DocumentSelectionChanged},document:{value:e}})},OSF.OUtil.augmentList(Microsoft.Office.WebExtension.EventType,{ObjectDeleted:"objectDeleted"}),OSF.OUtil.augmentList(Microsoft.Office.WebExtension.EventType,{ObjectSelectionChanged:"objectSelectionChanged"}),OSF.OUtil.augmentList(Microsoft.Office.WebExtension.EventType,{ObjectDataChanged:"objectDataChanged"}),OSF.OUtil.augmentList(Microsoft.Office.WebExtension.EventType,{ContentControlAdded:"contentControlAdded"}),OSF.DDA.ObjectEventArgs=function(e,t){OSF.OUtil.defineEnumerableProperties(this,{type:{value:e},object:{value:t}})},OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.EventDispId.dispidDocumentSelectionChangedEvent}),OSF.OUtil.augmentList(Microsoft.Office.WebExtension.EventType,{BindingSelectionChanged:"bindingSelectionChanged",BindingDataChanged:"bindingDataChanged"}),OSF.OUtil.augmentList(OSF.DDA.EventDescriptors,{BindingSelectionChangedEvent:"BindingSelectionChangedEvent"}),OSF.DDA.BindingSelectionChangedEventArgs=function(e,t){for(var n in OSF.OUtil.defineEnumerableProperties(this,{type:{value:Microsoft.Office.WebExtension.EventType.BindingSelectionChanged},binding:{value:e}}),t)OSF.OUtil.defineEnumerableProperty(this,n,{value:t[n]})},OSF.DDA.BindingDataChangedEventArgs=function(e){OSF.OUtil.defineEnumerableProperties(this,{type:{value:Microsoft.Office.WebExtension.EventType.BindingDataChanged},binding:{value:e}})},OSF.DDA.WAC.Delegate.ParameterMap.addComplexType(OSF.DDA.EventDescriptors.BindingSelectionChangedEvent),OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.EventDescriptors.BindingSelectionChangedEvent,fromHost:[{name:OSF.DDA.PropertyDescriptors.BindingProperties,value:OSF.DDA.WAC.UniqueArguments.BindingEventSource},{name:OSF.DDA.PropertyDescriptors.Subset,value:OSF.DDA.PropertyDescriptors.Subset}]}),OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.EventDispId.dispidBindingSelectionChangedEvent,fromHost:[{name:OSF.DDA.EventDescriptors.BindingSelectionChangedEvent,value:OSF.DDA.WAC.Delegate.ParameterMap.self}]}),OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.EventDispId.dispidBindingDataChangedEvent,fromHost:[{name:OSF.DDA.PropertyDescriptors.BindingProperties,value:OSF.DDA.WAC.UniqueArguments.BindingEventSource}]}),OSF.DDA.FilePropertiesDescriptor={Url:"Url"},OSF.OUtil.augmentList(OSF.DDA.PropertyDescriptors,{FilePropertiesDescriptor:"FilePropertiesDescriptor"}),Microsoft.Office.WebExtension.FileProperties=function(e){OSF.OUtil.defineEnumerableProperties(this,{url:{value:e[OSF.DDA.FilePropertiesDescriptor.Url]}})},OSF.DDA.AsyncMethodNames.addNames({GetFilePropertiesAsync:"getFilePropertiesAsync"}),OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.GetFilePropertiesAsync,fromHost:[{name:OSF.DDA.PropertyDescriptors.FilePropertiesDescriptor,value:0}],requiredArguments:[],supportedOptions:[],onSucceeded:function(e,t,n){return new Microsoft.Office.WebExtension.FileProperties(e)}}),OSF.OUtil.setNamespace("Marshaling",OSF.DDA),function(e){e[e.Properties=0]="Properties",e[e.Url=1]="Url"}(OSF_DDA_Marshaling_FilePropertiesKeys||(OSF_DDA_Marshaling_FilePropertiesKeys={})),OSF.DDA.Marshaling.FilePropertiesKeys=OSF_DDA_Marshaling_FilePropertiesKeys,OSF.DDA.WAC.Delegate.ParameterMap.addComplexType(OSF.DDA.PropertyDescriptors.FilePropertiesDescriptor),OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.PropertyDescriptors.FilePropertiesDescriptor,fromHost:[{name:OSF.DDA.FilePropertiesDescriptor.Url,value:OSF.DDA.Marshaling.FilePropertiesKeys.Url}]}),OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidGetFilePropertiesMethod,fromHost:[{name:OSF.DDA.PropertyDescriptors.FilePropertiesDescriptor,value:OSF.DDA.Marshaling.FilePropertiesKeys.Properties}]}),Microsoft.Office.WebExtension.GoToType={Binding:"binding",NamedItem:"namedItem",Slide:"slide",Index:"index"},Microsoft.Office.WebExtension.SelectionMode={Default:"default",Selected:"selected",None:"none"},Microsoft.Office.WebExtension.Index={First:"first",Last:"last",Next:"next",Previous:"previous"},OSF.DDA.AsyncMethodNames.addNames({GoToByIdAsync:"goToByIdAsync"}),OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.GoToByIdAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.Id,types:["string","number"]},{name:Microsoft.Office.WebExtension.Parameters.GoToType,enum:Microsoft.Office.WebExtension.GoToType}],supportedOptions:[{name:Microsoft.Office.WebExtension.Parameters.SelectionMode,value:{enum:Microsoft.Office.WebExtension.SelectionMode,defaultValue:Microsoft.Office.WebExtension.SelectionMode.Default}}]}),OSF.OUtil.setNamespace("Marshaling",OSF.DDA),OSF.DDA.Marshaling.NavigationKeys={NavigationRequest:"DdaGoToByIdMethod",Id:"Id",GoToType:"GoToType",SelectionMode:"SelectionMode"},function(e){e[e.Binding=0]="Binding",e[e.NamedItem=1]="NamedItem",e[e.Slide=2]="Slide",e[e.Index=3]="Index"}(OSF_DDA_Marshaling_GoToType||(OSF_DDA_Marshaling_GoToType={})),OSF.DDA.Marshaling.GoToType=OSF_DDA_Marshaling_GoToType,function(e){e[e.Default=0]="Default",e[e.Selected=1]="Selected",e[e.None=2]="None"}(OSF_DDA_Marshaling_SelectionMode||(OSF_DDA_Marshaling_SelectionMode={})),OSF.DDA.Marshaling.SelectionMode=OSF_DDA_Marshaling_SelectionMode,OSF.DDA.WAC.Delegate.ParameterMap.addComplexType(OSF.DDA.Marshaling.NavigationKeys.NavigationRequest),OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.Marshaling.NavigationKeys.NavigationRequest,toHost:[{name:Microsoft.Office.WebExtension.Parameters.Id,value:OSF.DDA.Marshaling.NavigationKeys.Id},{name:Microsoft.Office.WebExtension.Parameters.GoToType,value:OSF.DDA.Marshaling.NavigationKeys.GoToType},{name:Microsoft.Office.WebExtension.Parameters.SelectionMode,value:OSF.DDA.Marshaling.NavigationKeys.SelectionMode}]}),OSF.DDA.WAC.Delegate.ParameterMap.define({type:Microsoft.Office.WebExtension.Parameters.GoToType,toHost:[{name:Microsoft.Office.WebExtension.GoToType.Binding,value:OSF.DDA.Marshaling.GoToType.Binding},{name:Microsoft.Office.WebExtension.GoToType.NamedItem,value:OSF.DDA.Marshaling.GoToType.NamedItem},{name:Microsoft.Office.WebExtension.GoToType.Slide,value:OSF.DDA.Marshaling.GoToType.Slide},{name:Microsoft.Office.WebExtension.GoToType.Index,value:OSF.DDA.Marshaling.GoToType.Index}]}),OSF.DDA.WAC.Delegate.ParameterMap.define({type:Microsoft.Office.WebExtension.Parameters.SelectionMode,toHost:[{name:Microsoft.Office.WebExtension.SelectionMode.Default,value:OSF.DDA.Marshaling.SelectionMode.Default},{name:Microsoft.Office.WebExtension.SelectionMode.Selected,value:OSF.DDA.Marshaling.SelectionMode.Selected},{name:Microsoft.Office.WebExtension.SelectionMode.None,value:OSF.DDA.Marshaling.SelectionMode.None}]}),OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidNavigateToMethod,toHost:[{name:OSF.DDA.Marshaling.NavigationKeys.NavigationRequest,value:OSF.DDA.WAC.Delegate.ParameterMap.self}]}),OSF.DDA.ExcelTableBinding=function(e,t,n,r,i){var o=OSF.DDA.AsyncMethodNames;OSF.DDA.DispIdHost.addAsyncMethods(this,[o.ClearFormatsAsync,o.SetTableOptionsAsync,o.SetFormatsAsync]),OSF.DDA.ExcelTableBinding.uber.constructor.call(this,e,t,n,r,i),OSF.OUtil.finalizeProperties(this)},OSF.OUtil.extend(OSF.DDA.ExcelTableBinding,OSF.DDA.TableBinding),function(){OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.SetSelectedDataAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.Data,types:["string","object","number","boolean"]}],supportedOptions:[{name:Microsoft.Office.WebExtension.Parameters.CoercionType,value:{enum:Microsoft.Office.WebExtension.CoercionType,calculate:function(e){return OSF.DDA.DataCoercion.determineCoercionType(e[Microsoft.Office.WebExtension.Parameters.Data])}}},{name:Microsoft.Office.WebExtension.Parameters.CellFormat,value:{types:["object"],defaultValue:[]}},{name:Microsoft.Office.WebExtension.Parameters.TableOptions,value:{types:["object"],defaultValue:[]}}],privateStateCallbacks:[]}),OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.SetDataAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.Data,types:["string","object","number","boolean"]}],supportedOptions:[{name:Microsoft.Office.WebExtension.Parameters.CoercionType,value:{enum:Microsoft.Office.WebExtension.CoercionType,calculate:function(e){return OSF.DDA.DataCoercion.determineCoercionType(e[Microsoft.Office.WebExtension.Parameters.Data])}}},{name:Microsoft.Office.WebExtension.Parameters.Rows,value:{types:["object","string"],defaultValue:null}},{name:Microsoft.Office.WebExtension.Parameters.Columns,value:{types:["object"],defaultValue:null}},{name:Microsoft.Office.WebExtension.Parameters.StartRow,value:{types:["number"],defaultValue:0}},{name:Microsoft.Office.WebExtension.Parameters.StartColumn,value:{types:["number"],defaultValue:0}},{name:Microsoft.Office.WebExtension.Parameters.CellFormat,value:{types:["object"],defaultValue:[]}},{name:Microsoft.Office.WebExtension.Parameters.TableOptions,value:{types:["object"],defaultValue:[]}}],checkCallArgs:function(e,t,n){var r=Microsoft.Office.WebExtension.Parameters;if(0==e[r.StartRow]&&0==e[r.StartColumn]&&OSF.OUtil.isArray(e[r.CellFormat])&&0===e[r.CellFormat].length&&OSF.OUtil.isArray(e[r.TableOptions])&&0===e[r.TableOptions].length&&(delete e[r.StartRow],delete e[r.StartColumn],delete e[r.CellFormat],delete e[r.TableOptions]),e[r.CoercionType]!=OSF.DDA.DataCoercion.getCoercionDefaultForBinding(t.type)&&(e[r.StartRow]&&0!=e[r.StartRow]||e[r.StartColumn]&&0!=e[r.StartColumn]||e[r.CellFormat]||e[r.TableOptions]))throw OSF.DDA.ErrorCodeManager.errorCodes.ooeCoercionTypeNotMatchBinding;return e},privateStateCallbacks:[{name:Microsoft.Office.WebExtension.Parameters.Id,value:function(e){return e.id}}]}),OSF.DDA.BindingPromise.prototype.setTableOptionsAsync=function(){var e=arguments;return this._fetch((function(t){t.setTableOptionsAsync.apply(t,e)})),this},OSF.DDA.BindingPromise.prototype.setFormatsAsync=function(){var e=arguments;return this._fetch((function(t){t.setFormatsAsync.apply(t,e)})),this},OSF.DDA.BindingPromise.prototype.clearFormatsAsync=function(){var e=arguments;return this._fetch((function(t){t.clearFormatsAsync.apply(t,e)})),this}}(),function(){function e(e){return e.id}OSF.DDA.AsyncMethodNames.addNames({ClearFormatsAsync:"clearFormatsAsync",SetTableOptionsAsync:"setTableOptionsAsync",SetFormatsAsync:"setFormatsAsync"}),OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.ClearFormatsAsync,requiredArguments:[],supportedOptions:[],privateStateCallbacks:[{name:Microsoft.Office.WebExtension.Parameters.Id,value:e}]}),OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.SetTableOptionsAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.TableOptions,defaultValue:[]}],privateStateCallbacks:[{name:Microsoft.Office.WebExtension.Parameters.Id,value:e}]}),OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.SetFormatsAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.CellFormat,defaultValue:[]}],privateStateCallbacks:[{name:Microsoft.Office.WebExtension.Parameters.Id,value:e}]})}(),OSF.OUtil.setNamespace("Marshaling",OSF.DDA),OSF.DDA.Marshaling.FormatKeys={Id:"BindingId",CellFormat:"CellFormat",TableOptions:"TableOptions"},function(e){e[e.headerRow=0]="headerRow",e[e.bandedRows=1]="bandedRows",e[e.firstColumn=2]="firstColumn",e[e.lastColumn=3]="lastColumn",e[e.bandedColumns=4]="bandedColumns",e[e.filterButton=5]="filterButton",e[e.style=6]="style",e[e.totalRow=7]="totalRow"}(OSF_DDA_Marshaling_TableOptionProperties||(OSF_DDA_Marshaling_TableOptionProperties={})),OSF.DDA.Marshaling.TableOptionProperties=OSF_DDA_Marshaling_TableOptionProperties,function(e){e[e.row=0]="row",e[e.column=1]="column"}(OSF_DDA_Marshaling_CellProperties||(OSF_DDA_Marshaling_CellProperties={})),OSF.DDA.Marshaling.CellProperties=OSF_DDA_Marshaling_CellProperties,function(e){e[e.alignHorizontal=1]="alignHorizontal",e[e.alignVertical=2]="alignVertical",e[e.backgroundColor=101]="backgroundColor",e[e.borderStyle=201]="borderStyle",e[e.borderColor=202]="borderColor",e[e.borderTopStyle=203]="borderTopStyle",e[e.borderTopColor=204]="borderTopColor",e[e.borderBottomStyle=205]="borderBottomStyle",e[e.borderBottomColor=206]="borderBottomColor",e[e.borderLeftStyle=207]="borderLeftStyle",e[e.borderLeftColor=208]="borderLeftColor",e[e.borderRightStyle=209]="borderRightStyle",e[e.borderRightColor=210]="borderRightColor",e[e.borderOutlineStyle=211]="borderOutlineStyle",e[e.borderOutlineColor=212]="borderOutlineColor",e[e.borderInlineStyle=213]="borderInlineStyle",e[e.borderInlineColor=214]="borderInlineColor",e[e.fontFamily=301]="fontFamily",e[e.fontStyle=302]="fontStyle",e[e.fontSize=303]="fontSize",e[e.fontUnderlineStyle=304]="fontUnderlineStyle",e[e.fontColor=305]="fontColor",e[e.fontDirection=306]="fontDirection",e[e.fontStrikethrough=307]="fontStrikethrough",e[e.fontSuperscript=308]="fontSuperscript",e[e.fontSubscript=309]="fontSubscript",e[e.fontNormal=310]="fontNormal",e[e.indentLeft=401]="indentLeft",e[e.indentRight=402]="indentRight",e[e.numberFormat=501]="numberFormat",e[e.width=701]="width",e[e.height=702]="height",e[e.wrapping=703]="wrapping"}(OSF_DDA_Marshaling_CellFormatProperties||(OSF_DDA_Marshaling_CellFormatProperties={})),OSF.DDA.Marshaling.CellFormatProperties=OSF_DDA_Marshaling_CellFormatProperties,function(e){e[e.none=0]="none",e[e.thin=1]="thin",e[e.medium=2]="medium",e[e.dashed=3]="dashed",e[e.dotted=4]="dotted",e[e.thick=5]="thick",e[e.double=6]="double",e[e.hair=7]="hair",e[e.mediumDashed=8]="mediumDashed",e[e.dashDot=9]="dashDot",e[e.mediumDashDot=10]="mediumDashDot",e[e.dashDotDot=11]="dashDotDot",e[e.mediumDashDotDot=12]="mediumDashDotDot",e[e.slantDashDot=13]="slantDashDot"}(OSF_DDA_Marshaling_BorderStyleType||(OSF_DDA_Marshaling_BorderStyleType={})),OSF.DDA.Marshaling.BorderStyleType=OSF_DDA_Marshaling_BorderStyleType,function(e){e[e.none=0]="none",e[e.black=1]="black",e[e.blue=2]="blue",e[e.gray=3]="gray",e[e.green=4]="green",e[e.orange=5]="orange",e[e.pink=6]="pink",e[e.purple=7]="purple",e[e.red=8]="red",e[e.teal=9]="teal",e[e.turquoise=10]="turquoise",e[e.violet=11]="violet",e[e.white=12]="white",e[e.yellow=13]="yellow",e[e.automatic=14]="automatic"}(OSF_DDA_Marshaling_ColorType||(OSF_DDA_Marshaling_ColorType={})),OSF.DDA.Marshaling.ColorType=OSF_DDA_Marshaling_ColorType,function(e){e[e.general=0]="general",e[e.left=1]="left",e[e.center=2]="center",e[e.right=3]="right",e[e.fill=4]="fill",e[e.justify=5]="justify",e[e.centerAcrossSelection=6]="centerAcrossSelection",e[e.distributed=7]="distributed"}(OSF_DDA_Marshaling_AlignHorizontalType||(OSF_DDA_Marshaling_AlignHorizontalType={})),OSF.DDA.Marshaling.AlignHorizontalType=OSF_DDA_Marshaling_AlignHorizontalType,function(e){e[e.top=0]="top",e[e.center=1]="center",e[e.bottom=2]="bottom",e[e.justify=3]="justify",e[e.distributed=4]="distributed"}(OSF_DDA_Marshaling_AlignVerticalType||(OSF_DDA_Marshaling_AlignVerticalType={})),OSF.DDA.Marshaling.AlignVerticalType=OSF_DDA_Marshaling_AlignVerticalType,function(e){e[e.regular=0]="regular",e[e.italic=1]="italic",e[e.bold=2]="bold",e[e.boldItalic=3]="boldItalic"}(OSF_DDA_Marshaling_FontStyleType||(OSF_DDA_Marshaling_FontStyleType={})),OSF.DDA.Marshaling.FontStyleType=OSF_DDA_Marshaling_FontStyleType,function(e){e[e.none=0]="none",e[e.single=1]="single",e[e.double=2]="double",e[e.singleAccounting=3]="singleAccounting",e[e.doubleAccounting=4]="doubleAccounting"}(OSF_DDA_Marshaling_FontUnderlineStyleType||(OSF_DDA_Marshaling_FontUnderlineStyleType={})),OSF.DDA.Marshaling.FontUnderlineStyleType=OSF_DDA_Marshaling_FontUnderlineStyleType,function(e){e[e.context=0]="context",e[e.leftToRight=1]="leftToRight",e[e.rightToLeft=2]="rightToLeft"}(OSF_DDA_Marshaling_FontDirectionType||(OSF_DDA_Marshaling_FontDirectionType={})),OSF.DDA.Marshaling.FontDirectionType=OSF_DDA_Marshaling_FontDirectionType,function(e){e[e.autoFit=-1]="autoFit"}(OSF_DDA_Marshaling_WidthType||(OSF_DDA_Marshaling_WidthType={})),OSF.DDA.Marshaling.WidthType=OSF_DDA_Marshaling_WidthType,function(e){e[e.autoFit=-1]="autoFit"}(OSF_DDA_Marshaling_HeightType||(OSF_DDA_Marshaling_HeightType={})),OSF.DDA.Marshaling.HeightType=OSF_DDA_Marshaling_HeightType,function(e){var t=OSF.DDA.Marshaling.AlignHorizontalType,n=OSF.DDA.Marshaling.AlignVerticalType,r=OSF.DDA.Marshaling.BorderStyleType,i=OSF.DDA.Marshaling.CellFormatProperties,o=OSF.DDA.Marshaling.CellProperties,a=OSF.DDA.Marshaling.ColorType,s=OSF.DDA.Marshaling.FontDirectionType,l=OSF.DDA.Marshaling.FontStyleType,u=OSF.DDA.Marshaling.FontUnderlineStyleType,c=OSF.DDA.Marshaling.HeightType,p=OSF.DDA.Marshaling.FormatKeys,h=Microsoft.Office.WebExtension.Parameters,f=OSF.DDA.WAC.Delegate.ParameterMap,d=OSF.DDA.Marshaling.TableOptionProperties,m=OSF.DDA.Marshaling.WidthType;Microsoft.Office.WebExtension.Table={All:0,Data:1,Headers:2},f.define({type:OSF.DDA.WAC.UniqueArguments.ClearFormats,toHost:[{name:h.Id,value:p.Id}]}),f.define({type:OSF.DDA.MethodDispId.dispidClearFormatsMethod,toHost:[{name:OSF.DDA.WAC.UniqueArguments.ClearFormats,value:OSF.DDA.WAC.Delegate.ParameterMap.self}]}),f.define({type:OSF.DDA.WAC.UniqueArguments.SetFormats,toHost:[{name:h.Id,value:p.Id},{name:h.CellFormat,value:p.CellFormat},{name:h.TableOptions,value:p.TableOptions}]}),f.define({type:OSF.DDA.MethodDispId.dispidSetTableOptionsMethod,toHost:[{name:OSF.DDA.WAC.UniqueArguments.SetFormats,value:OSF.DDA.WAC.Delegate.ParameterMap.self}]}),f.define({type:OSF.DDA.MethodDispId.dispidSetFormatsMethod,toHost:[{name:OSF.DDA.WAC.UniqueArguments.SetFormats,value:OSF.DDA.WAC.Delegate.ParameterMap.self}]}),f.define({type:OSF.DDA.WAC.UniqueArguments.SetData,toHost:[{name:h.Id,value:p.Id},{name:h.CoercionType,value:"CoerceType"},{name:h.Data,value:OSF.DDA.WAC.UniqueArguments.Data},{name:h.Rows,value:"Rows"},{name:h.Columns,value:"Columns"},{name:h.StartRow,value:"StartRow"},{name:h.StartColumn,value:"StartCol"},{name:h.CellFormat,value:p.CellFormat},{name:h.TableOptions,value:p.TableOptions}]}),f.define({type:OSF.DDA.MethodDispId.dispidSetSelectedDataMethod,toHost:[{name:OSF.DDA.WAC.UniqueArguments.SetData,value:OSF.DDA.WAC.Delegate.ParameterMap.self}]}),f.define({type:OSF.DDA.MethodDispId.dispidSetBindingDataMethod,toHost:[{name:OSF.DDA.WAC.UniqueArguments.SetData,value:OSF.DDA.WAC.Delegate.ParameterMap.self}]});var y={alignHorizontal:{text:"alignHorizontal",type:i.alignHorizontal},alignVertical:{text:"alignVertical",type:i.alignVertical},backgroundColor:{text:"backgroundColor",type:i.backgroundColor},borderStyle:{text:"borderStyle",type:i.borderStyle},borderColor:{text:"borderColor",type:i.borderColor},borderTopStyle:{text:"borderTopStyle",type:i.borderTopStyle},borderTopColor:{text:"borderTopColor",type:i.borderTopColor},borderBottomStyle:{text:"borderBottomStyle",type:i.borderBottomStyle},borderBottomColor:{text:"borderBottomColor",type:i.borderBottomColor},borderLeftStyle:{text:"borderLeftStyle",type:i.borderLeftStyle},borderLeftColor:{text:"borderLeftColor",type:i.borderLeftColor},borderRightStyle:{text:"borderRightStyle",type:i.borderRightStyle},borderRightColor:{text:"borderRightColor",type:i.borderRightColor},borderOutlineStyle:{text:"borderOutlineStyle",type:i.borderOutlineStyle},borderOutlineColor:{text:"borderOutlineColor",type:i.borderOutlineColor},borderInlineStyle:{text:"borderInlineStyle",type:i.borderInlineStyle},borderInlineColor:{text:"borderInlineColor",type:i.borderInlineColor},fontFamily:{text:"fontFamily",type:i.fontFamily},fontStyle:{text:"fontStyle",type:i.fontStyle},fontSize:{text:"fontSize",type:i.fontSize},fontUnderlineStyle:{text:"fontUnderlineStyle",type:i.fontUnderlineStyle},fontColor:{text:"fontColor",type:i.fontColor},fontDirection:{text:"fontDirection",type:i.fontDirection},fontStrikethrough:{text:"fontStrikethrough",type:i.fontStrikethrough},fontSuperscript:{text:"fontSuperscript",type:i.fontSuperscript},fontSubscript:{text:"fontSubscript",type:i.fontSubscript},fontNormal:{text:"fontNormal",type:i.fontNormal},indentLeft:{text:"indentLeft",type:i.indentLeft},indentRight:{text:"indentRight",type:i.indentRight},numberFormat:{text:"numberFormat",type:i.numberFormat},width:{text:"width",type:i.width},height:{text:"height",type:i.height},wrapping:{text:"wrapping",type:i.wrapping}},g=[{name:"none",value:r.none},{name:"thin",value:r.thin},{name:"medium",value:r.medium},{name:"dashed",value:r.dashed},{name:"dotted",value:r.dotted},{name:"thick",value:r.thick},{name:"double",value:r.double},{name:"hair",value:r.hair},{name:"medium dashed",value:r.mediumDashed},{name:"dash dot",value:r.dashDot},{name:"medium dash dot",value:r.mediumDashDot},{name:"dash dot dot",value:r.dashDotDot},{name:"medium dash dot dot",value:r.mediumDashDotDot},{name:"slant dash dot",value:r.slantDashDot}],_=[{name:"none",value:a.none},{name:"black",value:a.black},{name:"blue",value:a.blue},{name:"gray",value:a.gray},{name:"green",value:a.green},{name:"orange",value:a.orange},{name:"pink",value:a.pink},{name:"purple",value:a.purple},{name:"red",value:a.red},{name:"teal",value:a.teal},{name:"turquoise",value:a.turquoise},{name:"violet",value:a.violet},{name:"white",value:a.white},{name:"yellow",value:a.yellow},{name:"automatic",value:a.automatic}];f.define({type:y.alignHorizontal.text,toHost:[{name:"general",value:t.general},{name:"left",value:t.left},{name:"center",value:t.center},{name:"right",value:t.right},{name:"fill",value:t.fill},{name:"justify",value:t.justify},{name:"center across selection",value:t.centerAcrossSelection},{name:"distributed",value:t.distributed}]}),f.define({type:y.alignVertical.text,toHost:[{name:"top",value:n.top},{name:"center",value:n.center},{name:"bottom",value:n.bottom},{name:"justify",value:n.justify},{name:"distributed",value:n.distributed}]}),f.define({type:y.backgroundColor.text,toHost:_}),f.define({type:y.borderStyle.text,toHost:g}),f.define({type:y.borderColor.text,toHost:_}),f.define({type:y.borderTopStyle.text,toHost:g}),f.define({type:y.borderTopColor.text,toHost:_}),f.define({type:y.borderBottomStyle.text,toHost:g}),f.define({type:y.borderBottomColor.text,toHost:_}),f.define({type:y.borderLeftStyle.text,toHost:g}),f.define({type:y.borderLeftColor.text,toHost:_}),f.define({type:y.borderRightStyle.text,toHost:g}),f.define({type:y.borderRightColor.text,toHost:_}),f.define({type:y.borderOutlineStyle.text,toHost:g}),f.define({type:y.borderOutlineColor.text,toHost:_}),f.define({type:y.borderInlineStyle.text,toHost:g}),f.define({type:y.borderInlineColor.text,toHost:_}),f.define({type:y.fontStyle.text,toHost:[{name:"regular",value:l.regular},{name:"italic",value:l.italic},{name:"bold",value:l.bold},{name:"bold italic",value:l.boldItalic}]}),f.define({type:y.fontUnderlineStyle.text,toHost:[{name:"none",value:u.none},{name:"single",value:u.single},{name:"double",value:u.double},{name:"single accounting",value:u.singleAccounting},{name:"double accounting",value:u.doubleAccounting}]}),f.define({type:y.fontColor.text,toHost:_}),f.define({type:y.fontDirection.text,toHost:[{name:"context",value:s.context},{name:"left-to-right",value:s.leftToRight},{name:"right-to-left",value:s.rightToLeft}]}),f.define({type:y.width.text,toHost:[{name:"auto fit",value:m.autoFit}]}),f.define({type:y.height.text,toHost:[{name:"auto fit",value:c.autoFit}]}),f.define({type:h.TableOptions,toHost:[{name:"headerRow",value:d.headerRow},{name:"bandedRows",value:d.bandedRows},{name:"firstColumn",value:d.firstColumn},{name:"lastColumn",value:d.lastColumn},{name:"bandedColumns",value:d.bandedCoumns},{name:"filterButton",value:d.filterButton},{name:"style",value:d.style},{name:"totalRow",value:d.totalRow}]}),f.dynamicTypes[h.CellFormat]={toHost:function(e){for(var t in e)e[t].format&&(e[t].format=f.doMapValues(e[t].format,"toHost"));return e},fromHost:function(e){return e}},f.setDynamicType(h.CellFormat,{toHost:function(e){var t=[];for(var n in e){var r=e[n],i=[];if("undefined"!==typeof r.cells){var a,s=r.cells;if("object"===typeof r.cells)for(var l in a=[],s)"undefined"!==typeof o[l]&&(a[o[l]]=s[l]);else a=s;i[0]=a}if(r.format){var u=r.format,c=[];for(var p in u)"undefined"!==typeof y[p]&&c.push([y[p].type,u[p]]);i[1]=c}t[n]=i}return t},fromHost:function(e){return e}}),f.setDynamicType(h.TableOptions,{toHost:function(e){var t=[];for(var n in e)"undefined"!=typeof d[n]&&(t[d[n]]=e[n]);return t},fromHost:function(e){return e}}),t=null,n=null,r=null,i=null,a=null,s=null,l=null,u=null,c=null,p=null,m=null}(AgaveFormatAPI||(AgaveFormatAPI={})),OSF.DDA.AsyncMethodNames.addNames({ExecuteRichApiRequestAsync:"executeRichApiRequestAsync"}),OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.ExecuteRichApiRequestAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.Data,types:["object"]}],supportedOptions:[]}),OSF.OUtil.setNamespace("RichApi",OSF.DDA),OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidExecuteRichApiRequestMethod,toHost:[{name:Microsoft.Office.WebExtension.Parameters.Data,value:OSF.DDA.WAC.UniqueArguments.ArrayData}],fromHost:[{name:Microsoft.Office.WebExtension.Parameters.Data,value:OSF.DDA.WAC.UniqueArguments.Data}]}),OSF.OUtil.augmentList(Microsoft.Office.WebExtension.EventType,{RichApiMessage:"richApiMessage"}),OSF.DDA.RichApiMessageEventArgs=function(e,t){var n=t[Microsoft.Office.WebExtension.Parameters.Data],r=[];if(n)for(var i=0;i100&&(e[Microsoft.Office.WebExtension.Parameters.Width]=99),e[Microsoft.Office.WebExtension.Parameters.Height]<=0&&(e[Microsoft.Office.WebExtension.Parameters.Height]=1),!e[Microsoft.Office.WebExtension.Parameters.UseDeviceIndependentPixels]&&e[Microsoft.Office.WebExtension.Parameters.Height]>100&&(e[Microsoft.Office.WebExtension.Parameters.Height]=99),e[Microsoft.Office.WebExtension.Parameters.RequireHTTPs]||(e[Microsoft.Office.WebExtension.Parameters.RequireHTTPs]=!0),e}}),OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.CloseAsync,requiredArguments:[],supportedOptions:[],privateStateCallbacks:[]}),OSF.DDA.SyncMethodCalls.define({method:OSF.DDA.SyncMethodNames.MessageParent,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.MessageToParent,types:["string","number","boolean"]}],supportedOptions:[{name:Microsoft.Office.WebExtension.Parameters.TargetOrigin,value:{types:["string"],defaultValue:""}}]}),OSF.DDA.SyncMethodCalls.define({method:OSF.DDA.SyncMethodNames.AddMessageHandler,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.EventType,enum:Microsoft.Office.WebExtension.EventType,verify:function(e,t,n){return n.supportsEvent(e)}},{name:Microsoft.Office.WebExtension.Parameters.Handler,types:["function"]}],supportedOptions:[]}),OSF.DDA.SyncMethodCalls.define({method:OSF.DDA.SyncMethodNames.SendMessage,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.MessageContent,types:["string"]}],supportedOptions:[{name:Microsoft.Office.WebExtension.Parameters.TargetOrigin,value:{types:["string"],defaultValue:""}}],privateStateCallbacks:[]}),OSF.OUtil.setNamespace("Marshaling",OSF.DDA),OSF.OUtil.setNamespace("Dialog",OSF.DDA.Marshaling),OSF.DDA.Marshaling.Dialog.DialogMessageReceivedEventKeys={MessageType:"messageType",MessageContent:"messageContent",MessageOrigin:"messageOrigin",TargetOrigin:"targetOrigin"},OSF.DDA.Marshaling.Dialog.DialogParentMessageReceivedEventKeys={MessageType:"messageType",MessageContent:"messageContent",MessageOrigin:"messageOrigin",TargetOrigin:"targetOrigin"},OSF.DDA.Marshaling.MessageParentKeys={MessageToParent:"messageToParent",TargetOrigin:"targetOrigin"},OSF.DDA.Marshaling.DialogNotificationShownEventType={DialogNotificationShown:"dialogNotificationShown"},OSF.DDA.Marshaling.SendMessageKeys={MessageContent:"messageContent",TargetOrigin:"targetOrigin"},function(e){!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}return null};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={}))}(OfficeExt||(OfficeExt={})),function(e){!function(t){!function(t){var n=null,r=null,i=null,o=null,a=null,s=!1,l=-1,u=null,c=e.WACUtils.shouldUseLocalStorageToPassMessage(),p={dispId:OSF.DDA.EventDispId.dispidDialogNotificationShownInAddinEvent,eventType:OSF.DDA.Marshaling.DialogNotificationShownEventType.DialogNotificationShown,onComplete:null,onCalling:null};function h(t,n){var r=!1,a=e.WacCommonUICssManager.getDialogCssManager(n);i=v(a),document.body.insertBefore(i,document.body.firstChild),(o=function(t,n){var r=document.createElement("div");r.style.cssText=t.getDialogNotificationPanelCSS(),A(r);var i=document.createElement("div");i.style.cssText=t.getCrossZoneNotificationTextPanelCSS(),i.id="dialogNotificationTextPanel";var o=document.createElement("a");o.id="configureBrowserLink",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");Strings.OfficeOM.L_NewWindowCrossZone&&(a.innerHTML=OSF.OUtil.formatString(Strings.OfficeOM.L_NewWindowCrossZone,o.outerHTML,e.WACUtils.getDomainForUrl(n)));return i.appendChild(a),r.appendChild(i),r}(a,t)).id="crossZoneNotification";var l=S(a),u=y(a,Strings.OfficeOM.L_DialogOK?Strings.OfficeOM.L_DialogOK:"OK");l.appendChild(u),o.appendChild(l),document.body.insertBefore(o,document.body.firstChild),s=!0,u.onclick=function(){b()},u.addEventListener("keydown",(function(e){9==e.keyCode?(document.getElementById("configureBrowserLink").focus(),e.preventDefault(),e.stopPropagation()):13==e.keyCode&&(r=!0,e.preventDefault(),e.stopPropagation())}),!1),u.addEventListener("keyup",(function(e){13==e.keyCode&&r&&(r=!1,b(),e.preventDefault(),e.stopPropagation())}),!1),document.getElementById("configureBrowserLink").addEventListener("keydown",(function(e){9==e.keyCode&&(u.focus(),e.preventDefault(),e.stopPropagation())}),!1),window.focus(),u.focus()}function f(e){if(e.source==n)try{var t=e.origin,i=OSF._OfficeAppFactory.getInitializationHelper()._appContext._addInSourceUrl;if(i||(i=window.location.origin)||(i=window.location.protocol+"//"+window.location.hostname+(window.location.port?":"+window.location.port:"")),!function(e,t,n){if(void 0===n&&(n=!0),!e||!t)return!1;var r=OSF.OUtil.parseUrl(e),i=OSF.OUtil.parseUrl(t),o=OSF._OfficeAppFactory.getInitializationHelper()._appContext._appDomains;if(!("https:"===r.protocol))return!1;var a=r.protocol===i.protocol&&r.hostname===i.hostname&&r.port===i.port,s=Microsoft.Office.Common.XdmCommunicationManager.checkUrlWithAppDomains(o,e),l=a||s;return!l&&n&&(l=Microsoft.Office.Common.XdmCommunicationManager.isTargetSubdomainOfSourceLocation(t,e)),l}(t,i,!0))throw new Error("Received a message from a dialog with an untrusted domain.");var o={};o[OSF.DDA.Marshaling.Dialog.DialogMessageReceivedEventKeys.MessageType]=OSF.DialogMessageType.DialogMessageReceived,o[OSF.DDA.Marshaling.Dialog.DialogMessageReceivedEventKeys.MessageContent]=e.data,o[OSF.DDA.Marshaling.Dialog.DialogMessageReceivedEventKeys.MessageOrigin]=t,r(o)}catch(e){OSF.AppTelemetry&&OSF.AppTelemetry.logAppException("Error happened during receive message handler."+e)}}function d(e){var t=OSF._OfficeAppFactory.getInitializationHelper()._webAppState.id+"messageParentKey";if(e.key==t)try{var n={};n[OSF.DDA.Marshaling.Dialog.DialogMessageReceivedEventKeys.MessageType]=OSF.DialogMessageType.DialogMessageReceived,n[OSF.DDA.Marshaling.Dialog.DialogMessageReceivedEventKeys.MessageContent]=e.newValue,n[OSF.DDA.Marshaling.Dialog.DialogMessageReceivedEventKeys.MessageOrigin]=e.origin,r(n)}catch(e){OSF.AppTelemetry&&OSF.AppTelemetry.logAppException("Error happened during storage changed handler."+e)}}function m(t){var i=OSF._OfficeAppFactory.getInitializationHelper()._hostInfo,o=(OSF.OUtil.checkFlight(OSF.FlightTreatmentNames.IsPrivateAddin)?[i.hostType,i.hostPlatform,i.hostSpecificFileVersion,i.hostLocale,i.osfControlAppCorrelationId,"isDialog",i.disableLogging?"disableLogging":"",i.flags&OSF.HostInfoFlags.PublicAddin]:[i.hostType,i.hostPlatform,i.hostSpecificFileVersion,i.hostLocale,i.osfControlAppCorrelationId,"isDialog",i.disableLogging?"disableLogging":""]).join("$"),s=OSF._OfficeAppFactory.getInitializationHelper()._appContext;s._taskpaneUrl=window.location.origin,s._taskpaneUrl||(s._taskpaneUrl=window.location.protocol+"//"+window.location.hostname+(window.location.port?":"+window.location.port:""));var u=t[OSF.ShowWindowDialogParameterKeys.Url];t[OSF.ShowWindowDialogParameterKeys.UrlNoHostInfo]||(u=e.WACUtils.addHostInfoAsQueryParam(u,o));var p=JSON.parse(window.name);p[OSF.WindowNameItemKeys.HostInfo]=o,p[OSF.WindowNameItemKeys.AppContext]=s;var m=t[OSF.ShowWindowDialogParameterKeys.Width]*screen.width/100,y=t[OSF.ShowWindowDialogParameterKeys.Height]*screen.height/100,g="width="+m+", height="+y+", left="+(s._clientWindowWidth/2-m/2)+", top="+(s._clientWindowHeight/2-y/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(u,e.WACUtils.serializeObjectToString(p),g)))return OSF.AppTelemetry.logAppCommonMessage("Encountered cross zone issue in displayDialogAsync api."),O(),h(u,i.hostType),void a(OSF.DDA.ErrorCodeManager.errorCodes.ooeCrossZone);c?window.addEventListener("storage",d):window.addEventListener("message",f),l=window.setInterval((function(){try{if(null==n||n.closed){window.clearInterval(l),c?window.removeEventListener("storage",d):window.removeEventListener("message",f);var e={};e[OSF.DDA.Marshaling.Dialog.DialogMessageReceivedEventKeys.MessageType]=OSF.DialogMessageType.DialogClosed,r(e)}}catch(e){OSF.AppTelemetry&&OSF.AppTelemetry.logAppException("Error happened during check or handle window close."+e)}}),1e3),null!=a?a(OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess):OSF.AppTelemetry&&OSF.AppTelemetry.logAppException("showDialogCallback can not be null.")}function y(e,t){var n=document.createElement("input");n.setAttribute("type","button"),n.style.cssText=e.getDialogButtonCSS(),n.style.borderColor="#ababab",n.style.backgroundColor="#ffffff",n.setAttribute("value",t);var r=function(){g(n)},i=function(){_(n)};return n.addEventListener("mouseover",r),n.addEventListener("focus",r),n.addEventListener("mouseout",i),n.addEventListener("focusout",i),n}function g(e){null!=u?(e.style.borderColor=u.HostButtonBorderColor,e.style.backgroundColor=u.HostButtonBackgroundColor):OSF.CommonUI&&OSF.CommonUI.HostButtonBorderColor&&OSF.CommonUI.HostButtonBackgroundColor?(e.style.borderColor=OSF.CommonUI.HostButtonBorderColor,e.style.backgroundColor=OSF.CommonUI.HostButtonBackgroundColor):e.style.backgroundColor="#ccc"}function _(e){e.style.borderColor="#ababab",e.style.backgroundColor="#ffffff"}function b(){p.onCalling=function(e){O(),C(e)},OSF.DDA.WAC.Delegate.unregisterEventAsync(p)}function O(){null!=o&&(document.body.removeChild(o),o=null),null!=i&&(document.body.removeChild(i),i=null)}function v(e){var t=document.createElement("div");return t.style.cssText=e.getOverlayElementCSS(),t}function S(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 C(e){if(e!=OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess){var t=document.querySelectorAll(OSF._OfficeAppFactory.getInitializationHelper()._tabbableElements);OSF.OUtil.focusToFirstTabbable(t,!1)}}function A(e){e.setAttribute("role","dialog"),e.setAttribute("aria-describedby","dialogNotificationTextPanel")}t.setHostThemeButtonStyle=function(e){var t=e.input;null!=t&&(u={HostButtonBorderColor:t[OSF.HostThemeButtonStyleKeys.ButtonBorderColor],HostButtonBackgroundColor:t[OSF.HostThemeButtonStyleKeys.ButtonBackgroundColor]}),e.completed()},t.removeEventListenersForDialog=function(e){OSF._OfficeAppFactory.getInitializationHelper().addOrRemoveEventListenersForWindow(!1),e.completed()},t.handleNewWindowDialog=function(t){try{if(!function(e){var t=OSF._OfficeAppFactory.getInitializationHelper()._appContext._appDomains,n=e[OSF.ShowWindowDialogParameterKeys.Url],r=Microsoft.Office.Common.XdmCommunicationManager.checkUrlWithAppDomains(t,n);if(!r){var i=OSF._OfficeAppFactory.getInitializationHelper()._appContext._addInSourceUrl;return i||(i=window.location.origin)||(i=window.location.protocol+"//"+window.location.hostname+(window.location.port?":"+window.location.port:"")),i&&Microsoft.Office.Common.XdmCommunicationManager.isTargetSubdomainOfSourceLocation(i,n)}return r}(t))return void a(OSF.DDA.ErrorCodeManager.errorCodes.ooeAppDomains);if(!t[OSF.ShowWindowDialogParameterKeys.PromptBeforeOpen])return void m(t);s=!1;var n=!1,r=OSF._OfficeAppFactory.getInitializationHelper()._hostInfo,l=e.WacCommonUICssManager.getDialogCssManager(r.hostType),u=OSF.OUtil.formatString(Strings.OfficeOM.L_ShowWindowDialogNotification,OSF._OfficeAppFactory.getInitializationHelper()._appContext._addinName);i=v(l);var c=function(e){var t=[];try{for(;e.firstChild&&null!=e.firstChild;)t.push(e.firstChild),e.removeChild(e.firstChild)}catch(e){}return t}(document.body);document.body.appendChild(i),(o=function(e,t){var n=document.createElement("div");n.style.cssText=e.getDialogNotificationPanelCSS(),A(n);var r=document.createElement("div");r.style.cssText=e.getNewWindowNotificationTextPanelCSS(),r.id="dialogNotificationTextPanel","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}(l,u)).id="newWindowNotificaiton";var h=S(l),f=y(l,Strings.OfficeOM.L_ShowWindowDialogNotificationAllow),d=y(l,Strings.OfficeOM.L_ShowWindowDialogNotificationIgnore);function P(e,t){try{for(var n=0;n-1)window.close();else{var t=e.data,n=typeof t;if(t&&("object"==n||"string"==n)){var r="string"==n?JSON.parse(t):t,i={};i[OSF.DDA.PropertyDescriptors.MessageContent]=r.messageContent,i[OSF.DDA.PropertyDescriptors.MessageOrigin]=e.origin;var o=OSF.DDA.OMFactory.manufactureEventArgs(Microsoft.Office.WebExtension.EventType.DialogParentMessageReceived,null,i);OSF.DialogParentMessageEventDispatch.fireEvent(o)}}}))},t.setHandlerAndShowDialogCallback=function(e,t){r=e,a=t},t.escDismissDialogNotification=function(){try{o&&"newWindowNotificaiton"==o.id&&a&&a(OSF.DDA.ErrorCodeManager.errorCodes.ooeEndUserIgnore)}catch(e){OSF.AppTelemetry&&OSF.AppTelemetry.logAppException("Error happened during executing displayDialogAsync callback."+e)}b()},t.showCrossZoneNotification=h}(t.Dialog||(t.Dialog={}))}(e.AddinNativeAction||(e.AddinNativeAction={}))}(OfficeExt||(OfficeExt={})),OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.EventDispId.dispidDialogMessageReceivedEvent,fromHost:[{name:OSF.DDA.EventDescriptors.DialogMessageReceivedEvent,value:OSF.DDA.WAC.Delegate.ParameterMap.self}]}),OSF.DDA.WAC.Delegate.ParameterMap.addComplexType(OSF.DDA.EventDescriptors.DialogMessageReceivedEvent),OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.EventDescriptors.DialogMessageReceivedEvent,fromHost:[{name:OSF.DDA.PropertyDescriptors.MessageType,value:OSF.DDA.Marshaling.Dialog.DialogMessageReceivedEventKeys.MessageType},{name:OSF.DDA.PropertyDescriptors.MessageContent,value:OSF.DDA.Marshaling.Dialog.DialogMessageReceivedEventKeys.MessageContent},{name:OSF.DDA.PropertyDescriptors.MessageOrigin,value:OSF.DDA.Marshaling.Dialog.DialogMessageReceivedEventKeys.MessageOrigin}]}),OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.EventDispId.dispidDialogParentMessageReceivedEvent,fromHost:[{name:OSF.DDA.EventDescriptors.DialogParentMessageReceivedEvent,value:OSF.DDA.WAC.Delegate.ParameterMap.self}]}),OSF.DDA.WAC.Delegate.ParameterMap.addComplexType(OSF.DDA.EventDescriptors.DialogParentMessageReceivedEvent),OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.EventDescriptors.DialogParentMessageReceivedEvent,fromHost:[{name:OSF.DDA.PropertyDescriptors.MessageType,value:OSF.DDA.Marshaling.Dialog.DialogParentMessageReceivedEventKeys.MessageType},{name:OSF.DDA.PropertyDescriptors.MessageContent,value:OSF.DDA.Marshaling.Dialog.DialogParentMessageReceivedEventKeys.MessageContent},{name:OSF.DDA.PropertyDescriptors.MessageOrigin,value:OSF.DDA.Marshaling.Dialog.DialogParentMessageReceivedEventKeys.MessageOrigin}]}),OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidMessageParentMethod,toHost:[{name:Microsoft.Office.WebExtension.Parameters.MessageToParent,value:OSF.DDA.Marshaling.MessageParentKeys.MessageToParent},{name:Microsoft.Office.WebExtension.Parameters.TargetOrigin,value:OSF.DDA.Marshaling.MessageParentKeys.TargetOrigin}]}),OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidSendMessageMethod,toHost:[{name:Microsoft.Office.WebExtension.Parameters.MessageContent,value:OSF.DDA.Marshaling.SendMessageKeys.MessageContent},{name:Microsoft.Office.WebExtension.Parameters.TargetOrigin,value:OSF.DDA.Marshaling.MessageParentKeys.TargetOrigin}]}),OSF.DDA.WAC.Delegate.openDialog=function(e){var t=JSON.parse(e.targetId),n=OSF.DDA.WAC.Delegate._getOnAfterRegisterEvent(!0,e);function r(e){var t={Error:e};try{n(Microsoft.Office.Common.InvokeResultCode.noError,t)}catch(e){OSF.AppTelemetry&&OSF.AppTelemetry.logAppException("Exception happens at showDialogCallback."+e)}}if(OSF.DialogShownStatus.hasDialogShown)r(OSF.DDA.ErrorCodeManager.errorCodes.ooeDialogAlreadyOpened);else{var i=t[OSF.ShowWindowDialogParameterKeys.Url].toLowerCase(),o=window.location.href.toLowerCase();if(OSF.AppTelemetry){var a=!1,s=!1,l=!1,u=!1,c="",p="";if(OSF.OUtil){var h=OSF.OUtil.parseUrl(i),f=OSF.OUtil.parseUrl(o);a=h.protocol===f.protocol&&h.hostname===f.hostname&&h.port===f.port,c=OSF.OUtil.getHostnamePortionForLogging(h.hostname),a?p=c:(p=OSF.OUtil.getHostnamePortionForLogging(f.hostname),s=Microsoft.Office.Common.XdmCommunicationManager.isTargetSubdomainOfSourceLocation(i,o),l=Microsoft.Office.Common.XdmCommunicationManager.isTargetSubdomainOfSourceLocation(o,i));var d=OSF._OfficeAppFactory.getInitializationHelper()._appContext._appDomains;u=Microsoft.Office.Common.XdmCommunicationManager.checkUrlWithAppDomains(d,i)}var m="openDialog isInline: "+t[OSF.ShowWindowDialogParameterKeys.DisplayInIframe].toString()+", taskpaneHostname: "+p+", dialogHostName: "+c+", isSameDomain: "+a.toString()+", parentIsSubdomain: "+s.toString()+", childIsSubdomain: "+l.toString()+", isAppDomain: "+u.toString();OSF.AppTelemetry.logAppCommonMessage(m)}null!=i&&"https://"===i.substr(0,"https://".length)?t[OSF.ShowWindowDialogParameterKeys.DisplayInIframe]?(OSF.DialogShownStatus.isWindowDialog=!1,OSF.DDA.WAC.Delegate.registerEventAsync(e)):(OSF.DialogShownStatus.isWindowDialog=!0,OfficeExt.AddinNativeAction.Dialog.setHandlerAndShowDialogCallback((function(t){e.onEvent&&e.onEvent(t),OSF.AppTelemetry&&OSF.AppTelemetry.onEventDone(e.dispId)}),r),OfficeExt.AddinNativeAction.Dialog.handleNewWindowDialog(t)):"http://"===i.substr(0,"http://".length)?r(OSF.DDA.ErrorCodeManager.errorCodes.ooeRequireHTTPS):r(OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidScheme)}},OSF.DDA.WAC.Delegate.messageParent=function(e){null!=window.opener?OfficeExt.AddinNativeAction.Dialog.messageParent(e):OSF.DDA.WAC.Delegate.executeAsync(e)},OSF.DDA.WAC.Delegate.sendMessage=function(e){OSF.DialogShownStatus.hasDialogShown&&(OSF.DialogShownStatus.isWindowDialog?OfficeExt.AddinNativeAction.Dialog.sendMessage(e):OSF.DDA.WAC.Delegate.executeAsync(e))},OSF.DDA.WAC.Delegate.closeDialog=function(e){var t=OSF.DDA.WAC.Delegate._getOnAfterRegisterEvent(!1,e);function n(e){var n={Error:e};try{t(Microsoft.Office.Common.InvokeResultCode.noError,n)}catch(e){OSF.AppTelemetry&&OSF.AppTelemetry.logAppException("Exception happens at closeDialogCallback."+e)}}OSF.DialogShownStatus.hasDialogShown?OSF.DialogShownStatus.isWindowDialog?(e.onCalling&&e.onCalling(),OfficeExt.AddinNativeAction.Dialog.closeDialog(n)):OSF.DDA.WAC.Delegate.unregisterEventAsync(e):n(OSF.DDA.ErrorCodeManager.errorCodes.ooeWebDialogClosed)},OSF.InitializationHelper.prototype.dismissDialogNotification=function(){OfficeExt.AddinNativeAction.Dialog.escDismissDialogNotification()},OSF.InitializationHelper.prototype.registerMessageReceivedEventForWindowDialog=function(){OfficeExt.AddinNativeAction.Dialog.registerMessageReceivedEvent()},Microsoft.Office.WebExtension.AccountTypeFilter={NoFilter:"noFilter",AAD:"aad",MSA:"msa"},OSF.DDA.AsyncMethodNames.addNames({GetAccessTokenAsync:"getAccessTokenAsync"}),OSF.DDA.Auth=function(){},OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.GetAccessTokenAsync,requiredArguments:[],supportedOptions:[{name:Microsoft.Office.WebExtension.Parameters.ForceConsent,value:{types:["boolean"],defaultValue:!1}},{name:Microsoft.Office.WebExtension.Parameters.ForceAddAccount,value:{types:["boolean"],defaultValue:!1}},{name:Microsoft.Office.WebExtension.Parameters.AuthChallenge,value:{types:["string"],defaultValue:""}},{name:Microsoft.Office.WebExtension.Parameters.AllowConsentPrompt,value:{types:["boolean"],defaultValue:!1}},{name:Microsoft.Office.WebExtension.Parameters.ForMSGraphAccess,value:{types:["boolean"],defaultValue:!1}},{name:Microsoft.Office.WebExtension.Parameters.AllowSignInPrompt,value:{types:["boolean"],defaultValue:!1}},{name:Microsoft.Office.WebExtension.Parameters.EnableNewHosts,value:{types:["number"],defaultValue:0}},{name:Microsoft.Office.WebExtension.Parameters.AccountTypeFilter,value:{enum:Microsoft.Office.WebExtension.AccountTypeFilter,defaultValue:Microsoft.Office.WebExtension.AccountTypeFilter.NoFilter}}],checkCallArgs:function(e,t,n){var r,i=OSF._OfficeAppFactory.getInitializationHelper()._appContext;if(i&&i._wopiHostOriginForSingleSignOn){var o=OSF.OUtil.Guid.generateNewGuid();window.parent.parent.postMessage('{"MessageId":"AddinTrustedOrigin","AddinTrustId":"'+o+'"}',i._wopiHostOriginForSingleSignOn),e[Microsoft.Office.WebExtension.Parameters.AddinTrustId]=o}if(window.Office.context.requirements.isSetSupported("JsonPayloadSSO")){for(var a=((r={})[Microsoft.Office.WebExtension.Parameters.ForceConsent]=!1,r[Microsoft.Office.WebExtension.Parameters.ForceAddAccount]=!1,r[Microsoft.Office.WebExtension.Parameters.AuthChallenge]=!0,r[Microsoft.Office.WebExtension.Parameters.AllowConsentPrompt]=!0,r[Microsoft.Office.WebExtension.Parameters.ForMSGraphAccess]=!0,r[Microsoft.Office.WebExtension.Parameters.AllowSignInPrompt]=!0,r[Microsoft.Office.WebExtension.Parameters.EnableNewHosts]=!0,r[Microsoft.Office.WebExtension.Parameters.AccountTypeFilter]=!0,r),s={},l=0,u=Object.keys(a);l=0&&(e=e.substring(t+5,e.length))<"14.14393"}()?e.PromiseImpl.Init():window.Promise:e.PromiseImpl.Init()}()}(t=e._Internal||(e._Internal={}));var n=t.OfficePromise;e.Promise=n}(OfficeExtension||(OfficeExtension={})),function(e){var t=function(){function e(){}return e.prototype._resolveRequestUrlAndHeaderInfo=function(){return u._createPromiseFromResult(null)},e.prototype._createRequestExecutorOrNull=function(){return null},Object.defineProperty(e.prototype,"eventRegistration",{get:function(){return null},enumerable:!0,configurable:!0}),e}();e.SessionBase=t;var n=function(){function e(){}return e.setCustomSendRequestFunc=function(t){e.s_customSendRequestFunc=t},e.xhrSendRequestFunc=function(e){return u.createPromise((function(t,n){var i=new XMLHttpRequest;if(i.open(e.method,e.url),i.onload=function(){var e={statusCode:i.status,headers:u._parseHttpResponseHeaders(i.getAllResponseHeaders()),body:i.responseText};t(e)},i.onerror=function(){n(new r.RuntimeError({code:o.connectionFailure,httpStatusCode:i.status,message:u._getResourceString(a.connectionFailureWithStatus,i.statusText)}))},e.headers)for(var s in e.headers)i.setRequestHeader(s,e.headers[s]);i.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 r.RuntimeError._createInvalidArgError({argumentName:"request"});u.isNullOrEmptyString(e.method)&&(e.method="GET"),e.method=e.method.toUpperCase()},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=n;var r,i=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=0){var o=t.url.substr(i+1),a=u._parseRequestFlagsAndCustomDataFromQueryStringIfAny(o);a.flags>=0&&(n=a.flags)}"string"===typeof t.body&&(t.body=JSON.parse(t.body));var s={id:e.nextId(),type:1,flags:n,message:t};return r.sendMessageToHostAndExpectResponse(s).then((function(e){return e.message}))}));for(var i=0;i=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;n0},e._getLocalDocumentUrlPrefixLength=function(e){for(var t=["http://document.localhost","https://document.localhost","//document.localhost"],n=e.toLowerCase().trim(),r=0;r0){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;o0){var l=a.substr(0,s),u=a.substr(s+1);l=e.trim(l),u=e.trim(u),n[l.toUpperCase()]=u}}}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:o.connectionFailure,errorMessage:e._getResourceString(a.connectionFailureWithStatus,t)}},e._createErrorResponse=function(t,n,r){return{errorCode:t,errorMessage:e._getResourceString(a.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 c=function(){function e(){}return e.setMock=function(t){e.s_isMock=t},e.isMock=function(){return e.s_isMock},e}();e.TestUtility=c,e._internalConfig={showDisposeInfoInDebugInfo:!1,showInternalApiInDebugInfo:!1,enableEarlyDispose:!0,alwaysPolyfillClientObjectUpdateMethod:!1,alwaysPolyfillClientObjectRetrieveMethod:!1,enableConcurrentFlag:!0,enableUndoableFlag:!0,appendTypeNameToObjectPathInfo:!1,enablePreviewExecution:!1},e.config={extendedErrorLogging:!1};var p=function(){function t(){}return t.createSetPropertyAction=function(t,n,r,i,o){S.validateObjectPath(n);var a={Id:t._nextId(),ActionType:4,Name:r,ObjectPathId:n._objectPath.objectPathInfo.Id,ArgumentInfo:{}},s=[i],l=S.setMethodArguments(t,a.ArgumentInfo,s);S.validateReferencedObjectPaths(l);var u=new f(a,0,o);if(u.referencedObjectPath=n._objectPath,u.referencedArgumentObjectPaths=l,e._internalConfig.enablePreviewExecution&&0!==(16&o)){var c={Id:t._nextId(),ActionType:4,Name:r,ObjectId:"",ObjectType:"",Arguments:[i]};n._addPreviewExecutionAction(c)}return n._addAction(u)},t.createQueryAction=function(e,t,n,r){S.validateObjectPath(t);var i={Id:e._nextId(),ActionType:2,Name:"",ObjectPathId:t._objectPath.objectPathInfo.Id,QueryInfo:n},o=new f(i,1,4);return o.referencedObjectPath=t._objectPath,t._addAction(o,r)},t.createQueryAsJsonAction=function(e,t,n,r){S.validateObjectPath(t);var i={Id:e._nextId(),ActionType:7,Name:"",ObjectPathId:t._objectPath.objectPathInfo.Id,QueryInfo:n},o=new f(i,1,4);return o.referencedObjectPath=t._objectPath,t._addAction(o,r)},t.createUpdateAction=function(e,t,n){S.validateObjectPath(t);var r={Id:e._nextId(),ActionType:9,Name:"",ObjectPathId:t._objectPath.objectPathInfo.Id,ObjectState:n},i=new f(r,0,0);return i.referencedObjectPath=t._objectPath,t._addAction(i)},t}();e.CommonActionFactory=p;var h=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=!S.isSetSupported("RichApiRuntime","1.1"));var i=m._parseQueryOption(t);return r?p.createQueryAction(this._context,this,i,n):p.createQueryAsJsonAction(this._context,this,i,n)},t.prototype._recursivelyUpdate=function(t){var n=e._internalConfig.alwaysPolyfillClientObjectUpdateMethod;n||(n=!S.isSetSupported("RichApiRuntime","1.2"));try{var i=this[v.scalarPropertyNames];i||(i=[]);var s=this[v.scalarPropertyUpdateable];if(!s){s=[];for(var l=0;l=0){if(!s[y])throw new r.RuntimeError({code:o.invalidArgument,httpStatusCode:400,message:u._getResourceString(C.attemptingToSetReadOnlyProperty,m),debugInfo:{errorLocation:m}});h[m]=t[m],++d}else{if(!(c.indexOf(m)>=0))throw new r.RuntimeError({code:o.invalidArgument,httpStatusCode:400,message:u._getResourceString(C.propertyDoesNotExist,m),debugInfo:{errorLocation:m}});f[m]=t[m]}}if(d>0)if(n)for(l=0;l0)throw r.RuntimeError._createInvalidArgError({argumentName:e.combineQueryPath(i,a,".")});t.Top=s}else if("$skip"===a){if("number"!==typeof s||n.length>0)throw r.RuntimeError._createInvalidArgError({argumentName:e.combineQueryPath(i,a,".")});t.Skip=s}else if("boolean"===typeof s)s&&t.Select.push(e.combineQueryPath(n,a,"/"));else{if("object"!==typeof s)throw r.RuntimeError._createInvalidArgError({argumentName:e.combineQueryPath(i,a,".")});e.parseStrictLoadOptionHelper(t,e.combineQueryPath(n,a,"/"),e.combineQueryPath(i,a,"."),s)}}},e}();e.ClientRequestContextBase=m;var y=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}(),g=function(){function t(e){this.m_contextBase=e,this.m_actions=[],this.m_actionResultHandler={},this.m_referencedObjectPaths={},this.m_instantiatedObjectPaths={},this.m_preSyncPromises=[],this.m_previewExecutionActions=[]}return t.prototype.addAction=function(e){this.m_actions.push(e),1==e.actionInfo.ActionType&&(this.m_instantiatedObjectPaths[e.actionInfo.ObjectPathId]=e)},t.prototype.addPreviewExecutionAction=function(e){this.m_previewExecutionActions.push(e)},Object.defineProperty(t.prototype,"hasActions",{get:function(){return this.m_actions.length>0},enumerable:!0,configurable:!0}),t.prototype._getLastAction=function(){return this.m_actions[this.m_actions.length-1]},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 f(t,1,4);n.referencedObjectPath=e,this.addReferencedObjectPath(e),this.addAction(n);var r=new y(e);this.addActionResultHandler(n,r)}}},t.prototype.ensureInstantiateObjectPaths=function(e){if(e)for(var t=0;t0&&(u.PreviewExecutionActions=this.m_previewExecutionActions,n|=4096),{body:u,flags:n}},t.prototype.processResponse=function(e){if(e)for(var t=0;t=0;t--){var n=this.m_actions[t].actionInfo;if(n.ObjectPathId===e&&3===n.ActionType&&n.Name===v.keepReference){this.m_actions.splice(t,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=0;--i){var o=(h=e[i]).actionInfo.Id;h.referencedObjectPath&&t._updateLastUsedActionIdOfObjectPathId(n,h.referencedObjectPath,o);var a=h.referencedArgumentObjectPaths;if(a)for(var s=a.length,l=0;l0?h.actionInfo.L=f:h.actionInfo.L&&delete h.actionInfo.L}},t}();e.ClientRequestBase=g;var _=function(){function e(e){this.m_type=e}return Object.defineProperty(e.prototype,"value",{get:function(){if(!this.m_isLoaded)throw new r.RuntimeError({code:o.valueNotLoaded,httpStatusCode:400,message:u._getResourceString(a.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=S.adjustToDateTime(e):this.m_value=e)},e}();e.ClientResult=_;var b=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 g(this.m_context),r=0;r=65&&e.charCodeAt(t)<=90;)t++;return t0?".":"")+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 r.RuntimeError({code:o.invalidRequestContext,httpStatusCode:400,message:u._getResourceString(a.invalidRequestContext)})},t.isSetSupported=function(e,t){return!("undefined"!==typeof window&&window.Office&&window.Office.context&&window.Office.context.requirements)||window.Office.context.requirements.isSetSupported(e,t)},t.throwIfApiNotSupported=function(e,n,i,s){if(t._doApiNotSupportedCheck&&!t.isSetSupported(n,i)){var l=u._getResourceString(a.apiNotFoundDetails,[e,n+" "+i,s]);throw new r.RuntimeError({code:o.apiNotFound,httpStatusCode:404,message:l,debugInfo:{errorLocation:e}})}},t.calculateApiFlags=function(e,n,r){return t.isSetSupported(n,r)||(e&=-3),e},t._parseSelectExpand=function(e){var t=[];if(!u.isNullOrEmptyString(e))for(var n=e.split(","),r=0;r0&&t.push(i)}return t;function o(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=0){var a=new Y(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 Y(this._rootObjectPropertyName,t._objectPaths,t._actions,!1,!1),o.fullStatements=a.process())}var l=null;if(n.Body.Results?l=n.Body.Results:n.Body.ProcessedResults&&n.Body.ProcessedResults.Results&&(l=n.Body.ProcessedResults.Results),l){this._processingResult=!0;try{t.processResponse(l)}finally{this._processingResult=!1}}}if(!$.isNullOrEmptyString(n.ErrorCode))return new r.RuntimeError({code:n.ErrorCode,httpStatusCode:n.HttpStatusCode,message:n.ErrorMessage,traceMessages:i});if(n.Body&&n.Body.Error){var u={errorLocation:n.Body.Error.Location};return o&&(u.statement=o.statement,u.surroundingStatements=o.surroundingStatements,u.fullStatements=o.fullStatements),new r.RuntimeError({code:n.Body.Error.Code,httpStatusCode:n.Body.Error.HttpStatusCode,message:n.Body.Error.Message,traceMessages:i,debugInfo:u})}return null},i.prototype.processPendingEventHandlers=function(e){for(var t=$._createPromiseFromResult(null),n=0;n0)if(i.isValidRequestInfo(n[0]))h=n[0],d=1;else if($.isPlainJsonObject(n[0])){if(null!=(h=(m=n[0]).session)&&!i.isValidRequestInfo(h))return i.createErrorPromise(t);f=m.previousObjects,d=1}if(n.length==d+1)p=n[d+0];else{if(null!=m||n.length!=d+2)return i.createErrorPromise(t);f=n[d+0],p=n[d+1]}if(null!=f)if(f instanceof M)c=function(){return f.context};else if(f instanceof i)c=function(){return f};else{if(!Array.isArray(f))return i.createErrorPromise(t);var y=f;if(0==y.length)return i.createErrorPromise(t);for(var g=0;g0&&d._onRunFinishedNotifiers.shift()();if(_)return m;throw m}))},i}(m);e.ClientRequestContext=U;var L=function(){function e(e,t){this.m_proxy=e,this.m_shouldPolyfill=t;var n=e[B.scalarPropertyNames],r=e[B.navigationPropertyNames],i=e[B.className],o=e[B.isCollection];if(n)for(var a=0;a=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;n0},e.prototype.register=function(e,t,n){if(!n)throw r.RuntimeError._createInvalidArgError({argumentName:"handler"});var i=this.getHandlers(e,t);return i.push(n),1===i.length?this.m_registerEventImpl(e,t):$._createPromiseFromResult(null)},e.prototype.unregister=function(e,t,n){if(!n)throw r.RuntimeError._createInvalidArgError({argumentName:"handler"});for(var i=this.getHandlers(e,t),o=i.length-1;o>=0;o--)if(i[o]===n){i.splice(o,1);break}return 0===i.length?this.m_unregisterEventImpl(e,t):$._createPromiseFromResult(null)},e}();e.EventRegistration=G;var z=function(){function e(){this.m_eventRegistration=new G(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})):i.instance?this.m_ready=$._createPromiseFromResult(null).then((function(){t.m_isReady=!0})):this.m_ready=r.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=0;r--)if(n[r]===e){n.splice(r,1);break}0==n.length&&z.getGenericEventRegistration().unregister(t.m_genericEventInfo.eventType,t.m_genericEventInfo.getTargetIdFunc(),t._callback)}))},t.prototype.removeAll=function(){},t}(W);e.GenericEventHandlers=q;var J=function(){function e(e){this.m_clientObject=e}return e.prototype._handleResult=function(e){this.m_clientObject._handleIdResult(e)},e}(),K=function(){function e(){}return e.createGlobalObjectObjectPath=function(e){var t={Id:e._nextId(),ObjectPathType:1,Name:""};return new d(t,null,!1,!1,1,4)},e.createNewObjectObjectPath=function(e,t,n,r){var i={Id:e._nextId(),ObjectPathType:2,Name:t};return new d(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 d(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 d(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 d(r,t,!1,!1,1,4)},e.createMethodObjectPath=function(e,t,n,r,i,o,a,s,l){var u={Id:e._nextId(),ObjectPathType:3,Name:n,ParentObjectPathId:t._objectPath.objectPathInfo.Id,ArgumentInfo:{}},c=$.setMethodArguments(e,u.ArgumentInfo,i),p=new d(u,t._objectPath,o,a,r,$._fixupApiFlags(l));return p.argumentObjectPaths=c,p.getByIdMethodName=s,p},e.createReferenceIdObjectPath=function(e,t){var n={Id:e._nextId(),ObjectPathType:6,Name:t,ArgumentInfo:{}};return new d(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 d(i,t._objectPath,!1,!1,1,4)},e.createChildItemObjectPathUsingGetItemAt=function(e,t,n,r){var i=n[B.index];i&&(r=i);var o={Id:e._nextId(),ObjectPathType:3,Name:B.getItemAt,ParentObjectPathId:t._objectPath.objectPathInfo.Id,ArgumentInfo:{}};return o.ArgumentInfo.Arguments=[r],new d(o,t._objectPath,!1,!1,1,4)},e}();e.ObjectPathFactory=K;var Q=function(){function t(e){this.m_context=e}return t.prototype.executeAsync=function(n,r,i){var o=this,a=l.buildMessageArrayForIRequestExecutor(n,r,i,t.SourceLibHeaderValue);return new e.Promise((function(e,t){OSF.DDA.RichApi.executeRichApiRequestAsync(a,(function(t){var n;u.log("Response:"),u.log(JSON.stringify(t)),"succeeded"==t.status?n=l.buildResponseOnSuccess(l.getResponseBody(t),l.getResponseHeaders(t)):(n=l.buildResponseOnError(t.error.code,t.error.message),o.m_context._processOfficeJsErrorResponse(t.error.code,n)),e(n)}))}))},t.SourceLibHeaderValue="officejs",t}(),X=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[B.isTracked]&&e!==this.m_context._rootObject&&t&&!$.isNullOrEmptyString(t[B.referenceId])&&(this._autoCleanupList[e._objectPath.objectPathInfo.Id]=e,e[B.isTracked]=!0)},e.prototype._addCommon=function(e,t){if(e[B.isTracked])t&&this.m_context._autoCleanup&&delete this._autoCleanupList[e._objectPath.objectPathInfo.Id];else{var n=e[B.referenceId];if(e._objectPath.objectPathInfo[B.objectPathInfoDoNotKeepReferenceFieldName])throw $.createRuntimeError(o.generalException,u._getResourceString(Z.objectIsUntracked),null);$.isNullOrEmptyString(n)&&e._KeepReference&&(e._KeepReference(),w.createInstantiateAction(this.m_context,e),t&&this.m_context._autoCleanup&&delete this._autoCleanupList[e._objectPath.objectPathInfo.Id],e[B.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[B.objectPathInfoDoNotKeepReferenceFieldName]=!0,e.context._pendingRequest._removeKeepReferenceAction(e._objectPath.objectPathInfo.Id);var t=e[B.referenceId];if(!$.isNullOrEmptyString(t)){var n=this.m_context._rootObject;n._RemoveReference&&n._RemoveReference(t)}delete e[B.isTracked]},e.prototype._retrieveAndClearAutoCleanupList=function(){var e=this._autoCleanupList;return this._autoCleanupList={},e},e}();e.TrackedObjects=X;var Y=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&&H._calculateLastUsedObjectPathIds(this.m_actions);for(var e=0;e=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>>>>"),o.push(this.m_statements[t]),o.push("// <<<<<");for(var s=t+1;s0)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,"undefined"===typeof t.top&&"undefined"===typeof t.skip&&"undefined"===typeof t.expand?"undefined"===typeof 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"undefined"===typeof e.Arguments[0]?t:"...";for(var n=0;n0&&(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}(),Z=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}(C);e.ResourceStrings=Z,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 L(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){"undefined"!==typeof(s=t[a])&&(o[a]=s)}for(var a in r){var s;"undefined"!==typeof(s=r[a])&&(s[n.fieldName_isCollection]&&"undefined"!==typeof 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 r.RuntimeError({code:e,httpStatusCode:400,message:u._getResourceString(e,t),debugInfo:n?{errorLocation:n}:void 0})},n.createRuntimeError=function(e,t,n,i,o){return new r.RuntimeError({code:e,httpStatusCode:i,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 r.RuntimeError({code:T.propertyNotLoaded,httpStatusCode:400,message:u._getResourceString(Z.propertyNotLoaded,t),debugInfo:e?{errorLocation:e+"."+t}:void 0})},n.createCannotUpdateReadOnlyPropertyException=function(e,t){return new r.RuntimeError({code:T.cannotUpdateReadOnlyProperty,httpStatusCode:400,message:u._getResourceString(Z.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;r0;)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;rn)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;n0){var n=this.m_apiSets[t-1];n&&(e=S.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);ee.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;n0){for(var o=0;o0){for(var o=0;o0&&(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;n0||this.m_url.toLowerCase().indexOf("/_layouts/15/preauth.aspx")>0)&&(n=!0);var r=document.createElement("a");if(r.href=this.m_url,this.m_options.webApplication){var i=ae.embeddingPageOrigin+"="+e+"&"+ae.embeddingPageSessionInfo+"="+this.m_options.sessionKey;0===r.search.length||"?"===r.search?r.search="?"+ae.sessionContext+"="+encodeURIComponent(i):r.search=r.search+"&"+ae.sessionContext+"="+encodeURIComponent(i)}else n?0===r.hash.length||"#"===r.hash?r.hash="#"+t:r.hash=r.hash+"&"+t:0===r.search.length||"?"===r.search?r.search="?"+t:r.search=r.search+"&"+t;return r.href},t.prototype.init=function(){var e=this;window.addEventListener("message",this.m_onMessageHandler);var t=this._getIFrameSrc();return u.createPromise((function(n,r){var i=document.createElement("iframe");if(e.m_options.id&&(i.id=e.m_options.id,i.name=e.m_options.id),i.style.height=e.m_options.height,i.style.width=e.m_options.width,e.m_options.webApplication){var s=document.createElement("form");s.setAttribute("action",t),s.setAttribute("method","post"),s.setAttribute("target",i.name),e.m_options.container.appendChild(s);var l=document.createElement("input");l.setAttribute("type","hidden"),l.setAttribute("name","access_token"),l.setAttribute("value",e.m_options.webApplication.accessToken),s.appendChild(l);var c=document.createElement("input");c.setAttribute("type","hidden"),c.setAttribute("name","access_token_ttl"),c.setAttribute("value",e.m_options.webApplication.accessTokenTtl),s.appendChild(c),e.m_options.container.appendChild(i),s.submit()}else i.src=t,e.m_options.container.appendChild(i);e.m_timeoutId=window.setTimeout((function(){e.close();var t=$.createRuntimeError(o.timeout,u._getResourceString(a.timeout),"EmbeddedSession.init");r(t)}),e.m_options.timeoutInMilliseconds),e.m_promiseResolver=n}))},t.prototype._invoke=function(e,t,n){this.m_enabled?(ie&&(n=ie(n)),this._sendMessageWithCallback(this.m_id++,e,n,(function(e){oe&&(e=oe(e));var n=e.Error;delete e.Error,t(n||0,e)}))):t(5001,null)},t.prototype.close=function(){window.removeEventListener("message",this.m_onMessageHandler),window.clearTimeout(this.m_timeoutId),this.m_enabled=!1},Object.defineProperty(t.prototype,"eventRegistration",{get:function(){return this.m_sessionEventManager||(this.m_sessionEventManager=new G(this._registerEventImpl.bind(this),this._unregisterEventImpl.bind(this))),this.m_sessionEventManager},enumerable:!0,configurable:!0}),t.prototype._createRequestExecutorOrNull=function(){return new le(this)},t.prototype._resolveRequestUrlAndHeaderInfo=function(){return u._createPromiseFromResult(null)},t.prototype._registerEventImpl=function(e,t){var n=this;return u.createPromise((function(r,i){n._sendMessageWithCallback(n.m_id++,ne.RegisterEventCommand,{EventId:e,TargetId:t},(function(){r(null)}))}))},t.prototype._unregisterEventImpl=function(e,t){var n=this;return u.createPromise((function(r,i){n._sendMessageWithCallback(n.m_id++,ne.UnregisterEventCommand,{EventId:e,TargetId:t},(function(){r()}))}))},t.prototype._onMessage=function(e){var t=this;if(this.m_enabled&&(!this.m_chosenWindow||this.m_chosenWindow===e.source&&this.m_chosenOrigin===e.origin)){var n=e.data;if(n&&n[ne.CommandKey]===ne.ApiReadyCommand)!this.m_chosenWindow&&this._isValidDescendant(e.source)&&n[ne.SessionInfoKey]===this.m_options.sessionKey&&(this.m_chosenWindow=e.source,this.m_chosenOrigin=e.origin,this._sendMessageWithCallback(this.m_id++,ne.GetAppContextCommand,null,(function(e){t._setupContext(e),window.clearTimeout(t.m_timeoutId),t.m_promiseResolver()})));else if(n&&n[ne.CommandKey]===ne.FireEventCommand){var r=n[ne.ParamsKey],i=r.EventId,o=r.TargetId,a=r.Data;if(this.m_sessionEventManager)for(var s=this.m_sessionEventManager.getHandlers(i,o),l=0;l0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]=2){var s=t[n].message[1];s&&(r=a(s)?JSON.parse(s):s)}"undefined"!==typeof OSF&&OSF.AppTelemetry&&OSF.AppTelemetry.CallOnAppActivatedIfPending&&OSF.AppTelemetry.CallOnAppActivatedIfPending(),o.apply(null,[r])}else OfficeExtension.Utility.log("ActionProxy._handleMessage unknown message type "+t[n].messageType)}catch(e){throw function(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)}(e),e}return OfficeExtension.Utility._createPromiseFromResult(null)}function a(e){return"string"===typeof e&&"{"===e[0]}function s(){try{Microsoft.Office.WebExtension.onReadyInternal().then((function(){return function(){if("undefined"!==typeof OSF&&OSF.DDA&&OSF.DDA.RichApi&&OSF.DDA.RichApi.richApiMessageManager)return(new OfficeExtension.ClientRequestContext).eventRegistration.register(5,"",o)}()})).then((function(){var e=OSF._OfficeAppFactory.getHostInfo();return"web"===e.hostPlatform&&"word"!==e.hostType&&"excel"!==e.hostType?void 0:function(){var e=new OfficeExtension.ClientRequestContext,t=OfficeCore.AddinInternalService.newObject(e);return e._customData="WacPartition",t.notifyActionHandlerReady(),e.sync()}()}))}catch(e){}}!function(){OfficeExtension.Utility.log("ActionProxy.initOnce"),"undefined"!=typeof e.actions&&function(e){n=e}(e.actions._association),"undefined"!==typeof document&&(document.readyState&&"loading"!==document.readyState?(OfficeExtension.Utility.log("ActionProxy.initOnce: document.readyState is not loading state"),s()):document.addEventListener&&document.addEventListener("DOMContentLoaded",(function(){OfficeExtension.Utility.log("ActionProxy.initOnce: DOMContentLoaded event triggered"),s()}))),OfficeExtension.HostBridge.onInited((function(e){!function(e){e.addHostMessageHandler((function(e){3===e.type&&o(e.message)}))}(e)}))}()}(t||(t={}))}(Office||(Office={})),function(e){!function(e){function t(){var e=new OfficeCore.RequestContext;return"web"==OSF._OfficeAppFactory.getHostInfo().hostPlatform&&(e._customData="WacPartition"),e}e.areShortcutsInUse=function(e){return __awaiter(this,void 0,void 0,(function(){var n,r,i,o,a;return __generator(this,(function(s){switch(s.label){case 0:return n=t(),r=OfficeCore.ActionService.newObject(n),i=r.areShortcutsInUse(e),[4,n.sync()];case 1:for(s.sent(),o=[],a=0;a0&&Array.isArray(n[0])&&n.length*n[0].length>1500&&p()){var r=Math.max(1,Math.round(1500/n[0].length));e._ValidateArraySize(n.length,n[0].length);for(var i=0;in.length&&(o=n.length-i);var a=e.getRow(i).untrack().getBoundingRect(e.getRow(i+o-1).untrack()).untrack(),s=n.slice(i,i+o);I(a,t,s,0)}return!0}return!1}function c(e){return OfficeExtension.Utility.isSetSupported("ExcelApi",e.toString())}function p(){return c(1.3)}function h(e){return!("undefined"===typeof window||!window.Office||!window.Office.context)&&window.Office.context.platform===e}e.icons={},["ThreeArrows","ThreeArrowsGray","ThreeFlags","ThreeTrafficLights1","ThreeTrafficLights2","ThreeSigns","ThreeSymbols","ThreeSymbols2","FourArrows","FourArrowsGray","FourRedToBlack","FourRating","FourTrafficLights","FiveArrows","FiveArrowsGray","FiveRating","FiveQuarters","ThreeStars","ThreeTriangles","FiveBoxes"].map((function(t,n){var r=i(t);e.icons[r]=[],l[n].map((function(n,o){n=i(n);var a={set:t,index:o};e.icons[r].push(a),e.icons[r][n]=a}))})),function(e){e.NotStarted="notStarted",e.Running="running",e.Succeeded="succeeded",e.Failed="failed"}(o||(o={})),function(e){e[e.OK=200]="OK",e[e.Created=201]="Created",e[e.Accepted=202]="Accepted",e[e.NoContent=204]="NoContent",e[e.HighestSuccessCode=299]="HighestSuccessCode",e[e.TooManyRequests=429]="TooManyRequests",e[e.InternalServerError=500]="InternalServerError",e[e.ServiceUnavailable=503]="ServiceUnavailable",e[e.GatewayTimeout=504]="GatewayTimeout"}(a||(a={})),function(e){e.Close="Session.close",e.CommitChanges="Session.commitChanges",e.Create="Session.resolveRequestUrlAndHeaderInfo",e.Refresh="Session.refreshSession"}(s=e.SessionOperation||(e.SessionOperation={}));var f=function(){function e(e,t,n){var r=void 0===n?{}:n,i=r.persistChanges,o=void 0===i||i,a=r.commitExplicitly,s=void 0===a||a;this.m_requestId="",this.m_workbookUrl=e?this.ensureUrlFormatEndWithSlash(e):"",this.m_requestHeaders=t||{},this.m_persistChanges=o,this.m_commitExplicitly=s}return Object.defineProperty(e.prototype,"requestId",{get:function(){return this.m_requestId},enumerable:!0,configurable:!0}),e.prototype.close=function(){var t=this;if(this.m_requestUrlAndHeaderInfo&&!OfficeExtension.Utility._isLocalDocumentUrl(this.m_requestUrlAndHeaderInfo.url)){var n={method:"POST",url:this.ensureUrlFormatEndWithSlash(this.m_requestUrlAndHeaderInfo.url)+e.CLOSE_SESSION,headers:this.m_requestUrlAndHeaderInfo.headers,body:""};return OfficeExtension.HttpUtility.sendRequest(n).then((function(n){if(n.statusCode!==a.NoContent)throw t.createErrorFromResponseInfo(n,s.Close);for(var r in t.m_requestUrlAndHeaderInfo=null,t.m_requestHeaders)if(r.toLowerCase()===e.WorkbookSessionIdHeaderNameLower){delete t.m_requestHeaders[r];break}}))}return OfficeExtension.Utility._createPromiseFromResult(null)},e.prototype.commitChanges=function(t){var n=this;if(void 0===t&&(t={}),!this.m_commitExplicitly)throw this.createError(a.InternalServerError,"Can not call commitChanges() if commitExplicitly is not set.",s.CommitChanges);if(!this.m_workbookUrl||OfficeExtension.Utility._isLocalDocumentUrl(this.m_workbookUrl))throw this.createError(a.InternalServerError,"Not supported for local documents.",s.CommitChanges);if(!this.m_requestUrlAndHeaderInfo)throw this.createError(a.InternalServerError,"Need to call this._resolveRequestUrlAndHeaderInfo() to get the session id first.",s.CommitChanges);var r=this.createCommitChangesRequestInfo(t);return OfficeExtension.HttpUtility.sendRequest(r).then((function(r){var i=r.statusCode;if(i===a.Accepted)return n.delay(e.POLL_DELAY).then((function(i){return n.pollResourceLocation(n.getHeaderIgnoreCase(r.headers,e.LOCATION_HEADER),s.CommitChanges,t)})).then((function(e){if(JSON.parse(e.body).status===o.Failed)throw n.createErrorFromResponseInfo(e,s.CommitChanges);return n.parseCooldownTime(e)}));if(i>=a.OK&&i<=a.HighestSuccessCode)return n.parseCooldownTime(r);throw n.createErrorFromResponseInfo(r,s.CommitChanges)}))},e.prototype._resolveRequestUrlAndHeaderInfo=function(t){var n=this;if(void 0===t&&(t={}),this.m_requestUrlAndHeaderInfo)return OfficeExtension.Utility._createPromiseFromResult(this.m_requestUrlAndHeaderInfo);if(!this.m_workbookUrl||OfficeExtension.Utility._isLocalDocumentUrl(this.m_workbookUrl))return this.m_requestUrlAndHeaderInfo={url:this.m_workbookUrl,headers:this.m_requestHeaders},OfficeExtension.Utility._createPromiseFromResult(this.m_requestUrlAndHeaderInfo);if(this.getHeaderIgnoreCase(this.m_requestHeaders,e.WorkbookSessionIdHeaderNameLower))return this.m_requestUrlAndHeaderInfo={url:this.m_workbookUrl,headers:this.m_requestHeaders},OfficeExtension.Utility._createPromiseFromResult(this.m_requestUrlAndHeaderInfo);var r=this.createAsyncGraphSessionRequestInfo(t);return OfficeExtension.HttpUtility.sendRequest(r).then((function(r){if(n.m_requestId=n.getHeaderIgnoreCase(r.headers,e.REQUEST_ID_HEADER),r.statusCode!==a.Accepted&&r.statusCode!==a.Created)throw n.createErrorFromResponseInfo(r,s.Create);return r.statusCode===a.Created?(n.formatRequestUrlAndHeaderInfo(r),n.m_requestUrlAndHeaderInfo):n.delay(e.POLL_DELAY).then((function(i){return n.pollResourceLocation(n.getHeaderIgnoreCase(r.headers,e.LOCATION_HEADER),s.Create,t)})).then((function(r){var i=JSON.parse(r.body);if(i.status===o.Failed)throw n.createErrorFromResponseInfo(r,s.Create);var a={method:"GET",url:i.resourceLocation,headers:__assign({},t,{Authorization:n.getHeaderIgnoreCase(n.m_requestHeaders,e.AUTHORIZATION_HEADER)}),body:void 0};return OfficeExtension.HttpUtility.sendRequest(a).then((function(e){return n.formatRequestUrlAndHeaderInfo(e),n.m_requestUrlAndHeaderInfo}))}))}))},e.prototype.refreshSession=function(){var e=this;if(!this.m_workbookUrl||OfficeExtension.Utility._isLocalDocumentUrl(this.m_workbookUrl))throw this.createError(a.InternalServerError,"Not supported for local documents.",s.Refresh);if(!this.m_requestUrlAndHeaderInfo)throw this.createError(a.InternalServerError,"Need to call this._resolveRequestUrlAndHeaderInfo() to get the session id first.",s.Refresh);var t=this.createRefreshSessionRequestInfo();return OfficeExtension.HttpUtility.sendRequest(t).then((function(t){if(t.statusCode!=a.NoContent)throw e.createErrorFromResponseInfo(t,s.Refresh);return OfficeExtension.Utility._createPromiseFromResult(null)}))},e.prototype.getHeaderIgnoreCase=function(e,t){var n=Object.keys(e).filter((function(e){return e.toLowerCase()===t.toLowerCase()}));return n.length>0?e[n[0]]:void 0},e.prototype.createCommitChangesRequestInfo=function(t){void 0===t&&(t={});var n=this.getCorrectGraphVersionUrl()+e.COMMIT_CHANGES,r={};return OfficeExtension.Utility._copyHeaders(this.m_requestUrlAndHeaderInfo.headers,r),OfficeExtension.Utility._copyHeaders(t,r),r[e.PREFER_HEADER]=e.PREFER_HEADER_VAL,{url:n,method:"POST",headers:r,body:{}}},e.prototype.createAsyncGraphSessionRequestInfo=function(t){void 0===t&&(t={});var n=this.getCorrectGraphVersionUrl()+e.CREATE_SESSION,r={};return OfficeExtension.Utility._copyHeaders(this.m_requestHeaders,r),OfficeExtension.Utility._copyHeaders(t,r),r[e.CONTENT_TYPE_HEADER]=e.CONTENT_TYPE_HEADER_VAL,r[e.PREFER_HEADER]=e.PREFER_HEADER_VAL,{url:n,method:"POST",headers:r,body:{persistChanges:this.m_persistChanges,commitExplicitly:this.m_commitExplicitly}}},e.prototype.createRefreshSessionRequestInfo=function(){var t=this.getCorrectGraphVersionUrl()+e.REFRESH_SESSION,n={};return OfficeExtension.Utility._copyHeaders(this.m_requestUrlAndHeaderInfo.headers,n),n[e.CONTENT_TYPE_HEADER]=e.CONTENT_TYPE_HEADER_VAL,{url:t,method:"POST",headers:n,body:{}}},e.prototype.getCorrectGraphVersionUrl=function(){return this.m_workbookUrl.replace(new RegExp("graph.microsoft.com/.*?/"),"graph.microsoft.com/"+e.ASYNC_API_GRAPH_VERSION+"/")},e.prototype.pollResourceLocation=function(t,n,r,i){var s=this;if(void 0===r&&(r={}),void 0===i&&(i=0),i>=e.MAX_POLL_ATTEMPTS)throw this.createError(a.InternalServerError,"Timout while polling for the resource location.",n);var l={method:"GET",url:t,headers:__assign({},r,{Authorization:this.getHeaderIgnoreCase(this.m_requestHeaders,e.AUTHORIZATION_HEADER)}),body:void 0};return OfficeExtension.HttpUtility.sendRequest(l).then((function(l){if(l.statusCode!==a.OK)return s.pollResourceLocation(t,n,r,i+1);switch(JSON.parse(l.body).status){case o.Succeeded:case o.Failed:return l;case o.NotStarted:case o.Running:return s.delay(e.POLL_DELAY).then((function(e){return s.pollResourceLocation(t,n,r,i+1)}));default:throw s.createErrorFromResponseInfo(l,n)}}))},e.prototype.parseCooldownTime=function(t){var n=this.getHeaderIgnoreCase(t.headers,e.RETRY_AFTER_HEADER);return n?1e3*parseInt(n):e.DEFAULT_COMMIT_CHANGES_RETRY_AFTER},e.prototype.formatRequestUrlAndHeaderInfo=function(t){if(t.statusCode!==a.OK&&t.statusCode!==a.Created)throw this.createErrorFromResponseInfo(t,s.Create);var n=JSON.parse(t.body).id,r={};OfficeExtension.Utility._copyHeaders(this.m_requestHeaders,r),r[e.WorkbookSessionIdHeaderName]=n,this.m_requestUrlAndHeaderInfo={url:this.getCorrectGraphVersionUrl(),headers:r}},e.prototype.ensureUrlFormatEndWithSlash=function(e){return"/"!==e.charAt(e.length-1)&&(e+="/"),e},e.prototype.delay=function(e){return new OfficeExtension.CoreUtility.Promise((function(t,n){return setTimeout((function(){return t()}),e)}))},e.prototype.createErrorFromResponseInfo=function(t,n){var r=OfficeExtension.Utility._parseErrorResponse(t),i={retryAfter:this.getHeaderIgnoreCase(t.headers,e.RETRY_AFTER_HEADER),responseBody:OfficeExtension.Utility._parseErrorResponseBody(t)};return OfficeExtension.Utility.createRuntimeError(r.errorCode,r.errorMessage,n,t.statusCode,i)},e.prototype.createError=function(e,t,n){return OfficeExtension.Utility.createRuntimeError(""+e,t,n)},e.WorkbookSessionIdHeaderName="Workbook-Session-Id",e.WorkbookSessionIdHeaderNameLower="workbook-session-id",e.ASYNC_API_GRAPH_VERSION="beta",e.POLL_DELAY=1e4,e.MAX_POLL_ATTEMPTS=10,e.DEFAULT_COMMIT_CHANGES_RETRY_AFTER=1e4,e.LOCATION_HEADER="location",e.AUTHORIZATION_HEADER="authorization",e.REQUEST_ID_HEADER="request-id",e.RETRY_AFTER_HEADER="retry-after",e.PREFER_HEADER="Prefer",e.PREFER_HEADER_VAL="respond-async",e.CONTENT_TYPE_HEADER="Content-Type",e.CONTENT_TYPE_HEADER_VAL="application/json",e.CLOSE_SESSION="closeSession",e.COMMIT_CHANGES="commitChanges",e.CREATE_SESSION="createSession",e.REFRESH_SESSION="refreshSession",e}();e.Session=f;var d=function(t){function n(n){var r=t.call(this,n)||this;return r.m_workbook=P(e.Workbook,r),r._rootObject=r.m_workbook,r._rootObjectPropertyName="workbook",r}return __extends(n,t),n.prototype._processOfficeJsErrorResponse=function(e,t){5004===e&&(t.ErrorCode=Sr.invalidOperationInCellEditMode,t.HttpStatusCode=400,t.ErrorMessage=OfficeExtension.Utility._getResourceString(OfficeExtension.ResourceStrings.invalidOperationInCellEditMode))},Object.defineProperty(n.prototype,"workbook",{get:function(){return this.m_workbook},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"application",{get:function(){return this.workbook.application},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"runtime",{get:function(){return this.workbook._Runtime},enumerable:!0,configurable:!0}),n}(OfficeCore.RequestContext);function m(e,t){var n=e;n.delayForCellEdit&&OfficeExtension.CommonUtility.isSetSupported("DelayForCellEdit")?t._requestFlagModifier|=64:t._requestFlagModifier&=-65,n._makerSafe&&(t._requestFlagModifier|=1024)}function y(e){var t={BindingColumnCount:e.bindingColumnCount,BindingId:e.bindingId,BindingRowCount:e.bindingRowCount,bindingType:e.bindingType,HasHeaders:e.hasHeaders};return window.OSF.DDA.OMFactory.manufactureBinding(t,window.Microsoft.Office.WebExtension.context.document)}function g(e,t){var n;return n=null==e.headers?e.rows:e,void 0===(n=window.OSF.DDA.DataCoercion.coerceData(n,t[window.Microsoft.Office.WebExtension.Parameters.CoercionType]))?null:n}function _(e){if(!("undefined"!==typeof window&&window.Office&&window.Office.context&&window.Office.context.diagnostics&&window.Office.context.diagnostics.version))return!1;var t=window.Office.context.diagnostics.platform.toLowerCase();if("officeonline"===t)return!1;var n=e[t];null==n&&(n=e.general);var r=window.Office.context.diagnostics.version,i=/^(\d+)\.(\d+)\.(\d+)\.(\d+)$/.exec(r);if(i){var o=parseInt(i[1]),a=parseInt(i[2]),s=parseInt(i[3]);if(o0?o=n.getOffsetRange(r,i):(o=n,a=r,s=i),1===Math.abs(t)?o:o.getBoundingRect(n.getOffsetRange(r*t+a,i*t+s))},t}();e.RangeCustom=oe,OfficeExtension.Utility.applyMixin(ie,oe),function(t){t.Range_HandleResult=function(e,t){T(t.isEntireColumn)||(e.m_isEntireColumn=t.isEntireColumn),T(t.isEntireRow)||(e.m_isEntireRow=t.isEntireRow)},t.Range_GetColumnsAfter=function(t,n){return p()?{handled:!1,result:null}:(null==n&&(n=1),t._ensureInteger(n,"RowsAbove"),0===n&&OfficeExtension.Utility.throwError(e.ErrorCodes.invalidArgument,"count","RowsAbove"),{handled:!0,result:t._getAdjacentRange("getColumnsAfter",n,t.getLastColumn(),0,1)})},t.Range_GetColumnsBefore=function(t,n){return p()?{handled:!1,result:null}:(null==n&&(n=1),t._ensureInteger(n,"RowsAbove"),0===n&&OfficeExtension.Utility.throwError(e.ErrorCodes.invalidArgument,"count","RowsAbove"),{handled:!0,result:t._getAdjacentRange("getColumnsBefore",n,t.getColumn(0),0,-1)})},t.Range_GetResizedRange=function(e,t,n){return p()?{handled:!1,result:null}:(e._ensureInteger(t,"getResizedRange"),e._ensureInteger(n,"getResizedRange"),{handled:!0,result:(t>=0&&n>=0?e:e.getCell(0,0)).getBoundingRect(e.getLastCell().getOffsetRange(t,n))})},t.Range_GetRowsAbove=function(t,n){return p()?{handled:!1,result:null}:(null==n&&(n=1),t._ensureInteger(n,"RowsAbove"),0===n&&OfficeExtension.Utility.throwError(e.ErrorCodes.invalidArgument,"count","RowsAbove"),{handled:!0,result:t._getAdjacentRange("getRowsAbove",n,t.getRow(0),-1,0)})},t.Range_GetRowsBelow=function(t,n){return p()?{handled:!1,result:null}:(null==n&&(n=1),t._ensureInteger(n,"RowsAbove"),0===n&&OfficeExtension.Utility.throwError(e.ErrorCodes.invalidArgument,"count","RowsAbove"),{handled:!0,result:this._getAdjacentRange("getRowsBelow",n,t.getLastRow(),1,0)})},t.Range_Formulas_Set=function(e,t){return e.m_formulas=t,u(e,"Formulas",t)?{handled:!0}:{handled:!1}},t.Range_FormulasLocal_Set=function(e,t){return e.m_formulasLocal=t,u(e,"FormulasLocal",t)?{handled:!0}:{handled:!1}},t.Range_FormulasR1C1_Set=function(e,t){return e.m_formulasR1C1=t,u(e,"FormulasR1C1",t)?{handled:!0}:{handled:!1}},t.Range_NumberFormat_Set=function(e,t){return e.m_numberFormat=t,u(e,"NumberFormat",t)?{handled:!0}:{handled:!1}},t.Range_Values_Set=function(e,t){return e.m_values=t,u(e,"Values",t)?{handled:!0}:{handled:!1}}}(b=e._CC||(e._CC={}));var ae=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return __extends(n,t),Object.defineProperty(n.prototype,"_className",{get:function(){return"RangeAreas"},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"_scalarPropertyNames",{get:function(){return["_ReferenceId","address","addressLocal","areaCount","cellCount","isEntireColumn","isEntireRow","style"]},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"_scalarPropertyOriginalNames",{get:function(){return["_ReferenceId","Address","AddressLocal","AreaCount","CellCount","IsEntireColumn","IsEntireRow","Style"]},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"_scalarPropertyUpdateable",{get:function(){return[!1,!1,!1,!1,!1,!1,!1,!0]},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"_navigationPropertyNames",{get:function(){return["areas","conditionalFormats","format","dataValidation","worksheet"]},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"areas",{get:function(){return this._Are||(this._Are=S(e.RangeCollection,this,"Areas",!0,4)),this._Are},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"conditionalFormats",{get:function(){return this._Co||(this._Co=S(e.ConditionalFormatCollection,this,"ConditionalFormats",!0,4)),this._Co},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"dataValidation",{get:function(){return this._D||(this._D=S(e.DataValidation,this,"DataValidation",!1,4)),this._D},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"format",{get:function(){return this._F||(this._F=S(e.RangeFormat,this,"Format",!1,4)),this._F},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"worksheet",{get:function(){return this._W||(this._W=S(e.Worksheet,this,"Worksheet",!1,4)),this._W},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"address",{get:function(){return N("address",this._A,"RangeAreas",this._isNull),this._A},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"addressLocal",{get:function(){return N("addressLocal",this._Ad,"RangeAreas",this._isNull),this._Ad},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"areaCount",{get:function(){return N("areaCount",this._Ar,"RangeAreas",this._isNull),this._Ar},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"cellCount",{get:function(){return N("cellCount",this._C,"RangeAreas",this._isNull),this._C},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"isEntireColumn",{get:function(){return N("isEntireColumn",this.m_isEntireColumn,"RangeAreas",this._isNull),this.m_isEntireColumn},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"isEntireRow",{get:function(){return N("isEntireRow",this.m_isEntireRow,"RangeAreas",this._isNull),this.m_isEntireRow},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"style",{get:function(){return N("style",this._S,"RangeAreas",this._isNull),this._S},set:function(e){this._S=e,I(this,"Style",e,0)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"_ReferenceId",{get:function(){return N("_ReferenceId",this.__R,"RangeAreas",this._isNull),this.__R},enumerable:!0,configurable:!0}),n.prototype.set=function(e,t){this._recursivelySet(e,t,["style"],["format","dataValidation"],["areas","conditionalFormats","worksheet"])},n.prototype.update=function(e){this._recursivelyUpdate(e)},n.prototype.calculate=function(){R(this,"Calculate",0,[],0,0)},n.prototype.clear=function(e){R(this,"Clear",0,[e],0,0)},n.prototype.convertDataTypeToText=function(){R(this,"ConvertDataTypeToText",0,[],0,0)},n.prototype.convertToLinkedDataType=function(e,t){R(this,"ConvertToLinkedDataType",0,[e,t],0,0)},n.prototype.copyFrom=function(e,t,n,r){R(this,"CopyFrom",0,[e,t,n,r],0,0)},n.prototype.getEntireColumn=function(){return C(e.RangeAreas,this,"GetEntireColumn",1,[],!1,!0,null,4)},n.prototype.getEntireRow=function(){return C(e.RangeAreas,this,"GetEntireRow",1,[],!1,!0,null,4)},n.prototype.getIntersection=function(t){return C(e.RangeAreas,this,"GetIntersection",1,[t],!1,!0,null,4)},n.prototype.getIntersectionOrNullObject=function(t){return C(e.RangeAreas,this,"GetIntersectionOrNullObject",1,[t],!1,!0,null,4)},n.prototype.getOffsetRangeAreas=function(t,n){return C(e.RangeAreas,this,"GetOffsetRangeAreas",1,[t,n],!1,!0,null,4)},n.prototype.getSpecialCells=function(t,n){return C(e.RangeAreas,this,"GetSpecialCells",1,[t,n],!1,!0,null,4)},n.prototype.getSpecialCellsOrNullObject=function(t,n){return C(e.RangeAreas,this,"GetSpecialCellsOrNullObject",1,[t,n],!1,!0,null,4)},n.prototype.getTables=function(t){return C(e.TableScopedCollection,this,"GetTables",1,[t],!0,!1,null,4)},n.prototype.getUsedRangeAreas=function(t){return C(e.RangeAreas,this,"GetUsedRangeAreas",1,[t],!1,!0,null,4)},n.prototype.getUsedRangeAreasOrNullObject=function(t){return C(e.RangeAreas,this,"GetUsedRangeAreasOrNullObject",1,[t],!1,!0,null,4)},n.prototype.setDirty=function(){R(this,"SetDirty",0,[],0,0)},n.prototype._KeepReference=function(){R(this,"_KeepReference",1,[],0,0)},n.prototype._handleResult=function(e){if(t.prototype._handleResult.call(this,e),!x(e)){var n=e;U(this,n),T(n.Address)||(this._A=n.Address),T(n.AddressLocal)||(this._Ad=n.AddressLocal),T(n.AreaCount)||(this._Ar=n.AreaCount),T(n.CellCount)||(this._C=n.CellCount),T(n.IsEntireColumn)||(this.m_isEntireColumn=n.IsEntireColumn),T(n.IsEntireRow)||(this.m_isEntireRow=n.IsEntireRow),T(n.Style)||(this._S=n.Style),T(n._ReferenceId)||(this.__R=n._ReferenceId),L(this,n,["areas","Areas","conditionalFormats","ConditionalFormats","dataValidation","DataValidation","format","Format","worksheet","Worksheet"])}},n.prototype.load=function(e){return M(this,e)},n.prototype.retrieve=function(e){return j(this,e)},n.prototype._handleIdResult=function(e){t.prototype._handleIdResult.call(this,e),x(e)||T(e._ReferenceId)||(this.__R=e._ReferenceId)},n.prototype._handleRetrieveResult=function(e,n){t.prototype._handleRetrieveResult.call(this,e,n),H(this,e,n)},n.prototype.track=function(){return this.context.trackedObjects.add(this),this},n.prototype.untrack=function(){return this.context.trackedObjects.remove(this),this},n.prototype.toJSON=function(){return k(this,{address:this._A,addressLocal:this._Ad,areaCount:this._Ar,cellCount:this._C,isEntireColumn:this.m_isEntireColumn,isEntireRow:this.m_isEntireRow,style:this._S},{areas:this._Are,conditionalFormats:this._Co,dataValidation:this._D,format:this._F})},n.prototype.setMockData=function(e){W(this,e)},n.prototype.ensureUnchanged=function(e){E(this,e)},n}(OfficeExtension.ClientObject);e.RangeAreas=ae;var se=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return __extends(n,t),Object.defineProperty(n.prototype,"_className",{get:function(){return"WorkbookRangeAreas"},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"_scalarPropertyNames",{get:function(){return["_ReferenceId","addresses"]},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"_scalarPropertyOriginalNames",{get:function(){return["_ReferenceId","Addresses"]},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"_navigationPropertyNames",{get:function(){return["ranges","areas"]},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"areas",{get:function(){return this._Ar||(this._Ar=S(e.RangeAreasCollection,this,"Areas",!0,4)),this._Ar},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"ranges",{get:function(){return this._R||(this._R=S(e.RangeCollection,this,"Ranges",!0,4)),this._R},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"addresses",{get:function(){return N("addresses",this._A,"WorkbookRangeAreas",this._isNull),this._A},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"_ReferenceId",{get:function(){return N("_ReferenceId",this.__R,"WorkbookRangeAreas",this._isNull),this.__R},enumerable:!0,configurable:!0}),n.prototype.getRangeAreasBySheet=function(t){return C(e.RangeAreas,this,"GetRangeAreasBySheet",1,[t],!1,!0,null,4)},n.prototype.getRangeAreasOrNullObjectBySheet=function(t){return C(e.RangeAreas,this,"GetRangeAreasOrNullObjectBySheet",1,[t],!1,!0,null,4)},n.prototype._KeepReference=function(){R(this,"_KeepReference",1,[],0,0)},n.prototype._handleResult=function(e){if(t.prototype._handleResult.call(this,e),!x(e)){var n=e;U(this,n),T(n.Addresses)||(this._A=n.Addresses),T(n._ReferenceId)||(this.__R=n._ReferenceId),L(this,n,["areas","Areas","ranges","Ranges"])}},n.prototype.load=function(e){return M(this,e)},n.prototype.retrieve=function(e){return j(this,e)},n.prototype._handleIdResult=function(e){t.prototype._handleIdResult.call(this,e),x(e)||T(e._ReferenceId)||(this.__R=e._ReferenceId)},n.prototype._handleRetrieveResult=function(e,n){t.prototype._handleRetrieveResult.call(this,e,n),H(this,e,n)},n.prototype.track=function(){return this.context.trackedObjects.add(this),this},n.prototype.untrack=function(){return this.context.trackedObjects.remove(this),this},n.prototype.toJSON=function(){return k(this,{addresses:this._A},{areas:this._Ar,ranges:this._R})},n.prototype.setMockData=function(e){W(this,e)},n.prototype.ensureUnchanged=function(e){E(this,e)},n}(OfficeExtension.ClientObject);e.WorkbookRangeAreas=se;var le=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return __extends(n,t),Object.defineProperty(n.prototype,"_className",{get:function(){return"RangeView"},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"_scalarPropertyNames",{get:function(){return["numberFormat","values","text","formulas","formulasLocal","formulasR1C1","valueTypes","rowCount","columnCount","cellAddresses","index"]},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"_scalarPropertyOriginalNames",{get:function(){return["NumberFormat","Values","Text","Formulas","FormulasLocal","FormulasR1C1","ValueTypes","RowCount","ColumnCount","CellAddresses","Index"]},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"_scalarPropertyUpdateable",{get:function(){return[!0,!0,!1,!0,!0,!0,!1,!1,!1,!1,!1]},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"_navigationPropertyNames",{get:function(){return["rows"]},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"rows",{get:function(){return this._Ro||(this._Ro=S(e.RangeViewCollection,this,"Rows",!0,4)),this._Ro},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"cellAddresses",{get:function(){return N("cellAddresses",this._C,"RangeView",this._isNull),this._C},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"columnCount",{get:function(){return N("columnCount",this._Co,"RangeView",this._isNull),this._Co},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"formulas",{get:function(){return N("formulas",this._F,"RangeView",this._isNull),this._F},set:function(e){this._F=e,I(this,"Formulas",e,0)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"formulasLocal",{get:function(){return N("formulasLocal",this._Fo,"RangeView",this._isNull),this._Fo},set:function(e){this._Fo=e,I(this,"FormulasLocal",e,0)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"formulasR1C1",{get:function(){return N("formulasR1C1",this._For,"RangeView",this._isNull),this._For},set:function(e){this._For=e,I(this,"FormulasR1C1",e,0)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"index",{get:function(){return N("index",this._I,"RangeView",this._isNull),this._I},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"numberFormat",{get:function(){return N("numberFormat",this._N,"RangeView",this._isNull),this._N},set:function(e){this._N=e,I(this,"NumberFormat",e,0)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"rowCount",{get:function(){return N("rowCount",this._R,"RangeView",this._isNull),this._R},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"text",{get:function(){return N("text",this._T,"RangeView",this._isNull),this._T},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"valueTypes",{get:function(){return N("valueTypes",this._Va,"RangeView",this._isNull),this._Va},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"values",{get:function(){return N("values",this._V,"RangeView",this._isNull),this._V},set:function(e){this._V=e,I(this,"Values",e,0)},enumerable:!0,configurable:!0}),n.prototype.set=function(e,t){this._recursivelySet(e,t,["numberFormat","values","formulas","formulasLocal","formulasR1C1"],[],["rows"])},n.prototype.update=function(e){this._recursivelyUpdate(e)},n.prototype.getRange=function(){return C(e.Range,this,"GetRange",1,[],!1,!0,null,4)},n.prototype._handleResult=function(e){if(t.prototype._handleResult.call(this,e),!x(e)){var n=e;U(this,n),T(n.CellAddresses)||(this._C=n.CellAddresses),T(n.ColumnCount)||(this._Co=n.ColumnCount),T(n.Formulas)||(this._F=n.Formulas),T(n.FormulasLocal)||(this._Fo=n.FormulasLocal),T(n.FormulasR1C1)||(this._For=n.FormulasR1C1),T(n.Index)||(this._I=n.Index),T(n.NumberFormat)||(this._N=n.NumberFormat),T(n.RowCount)||(this._R=n.RowCount),T(n.Text)||(this._T=n.Text),T(n.ValueTypes)||(this._Va=n.ValueTypes),T(n.Values)||(this._V=n.Values),L(this,n,["rows","Rows"])}},n.prototype.load=function(e){return M(this,e)},n.prototype.retrieve=function(e){return j(this,e)},n.prototype._handleRetrieveResult=function(e,n){t.prototype._handleRetrieveResult.call(this,e,n),H(this,e,n)},n.prototype.toJSON=function(){return k(this,{cellAddresses:this._C,columnCount:this._Co,formulas:this._F,formulasLocal:this._Fo,formulasR1C1:this._For,index:this._I,numberFormat:this._N,rowCount:this._R,text:this._T,values:this._V,valueTypes:this._Va},{rows:this._Ro})},n.prototype.setMockData=function(e){W(this,e)},n.prototype.ensureUnchanged=function(e){E(this,e)},n}(OfficeExtension.ClientObject);e.RangeView=le;var ue=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return __extends(n,t),Object.defineProperty(n.prototype,"_className",{get:function(){return"RangeViewCollection"},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"_isCollection",{get:function(){return!0},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"items",{get:function(){return N("items",this.m__items,"RangeViewCollection",this._isNull),this.m__items},enumerable:!0,configurable:!0}),n.prototype.getCount=function(){return w("RangeViewCollection.getCount",v,"1.4",O),R(this,"GetCount",1,[],4,0)},n.prototype.getItemAt=function(t){return C(e.RangeView,this,"GetItemAt",1,[t],!1,!1,null,4)},n.prototype._handleResult=function(n){if(t.prototype._handleResult.call(this,n),!x(n)){var r=n;if(U(this,r),!x(r[OfficeExtension.Constants.items])){this.m__items=[];for(var i=r[OfficeExtension.Constants.items],o=0;o6&&"Date("===t.slice(0,5)&&")"===t.slice(-1)&&(n=new Date(parseInt(t.slice(5,-1))))?n:t}))}(t.Value))},e.Setting_Value_Set=function(e,n){if(!x(n)){e.m_value=n;var r=t(n);return I(e,"Value",r,0),{handled:!0}}return{handled:!1}}}(b=e._CC||(e._CC={}));var he=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return __extends(n,t),Object.defineProperty(n.prototype,"_className",{get:function(){return"NamedItemCollection"},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"_isCollection",{get:function(){return!0},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"items",{get:function(){return N("items",this.m__items,"NamedItemCollection",this._isNull),this.m__items},enumerable:!0,configurable:!0}),n.prototype.add=function(t,n,r){return w("NamedItemCollection.add",v,"1.4",O),C(e.NamedItem,this,"Add",0,[t,n,r],!1,!0,null,0)},n.prototype.addFormulaLocal=function(t,n,r){return w("NamedItemCollection.addFormulaLocal",v,"1.4",O),C(e.NamedItem,this,"AddFormulaLocal",0,[t,n,r],!1,!1,null,0)},n.prototype.getCount=function(){return w("NamedItemCollection.getCount",v,"1.4",O),R(this,"GetCount",1,[],4,0)},n.prototype.getItem=function(t){return A(e.NamedItem,this,[t])},n.prototype.getItemOrNullObject=function(t){return w("NamedItemCollection.getItemOrNullObject",v,"1.4",O),C(e.NamedItem,this,"GetItemOrNullObject",1,[t],!1,!1,null,4)},n.prototype._handleResult=function(n){if(t.prototype._handleResult.call(this,n),!x(n)){var r=n;if(U(this,r),!x(r[OfficeExtension.Constants.items])){this.m__items=[];for(var i=r[OfficeExtension.Constants.items],o=0;o"},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"_scalarPropertyNames",{get:function(){return["error","value"]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"_scalarPropertyOriginalNames",{get:function(){return["Error","Value"]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"error",{get:function(){return N("error",this._E,"FunctionResult",this._isNull),this._E},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"value",{get:function(){return N("value",this._V,"FunctionResult",this._isNull),this._V},enumerable:!0,configurable:!0}),t.prototype._handleResult=function(t){if(e.prototype._handleResult.call(this,t),!x(t)){var n=t;U(this,n),T(n.Error)||(this._E=n.Error),T(n.Value)||(this._V=n.Value)}},t.prototype.load=function(e){return M(this,e)},t.prototype.retrieve=function(e){return j(this,e)},t.prototype._handleRetrieveResult=function(t,n){e.prototype._handleRetrieveResult.call(this,t,n),H(this,t,n)},t.prototype.toJSON=function(){return k(this,{error:this._E,value:this._V},{})},t.prototype.setMockData=function(e){W(this,e)},t.prototype.ensureUnchanged=function(e){E(this,e)},t}(OfficeExtension.ClientObject);e.FunctionResult=vr;var Sr,Cr=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),Object.defineProperty(t.prototype,"_className",{get:function(){return"Functions"},enumerable:!0,configurable:!0}),t.prototype.abs=function(e){return C(vr,this,"Abs",0,[e],!1,!0,null,0)},t.prototype.accrInt=function(e,t,n,r,i,o,a,s){return C(vr,this,"AccrInt",0,[e,t,n,r,i,o,a,s],!1,!0,null,0)},t.prototype.accrIntM=function(e,t,n,r,i){return C(vr,this,"AccrIntM",0,[e,t,n,r,i],!1,!0,null,0)},t.prototype.acos=function(e){return C(vr,this,"Acos",0,[e],!1,!0,null,0)},t.prototype.acosh=function(e){return C(vr,this,"Acosh",0,[e],!1,!0,null,0)},t.prototype.acot=function(e){return C(vr,this,"Acot",0,[e],!1,!0,null,0)},t.prototype.acoth=function(e){return C(vr,this,"Acoth",0,[e],!1,!0,null,0)},t.prototype.amorDegrc=function(e,t,n,r,i,o,a){return C(vr,this,"AmorDegrc",0,[e,t,n,r,i,o,a],!1,!0,null,0)},t.prototype.amorLinc=function(e,t,n,r,i,o,a){return C(vr,this,"AmorLinc",0,[e,t,n,r,i,o,a],!1,!0,null,0)},t.prototype.and=function(){for(var e=[],t=0;t-1};d.prototype.append=function(e,t){e=p(e),t=h(t);var n=this.map[e];this.map[e]=n?n+","+t:t},d.prototype.delete=function(e){delete this.map[p(e)]},d.prototype.get=function(e){return e=p(e),this.has(e)?this.map[e]:null},d.prototype.has=function(e){return this.map.hasOwnProperty(p(e))},d.prototype.set=function(e,t){this.map[p(e)]=h(t)},d.prototype.forEach=function(e,t){for(var n in this.map)this.map.hasOwnProperty(n)&&e.call(t,this.map[n],n,this)},d.prototype.keys=function(){var e=[];return this.forEach((function(t,n){e.push(n)})),f(e)},d.prototype.values=function(){var e=[];return this.forEach((function(t){e.push(t)})),f(e)},d.prototype.entries=function(){var e=[];return this.forEach((function(t,n){e.push([n,t])})),f(e)},n&&(d.prototype[Symbol.iterator]=d.prototype.entries);var u=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];O.prototype.clone=function(){return new O(this,{body:this._bodyInit})},b.call(O.prototype),b.call(S.prototype),S.prototype.clone=function(){return new S(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new d(this.headers),url:this.url})},S.error=function(){var e=new S(null,{status:0,statusText:""});return e.type="error",e};var c=[301,302,303,307,308];S.redirect=function(e,t){if(-1===c.indexOf(t))throw new RangeError("Invalid status code");return new S(null,{status:t,headers:{location:e}})},e.Headers=d,e.Request=O,e.Response=S,e.fetch=function(e,t){return new Promise((function(n,i){var o=new O(e,t),a=new XMLHttpRequest;a.onload=function(){var e,t,r={status:a.status,statusText:a.statusText,headers:(e=a.getAllResponseHeaders()||"",t=new d,e.split(/\r?\n/).forEach((function(e){var n=e.split(":"),r=n.shift().trim();if(r){var i=n.join(":").trim();t.append(r,i)}})),t)};r.url="responseURL"in a?a.responseURL:r.headers.get("X-Request-URL");var i="response"in a?a.response:a.responseText;n(new S(i,r))},a.onerror=function(){i(new TypeError("Network request failed"))},a.ontimeout=function(){i(new TypeError("Network request failed"))},a.open(o.method,o.url,!0),"include"===o.credentials&&(a.withCredentials=!0),"responseType"in a&&r&&(a.responseType="blob"),o.headers.forEach((function(e,t){a.setRequestHeader(t,e)})),a.send(void 0===o._bodyInit?null:o._bodyInit)}))},e.fetch.polyfill=!0}function p(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.\^_`|~]/i.test(e))throw new TypeError("Invalid character in header field name");return e.toLowerCase()}function h(e){return"string"!=typeof e&&(e=String(e)),e}function f(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return n&&(t[Symbol.iterator]=function(){return t}),t}function d(e){this.map={},e instanceof d?e.forEach((function(e,t){this.append(t,e)}),this):Array.isArray(e)?e.forEach((function(e){this.append(e[0],e[1])}),this):e&&Object.getOwnPropertyNames(e).forEach((function(t){this.append(t,e[t])}),this)}function m(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function y(e){return new Promise((function(t,n){e.onload=function(){t(e.result)},e.onerror=function(){n(e.error)}}))}function g(e){var t=new FileReader,n=y(t);return t.readAsArrayBuffer(e),n}function _(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function b(){return this.bodyUsed=!1,this._initBody=function(e){if(this._bodyInit=e,e)if("string"==typeof e)this._bodyText=e;else if(r&&Blob.prototype.isPrototypeOf(e))this._bodyBlob=e;else if(i&&FormData.prototype.isPrototypeOf(e))this._bodyFormData=e;else if(t&&URLSearchParams.prototype.isPrototypeOf(e))this._bodyText=e.toString();else if(o&&r&&s(e))this._bodyArrayBuffer=_(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer]);else{if(!o||!ArrayBuffer.prototype.isPrototypeOf(e)&&!l(e))throw new Error("unsupported BodyInit type");this._bodyArrayBuffer=_(e)}else this._bodyText="";this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):t&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},r&&(this.blob=function(){var e=m(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?m(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(g)}),this.text=function(){var e,t,n,r=m(this);if(r)return r;if(this._bodyBlob)return e=this._bodyBlob,n=y(t=new FileReader),t.readAsText(e),n;if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),n=new Array(t.length),r=0;r-1?r:n),this.mode=t.mode||this.mode||null,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&i)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(i)}function v(e){var t=new FormData;return e.trim().split("&").forEach((function(e){if(e){var n=e.split("="),r=n.shift().replace(/\+/g," "),i=n.join("=").replace(/\+/g," ");t.append(decodeURIComponent(r),decodeURIComponent(i))}})),t}function S(e,t){t||(t={}),this.type="default",this.status="status"in t?t.status:200,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in t?t.statusText:"OK",this.headers=new d(t.headers),this.url=t.url||"",this._initBody(e)}}("undefined"!=typeof self?self:this)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(4);t.default=function(e){function t(){Office.onReady((function(e){e.host===Office.HostType.Excel?function e(){CustomFunctionMappings&&CustomFunctionMappings.__delay__?setTimeout(e,50):r.CustomFunctions.initialize()}():console.warn("Warning: Expected to be loaded inside of an Excel add-in.")}))}window.CustomFunctions=window.CustomFunctions||{},window.CustomFunctions.setCustomFunctionInvoker=r.setCustomFunctionInvoker,window.CustomFunctions.Error=r.CustomFunctionError,window.CustomFunctions.ErrorCode=r.ErrorCode,window.CustomFunctions.FormattedNumber=r.CustomFunctionFormattedNumber,window.CustomFunctions.Entity=r.CustomFunctionEntity,window.CustomFunctions.WebImage=r.CustomFunctionWebImage,window.CustomFunctions.Attribution=r.CustomFunctionAttribution,window.CustomFunctions.Provider=r.CustomFunctionProvider,r.setCustomFunctionAssociation(window.CustomFunctions._association),e&&("loading"===document.readyState?document.addEventListener("DOMContentLoaded",t):t())}},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return(r=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])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.CustomFunctionsContainer=t.CustomFunctions=t.setCustomFunctionInvoker=t.setCustomFunctionAssociation=t.customFunctionProxy=t.CustomFunctionProxy=t.CreateCustomFunctionInstance=t.CustomFunctionProvider=t.CustomFunctionAttribution=t.CustomFunctionWebImage=t.CustomFunctionFormattedNumber=t.CustomFunctionEntity=t.CustomFunctionError=t.ErrorCode=t.InvocationContext=t.Script=void 0;var o=n(0),a=n(0),s=o.BatchApiHelper.createPropertyObject,l=(o.BatchApiHelper.createMethodObject,o.BatchApiHelper.createIndexerObject,o.BatchApiHelper.createRootServiceObject),u=o.BatchApiHelper.createTopLevelServiceObject,c=(o.BatchApiHelper.createChildItemObject,o.BatchApiHelper.invokeMethod),p=(o.BatchApiHelper.invokeEnsureUnchanged,o.BatchApiHelper.invokeSetProperty,o.Utility.isNullOrUndefined),h=(o.Utility.isUndefined,o.Utility.throwIfNotLoaded,o.Utility.throwIfApiNotSupported),f=o.Utility.load,d=(o.Utility.retrieve,o.Utility.toJson),m=o.Utility.fixObjectPathIfNecessary,y=o.Utility._handleNavigationPropertyResults,g=(o.Utility.adjustToDateTime,o.Utility.processRetrieveResult),_=(o.Utility.setMockData,o.CommonUtility.calculateApiFlags,function(e){function t(t){var n=e.call(this,t)||this;return n.m_customFunctions=x.newObject(n),n.m_container=l(N,n),n._rootObject=n.m_container,n._rootObjectPropertyName="customFunctionsContainer",n._requestFlagModifier=2176,n}return i(t,e),Object.defineProperty(t.prototype,"customFunctions",{get:function(){return this.m_customFunctions},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"customFunctionsContainer",{get:function(){return this.m_container},enumerable:!1,configurable:!0}),t.prototype._processOfficeJsErrorResponse=function(e,t){5004===e&&(t.ErrorCode=T.invalidOperationInCellEditMode,t.ErrorMessage=o.Utility._getResourceString(o.ResourceStrings.invalidOperationInCellEditMode))},t}(o.ClientRequestContext));t.Script={_CustomFunctionMetadata:{}};var b,O=function(){function e(e,t,n,r,i){this._functionName=e,p(t)||(this._address=t),p(n)||(this._parameterAddresses=n),this.setResult=r,this.setError=i}return Object.defineProperty(e.prototype,"onCanceled",{get:function(){if(!p(this._onCanceled)&&"function"==typeof this._onCanceled)return this._onCanceled},set:function(e){this._onCanceled=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"functionName",{get:function(){return this._functionName},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"address",{get:function(){return this._address},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"parameterAddresses",{get:function(){return this._parameterAddresses},enumerable:!1,configurable:!0}),e}();t.InvocationContext=O,function(e){e.Info="Medium",e.Error="Unexpected",e.Verbose="Verbose"}(b||(b={}));var v,S=function(e,t){this.Severity=e,this.Message=t},C=function(){function e(){}return e.logEvent=function(t,n,r){if(e.s_shouldLog||o.CoreUtility._logEnabled){var i=t.Severity+" "+t.Message+n;if(r&&(i=i+" "+r),o.Utility.log(i),e.s_shouldLog)switch(t.Severity){case b.Verbose:null!==console.log&&console.log(i);break;case b.Info:null!==console.info&&console.info(i);break;case b.Error:null!==console.error&&console.error(i)}}},e.shouldLog=function(){try{return!p(console)&&!p(window)&&window.name&&"string"==typeof window.name&&JSON.parse(window.name)[e.CustomFunctionLoggingFlag]}catch(e){return o.Utility.log(JSON.stringify(e)),!1}},e.CustomFunctionLoggingFlag="CustomFunctionsRuntimeLogging",e.s_shouldLog=e.shouldLog(),e}();!function(e){e.invalidValue="#VALUE!",e.notAvailable="#N/A",e.divisionByZero="#DIV/0!",e.invalidNumber="#NUM!",e.nullReference="#NULL!",e.invalidName="#NAME?",e.invalidReference="#REF!"}(v=t.ErrorCode||(t.ErrorCode={}));var A=function(e){function t(n,r,i){var o=e.call(this,r||"")||this;return o.type=t.valueType,o.basicType=t.valueType,Object.setPrototypeOf(o,t.prototype),o.code=n||v.invalidValue,o.basicValue=n||v.invalidValue,o.errorSubType=i,o.stack=void 0,o}return i(t,e),t.prototype.toJSON=function(){return{valueType:"CustomFunctionError",code:this.code,type:this.type,basicValue:this.basicValue,basicType:this.type,errorSubType:this.errorSubType,message:this._getMessage(),errorType:this._getErrorType()}},t.prototype._getErrorType=function(){switch(this.basicValue){case v.invalidValue:return"Value";case v.divisionByZero:return"Div0";case v.notAvailable:return"Na";case v.invalidNumber:return"Num";case v.invalidName:return"Name";case v.invalidReference:return"Ref";case v.nullReference:return"Null";default:return}},t.prototype._getMessage=function(){switch(this.basicValue){case v.invalidValue:case v.notAvailable:return""==this.message?void 0:this.message;case v.divisionByZero:case v.invalidNumber:case v.invalidName:case v.invalidReference:case v.nullReference:default:return}},t.valueType="Error",t}(Error);t.CustomFunctionError=A;var P=function(){function e(t,n){this.type=e.valueType,this.basicValue="#VALUE!",this.basicType="Error",Object.setPrototypeOf(this,e.prototype),this.text=t,this.properties=n}return e.prototype.toJSON=function(){return{type:this.type,text:this.text,basicValue:this.basicValue,basicType:this.basicType,properties:this.properties}},e.valueType="Entity",e}();t.CustomFunctionEntity=P;var F=function(){function e(t,n){this.type=e.valueType,this.basicValue=t,this.numberFormat=n}return e.prototype.toJSON=function(){return{type:this.type,basicValue:this.basicValue,numberFormat:this.numberFormat}},e.valueType="FormattedNumber",e}();t.CustomFunctionFormattedNumber=F;var D=function(){function e(t,n,r,i,o){this.type=e.valueType,this.basicValue="#VALUE!",this.basicType="Error",this.address=t,null!=i&&(this.attribution=i),null!=o&&(this.provider=o),null!=n&&(this.altText=n),null!=r&&(this.relatedImagesAddress=r)}return e.prototype.toJSON=function(){return{type:this.type,basicValue:this.basicValue,basicType:this.basicType,address:this.address,altText:this.altText,relatedImagesAddress:this.relatedImagesAddress,attribution:null==this.attribution?void 0:this.attribution.map((function(e){return e.toJSON()})),provider:null==this.provider?void 0:this.provider.toJSON()}},e.valueType="WebImage",e}();t.CustomFunctionWebImage=D;var R=function(){function e(e,t,n,r){null!=e&&(this.licenseAddress=e),null!=t&&(this.licenseText=t),null!=n&&(this.sourceAddress=n),null!=r&&(this.sourceText=r)}return e.prototype.toJSON=function(){return{licenseAddress:this.licenseAddress,licenseText:this.licenseText,sourceAddress:this.sourceAddress,sourceText:this.sourceText}},e}();t.CustomFunctionAttribution=R;var E=function(){function e(e,t,n){this.description=e,null!=t&&(this.logoSourceAddress=t),null!=n&&(this.logoTargetAddress=n)}return e.prototype.toJSON=function(){return{description:this.description,logoSourceAddress:this.logoSourceAddress,logoTargetAddress:this.logoTargetAddress}},e}();t.CustomFunctionProvider=E,t.CreateCustomFunctionInstance=function e(t){if(t instanceof Array)return t.map((function(t){return e(t)}));if(!(t instanceof Object))return t;var n=JSON.parse(t.value);switch(n.type){case P.valueType:return new P(n.text,n.properties);case F.valueType:return new F(n.primitive,n.numberFormat);case A.valueType:return new A(n.primitive,void 0,n.errorSubCode);case D.valueType:return new D(n.address,n.altText,n.relatedImagesAddress,n.attribution,n.provider);case"Double":case"String":case"Boolean":return n.primitive;default:throw o.Utility.createRuntimeError(T.generalException,"message","CustomFunctionProxy.createRichDataFromJsonString")}};var I=function(){function e(){this._whenInit=void 0,this._isInit=!1,this._setResultsDelayMillis=50,this._setResultsOverdueDelayMillis=2e3,this._maxContextSyncExecutionDurationMills=15e3,this._minContextSyncIntervalMills=500,this._smallerMinContextSyncIntervalMills=200,this._maxContextSyncIntervalMills=2e3,this._setResultsLifeMillis=6e4,this._ensureInitRetryDelayMillis=500,this._resultEntryBuffer={},this._resultEntryRetryBuffer={},this._retryBufferBodySize=0,this._isSetResultsTaskScheduled=!1,this._setResultsTaskOverdueTime=0,this._inProgressContextSyncExpectedFinishTime=0,this._batchQuotaMillis=1e3,this._invocationContextMap={},this._maxResultSize=2e6}return e.prototype._initSettings=function(){if("object"==typeof t.Script&&"object"==typeof t.Script._CustomFunctionSettings){if("number"==typeof t.Script._CustomFunctionSettings.setResultsDelayMillis){var e=t.Script._CustomFunctionSettings.setResultsDelayMillis;e=Math.max(0,e),e=Math.min(1e3,e),this._setResultsDelayMillis=e}if("number"==typeof t.Script._CustomFunctionSettings.ensureInitRetryDelayMillis){var n=t.Script._CustomFunctionSettings.ensureInitRetryDelayMillis;n=Math.max(0,n),n=Math.min(2e3,n),this._ensureInitRetryDelayMillis=n}if("number"==typeof t.Script._CustomFunctionSettings.setResultsLifeMillis){var r=t.Script._CustomFunctionSettings.setResultsLifeMillis;r=Math.max(0,r),r=Math.min(6e5,r),this._setResultsLifeMillis=r}if("number"==typeof t.Script._CustomFunctionSettings.batchQuotaMillis){var i=t.Script._CustomFunctionSettings.batchQuotaMillis;i=Math.max(0,i),i=Math.min(1e3,i),this._batchQuotaMillis=i}}},e.prototype.ensureInit=function(e){var t=this;return this._initSettings(),void 0===this._whenInit&&(this._whenInit=o.Utility._createPromiseFromResult(null).then((function(){if(!t._isInit)return e.eventRegistration.register(5,"",t._handleMessage.bind(t))})).then((function(){t._isInit=!0}))),this._isInit||e._pendingRequest._addPreSyncPromise(this._whenInit),this._whenInit},e.prototype.setCustomFunctionInvoker=function(e){"object"==typeof CustomFunctionMappings&&delete CustomFunctionMappings.__delay__,this._invoker=e},e.prototype.setCustomFunctionAssociation=function(e){var t=this;this._customFunctionMappingsUpperCase=void 0,this._association=e,this._association&&this._association.onchange((function(){t._customFunctionMappingsUpperCase=void 0}))},e.prototype._initFromHostBridge=function(e){var t=this;this._initSettings(),e.addHostMessageHandler((function(e){3===e.type?t._handleMessage(e.message):4===e.type&&t._handleSettings(e.message)})),this._isInit=!0,this._whenInit=o.CoreUtility.Promise.resolve()},e.prototype._handleSettings=function(e){o.Utility.log("CustomFunctionProxy._handleSettings:"+JSON.stringify(e)),e&&"object"==typeof e&&(C.s_shouldLog=e[C.CustomFunctionLoggingFlag])},e.prototype._handleMessage=function(t){try{o.Utility.log("CustomFunctionProxy._handleMessage"),o.Utility.checkArgumentNull(t,"args");for(var n=t.entries,r=[],i=[],a=[],s=0;s0&&this._handleMetadataEntries(a),r.length>0){var l=this._batchInvocationEntries(r);l.length>0&&this._invokeRemainingBatchEntries(l,0)}i.length>0&&this._handleCancellationEntries(i)}catch(t){throw e._tryLog(t),t}return o.Utility._createPromiseFromResult(null)},e.toLogMessage=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._tryLog=function(t){var n=e.toLogMessage(t);o.Utility.log(n)},e.prototype._handleMetadataEntries=function(e){for(var n=0;n0&&e>this._setResultsTaskOverdueTime)return o.Utility.log("SetResultsTask overdue"),void this._executeSetResultsTask();this._isSetResultsTaskScheduled||(o.Utility.log("setTimeout(CustomFunctionProxy._executeSetResultsTask)"),setTimeout(this._executeSetResultsTask.bind(this),this._setResultsDelayMillis),this._isSetResultsTaskScheduled=!0,this._setResultsTaskOverdueTime=e+this._setResultsDelayMillis+this._setResultsOverdueDelayMillis)},e.prototype._convertCustomFunctionInvocationResultToArray=function(e){var t=[];return t.push(e.id),t.push(!e.failed),o.CoreUtility.isUndefined(e.value)?t.push(null):t.push(e.value),e.failed&&(o.CoreUtility.isUndefined(e.errorCode)?t.push(0):t.push(e.errorCode)),o.Utility.isSetSupported("CustomFunctions","1.9")&&t.push(e.outboundData),t},e.prototype._executeSetResultsTask=function(){var e=this;o.Utility.log("CustomFunctionProxy._executeSetResultsTask");var t=Date.now();if(this._inProgressContextSyncExpectedFinishTime>0&&this._inProgressContextSyncExpectedFinishTime>t)return o.Utility.log("context.sync() is in progress. setTimeout(CustomFunctionProxy._executeSetResultsTask)"),setTimeout(this._executeSetResultsTask.bind(this),this._setResultsDelayMillis),void(this._setResultsTaskOverdueTime=t+this._setResultsDelayMillis+this._setResultsOverdueDelayMillis);this._isSetResultsTaskScheduled=!1,this._setResultsTaskOverdueTime=0;var n={},r=!1;x.isFeatureEnabled(1)&&Object.keys(this._resultEntryRetryBuffer).length>0?(n=this._resultEntryRetryBuffer,this._resultEntryRetryBuffer={},this._retryBufferBodySize=2,r=!0):(n=this._resultEntryBuffer,this._resultEntryBuffer={});var i=o.Utility.isSetSupported("CustomFunctions","1.7"),a=[];for(var s in n)i?a.push(this._convertCustomFunctionInvocationResultToArray(n[s].result)):a.push(n[s].result);if(0!==a.length){var l=new _;i?l.customFunctions.setInvocationArrayResults(a):l.customFunctions.setInvocationResults(a);var u=Date.now();this._inProgressContextSyncExpectedFinishTime=u+this._maxContextSyncExecutionDurationMills,l.sync().then((function(t){var n=Date.now();e._clearInProgressContextSyncExpectedFinishTimeAfterMinInterval(n-u),r&&e._ensureSetResultsTaskIsScheduled(n)}),(function(t){var r=Date.now();e._clearInProgressContextSyncExpectedFinishTimeAfterMinInterval(r-u),x.isFeatureEnabled(1)&&t.code==o.ErrorCodes.requestPayloadSizeLimitExceeded?e._restoreAndSliceResultEntries(r,n):e._restoreResultEntries(r,n),e._ensureSetResultsTaskIsScheduled(r)}))}},e.prototype._restoreResultEntries=function(e,t){for(var n in t){var r=t[n];e-r.timeCreated<=this._setResultsLifeMillis&&(this._resultEntryBuffer[n]||(this._resultEntryBuffer[n]=r))}},e.prototype._restoreAndSliceResultEntries=function(e,t){for(var n in t){var r=t[n],i=void 0;if(e-r.timeCreated<=this._setResultsLifeMillis&&!this._resultEntryBuffer[n]){try{i=JSON.stringify(this._convertCustomFunctionInvocationResultToArray(r.result)).length+1}catch(e){this._resultEntryBuffer[n]=r,o.Utility.log("Result can't pass in JSON.stringify");continue}this._retryBufferBodySize+i=0},n.initialize=function(){var e=this,r=new _;return t.customFunctionProxy.ensureInit(r).then((function(){var i;return r.customFunctions._SetOsfControlContainerReadyForCustomFunctions(),o.Utility.isSetSupported("CustomFunctions","1.9")&&(i=r.customFunctions._GetEnabledFeatures()),o.Utility.log("OsfControl activation lifecycle: Set OsfControlContainer ready for CustomFunctions"),r._customData="SetOsfControlContainerReadyForCustomFunctions",r.sync().then((function(){p(i)||(e._enabledFeature=i.value)})).catch((function(e){!function(e,r){var i=e instanceof o.Error&&e.code===T.invalidOperationInCellEditMode;if(o.CoreUtility.log("Error on starting custom functions: "+e),i){o.CoreUtility.log("Was in cell-edit mode, will try again");var a=t.customFunctionProxy._ensureInitRetryDelayMillis;return new o.CoreUtility.Promise((function(e){return setTimeout(e,a)})).then((function(){return n.initialize()}))}throw e}(e)}))}))},n.prototype.setInvocationArrayResults=function(e){h("CustomFunctions.setInvocationArrayResults","CustomFunctions","1.4","Excel"),c(this,"SetInvocationArrayResults",0,[e],2,0)},n.prototype.setInvocationResults=function(e){c(this,"SetInvocationResults",0,[e],2,0)},n.prototype._GetEnabledFeatures=function(){return h("CustomFunctions._GetEnabledFeatures","CustomFunctions","1.4","Excel"),c(this,"_GetEnabledFeatures",1,[],4,0)},n.prototype._SetInvocationError=function(e,t){c(this,"_SetInvocationError",0,[e,t],2,0)},n.prototype._SetInvocationResult=function(e,t){c(this,"_SetInvocationResult",0,[e,t],2,0)},n.prototype._SetOsfControlContainerReadyForCustomFunctions=function(){c(this,"_SetOsfControlContainerReadyForCustomFunctions",0,[],10,0)},n.prototype._handleResult=function(t){e.prototype._handleResult.call(this,t),p(t)||m(this,t)},n.prototype._handleRetrieveResult=function(t,n){e.prototype._handleRetrieveResult.call(this,t,n),g(this,t,n)},n.newObject=function(e){return u(n,e,"Microsoft.ExcelServices.CustomFunctions",!1,4)},n.prototype.toJSON=function(){return d(this,{},{})},n}(o.ClientObject);t.CustomFunctions=x;var T,N=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),Object.defineProperty(t.prototype,"_className",{get:function(){return"CustomFunctionsContainer"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"_navigationPropertyNames",{get:function(){return["customFunctions"]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"customFunctions",{get:function(){return h("CustomFunctionsContainer.customFunctions","CustomFunctions","1.2","Excel"),this._C||(this._C=s(x,this,"CustomFunctions",!1,4)),this._C},enumerable:!1,configurable:!0}),t.prototype._handleResult=function(t){if(e.prototype._handleResult.call(this,t),!p(t)){var n=t;m(this,n),y(this,n,["customFunctions","CustomFunctions"])}},t.prototype.load=function(e){return f(this,e)},t.prototype._handleRetrieveResult=function(t,n){e.prototype._handleRetrieveResult.call(this,t,n),g(this,t,n)},t.prototype.toJSON=function(){return d(this,{},{})},t}(o.ClientObject);t.CustomFunctionsContainer=N,function(e){e.generalException="GeneralException",e.invalidOperation="InvalidOperation",e.invalidOperationInCellEditMode="InvalidOperationInCellEditMode"}(T||(T={}))}]),OSFAriaLogger.AriaLogger.EnableSendingTelemetryWithOTel=!0,OSFAriaLogger.AriaLogger.EnableSendingTelemetryWithLegacyAria=!1,window.OfficeExtensionBatch=window.OfficeExtension,function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=1)}([function(e,t){e.exports=OfficeExtensionBatch},function(e,t,n){"use strict";var r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0?o(a):r()}))}t.getItem=function(e,t){return a((function(){return window.localStorage.getItem(r+e)}),t)},t.setItem=function(e,t,n){return o((function(){return window.localStorage.setItem(r+e,t)}),n)},t.removeItem=function(e,t){return o((function(){return window.localStorage.removeItem(r+e)}),t)},t.clear=function(e){return o((function(){Object.keys(window.localStorage).filter((function(e){return 0===e.indexOf(r)})).forEach((function(e){return window.localStorage.removeItem(e)}))}),e)},t.getAllKeys=function(e){return a((function(){return Object.keys(window.localStorage).filter((function(e){return 0===e.indexOf(r)})).map((function(e){return e.substr(r.length)}))}),e)},t.multiSet=function(e,t){return s(e,(function(e){var t=e[0],n=e[1];return window.localStorage.setItem(r+t,n)}),t)},t.multiRemove=function(e,t){return s(e,(function(e){return window.localStorage.removeItem(r+e)}),t)},t.multiGet=function(e,t){return new Promise((function(n,i){t||(t=function(){});var o=[],a=e.map((function(e){try{return[e,window.localStorage.getItem(r+e)]}catch(e){o.push(e)}})).filter((function(e){return e}));o.length>0?(t(o,a),i(o)):(t(null,a),n(a))}))}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.displayWebDialog=t.Dialog=void 0;var r=n(0),i=function(){function e(e){this._dialog=e}return e.prototype.close=function(){return this._dialog.close(),r.CoreUtility.Promise.resolve()},e}();t.Dialog=i,t.displayWebDialog=function(e,t){return new r.CoreUtility.Promise((function(n,o){if(t.width&&t.height&&(!c(t.width)||!c(t.height)))throw new r.Error({code:"InvalidArgument",message:'Dimensions must be "number%" or number.'});var a,s={width:t.width?parseInt(t.width,10):50,height:t.height?parseInt(t.height,10):50,displayInIframe:t.displayInIFrame||!1};function l(e){t.onMessage&&t.onMessage(e.message,a,e.origin)}function u(e){12006===e.error?t.onClose&&t.onClose():t.onRuntimeError&&t.onRuntimeError(new r.Error(p(e.error)),a)}function c(e){return/^(\-|\+)?([0-9]+)%?$/.test(e)}function p(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"}}Office.context.ui.displayDialogAsync(e,s,(function(e){"failed"===e.status?o(new r.Error(p(e.error.code))):((a=e.value).addEventHandler(Office.EventType.DialogMessageReceived,l),a.addEventHandler(Office.EventType.DialogEventReceived,u),n(new i(a)))}))}))}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.storage=void 0;var r="_OfficeRuntime_Storage_";function i(){window.localStorage.setItem("_OfficeRuntime_Storage_|_unusedKey_",null),window.localStorage.removeItem("_OfficeRuntime_Storage_|_unusedKey_")}function o(e){return new Promise((function(t,n){try{i(),e(),t()}catch(e){n(e)}}))}function a(e){return new Promise((function(t,n){try{i(),t(e())}catch(e){n(e)}}))}function s(e,t){return new Promise((function(n,r){var o=[];try{i()}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)}o.length>0?r(new Error("Unknown error.")):n()}))}t.storage={getItem:function(e){return a((function(){return window.localStorage.getItem(r+e)}))},setItem:function(e,t){return o((function(){return window.localStorage.setItem(r+e,t)}))},removeItem:function(e){return o((function(){return window.localStorage.removeItem(r+e)}))},getItems:function(e){return new Promise((function(t,n){var o={},a=[];try{i()}catch(e){n(e)}e.forEach((function(e){try{var t=window.localStorage.getItem(r+e);o[e]=t||null}catch(e){a.push(e)}})),a.length>0?n(new Error("Unknown error.")):t(o)}))},setItems:function(e){return s(e,(function(t){return window.localStorage.setItem(r+t,e[t])}))},removeItems:function(e){return s(e,(function(e){window.localStorage.removeItem(r+e)}))},getKeys:function(){return a((function(){return Object.keys(window.localStorage).filter((function(e){return 0===e.indexOf(r)})).map((function(e){return e.substr(r.length)}))}))}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.experimentation=void 0;var r=function(){function e(){}return e.prototype.getBooleanFeatureGate=function(e,t){try{var n=Microsoft.Office.WebExtension.FeatureGates[e];return null==n?t:"true"===n.toString().toLowerCase()}catch(e){return t}},e.prototype.getIntFeatureGate=function(e,t){try{var n=parseInt(Microsoft.Office.WebExtension.FeatureGates[e]);return isNaN(n)?t:n}catch(e){return t}},e.prototype.getStringFeatureGate=function(e,t){try{var n=Microsoft.Office.WebExtension.FeatureGates[e];return null==n?t:n}catch(e){return t}},e.prototype.getChangeGate=function(e){return this.getBooleanFeatureGate(e,!0)},e.prototype.getBooleanFeatureGateAsync=function(e,t){return Promise.resolve(this.getBooleanFeatureGate(e,t))},e.prototype.getIntFeatureGateAsync=function(e,t){return Promise.resolve(this.getIntFeatureGate(e,t))},e.prototype.getStringFeatureGateAsync=function(e,t){return Promise.resolve(this.getStringFeatureGate(e,t))},e}();t.experimentation=new r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Message=void 0;var r=n(8);Object.defineProperty(t,"Message",{enumerable:!0,get:function(){return r.Message}})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Message=void 0;var r=n(9),i=function(){function e(){this.listeners={}}return e.prototype.on=function(e,t){return this.add(e,t),new Promise((function(e){e()}))},e.prototype.off=function(e,t){return this.remove(e,t),new Promise((function(e){e()}))},e.prototype.emit=function(e,t){return this.send(e,t),new Promise((function(e){e()}))},Object.defineProperty(e,"instance",{get:function(){return e.singleton||(e.singleton=new e),this.singleton},enumerable:!1,configurable:!0}),e.prototype.setupReceive=function(){Office&&Office.context&&Office.context.messaging&&!Office.context.messaging.onMessage&&(Office.context.messaging.onMessage=this.receiveMessage.bind(this))},e.prototype.add=function(e,t){this.listeners.hasOwnProperty(e)||(this.listeners[e]=new r.ListenerManager,this.setupReceive()),this.listeners[e].add(t)},e.prototype.remove=function(e,t){this.listeners.hasOwnProperty(e)&&(t?this.listeners[e].remove(t):delete this.listeners[e])},e.prototype.send=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.prototype.receiveMessage=function(e){var t=e.eventName,n=e.message;this.listeners.hasOwnProperty(t)&&this.listeners[t].call(n)},e}();t.Message=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ListenerManager=void 0;var r=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}();t.ListenerManager=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Auth=void 0;var r=n(0),i=function(){function e(){}return e.prototype.getAccessToken=function(e){return new r.CoreUtility.Promise((function(t,n){try{Office.context.auth.getAccessTokenAsync(e||{},(function(e){"succeeded"===e.status?t(e.value):n(e.error)}))}catch(e){n(e)}}))},Object.defineProperty(e,"instance",{get:function(){return e.singleton||(e.singleton=new e),e.singleton},enumerable:!1,configurable:!0}),e}();t.Auth=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Ribbon=t.ui=void 0,t.ui={getRibbon:function(){return new Promise((function(e,t){e(new r)}))}};var r=function(){function e(){this.requestContext=new OfficeCore.RequestContext,OSF.WebAuth&&"web"==OSF._OfficeAppFactory.getHostInfo().hostPlatform&&(this.requestContext._customData="WacPartition")}return e.prototype.requestUpdate=function(e){var t=this.requestContext.ribbon;return e.tabs.filter((function(e){return!!e.id})).forEach((function(e){var n=t.getTab(e.id);void 0!==e.visible&&null!==e.visible&&n.setVisibility(e.visible),e.controls.filter((function(e){return!!e.id})).forEach((function(e){var n=t.getButton(e.id);void 0!==e.enabled&&null!==e.enabled&&(n.enabled=e.enabled)}))})),this.requestContext.sync()},e}();t.Ribbon=r}]),window.OfficeRuntime=window._OfficeRuntimeWeb;var OfficeRuntime="undefined"!==typeof OfficeRuntime?OfficeRuntime:null===(_a=window)||void 0===_a?void 0:_a.OfficeRuntime;"undefined"!==typeof Office&&(Office.storage=Office.storage||(null===(_b=OfficeRuntime)||void 0===_b?void 0:_b.storage),Office.auth=Office.auth||(null===(_c=OfficeRuntime)||void 0===_c?void 0:_c.auth),Office.getAccessToken=Office.getAccessToken||(null===(_e=null===(_d=OfficeRuntime)||void 0===_d?void 0:_d.auth)||void 0===_e?void 0:_e.getAccessToken),Office.addin=Office.addin||(null===(_f=OfficeRuntime)||void 0===_f?void 0:_f.addin),Office.isSetSupported=Office.isSetSupported||(null===(_h=null===(_g=OfficeRuntime)||void 0===_g?void 0:_g.apiInformation)||void 0===_h?void 0:_h.isSetSupported),Office.license=Office.license||(null===(_j=OfficeRuntime)||void 0===_j?void 0:_j.license),Office.message=Office.message||(null===(_k=OfficeRuntime)||void 0===_k?void 0:_k.message)),"undefined"!==typeof OSFPerformance&&(OSFPerformance.hostInitializationEnd=OSFPerformance.now()),OfficeExtension.Utility._doApiNotSupportedCheck=!0;