Geen omschrijving
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

outlook-15.debug.js 94KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365
  1. /* Outlook specific API library */
  2. /* Version: 15.0.4420.1017 Build Time: 03/31/2014 */
  3. /*
  4. Copyright (c) Microsoft Corporation. All rights reserved.
  5. */
  6. /*
  7. Your use of this file is governed by the Microsoft Services Agreement http://go.microsoft.com/fwlink/?LinkId=266419.
  8. */
  9. Type.registerNamespace('Microsoft.Office.WebExtension.MailboxEnums');
  10. Microsoft.Office.WebExtension.MailboxEnums.EntityType={
  11. MeetingSuggestion: "meetingSuggestion",
  12. TaskSuggestion: "taskSuggestion",
  13. Address: "address",
  14. EmailAddress: "emailAddress",
  15. Url: "url",
  16. PhoneNumber: "phoneNumber",
  17. Contact: "contact"
  18. };
  19. Microsoft.Office.WebExtension.MailboxEnums.ItemType={
  20. Message: 'message',
  21. Appointment: 'appointment'
  22. };
  23. Microsoft.Office.WebExtension.MailboxEnums.ResponseType={
  24. None: "none",
  25. Organizer: "organizer",
  26. Tentative: "tentative",
  27. Accepted: "accepted",
  28. Declined: "declined"
  29. };
  30. Microsoft.Office.WebExtension.MailboxEnums.RecipientType={
  31. Other: "other",
  32. DistributionList: "distributionList",
  33. User: "user",
  34. ExternalUser: "externalUser"
  35. };
  36. Microsoft.Office.WebExtension.MailboxEnums.AttachmentType={
  37. File: "file",
  38. Item: "item"
  39. };
  40. Type.registerNamespace('OSF.DDA');
  41. OSF.DDA.OutlookAppOm=function OSF_DDA_OutlookAppOm(officeAppContext, targetWindow, appReadyCallback) {
  42. this.$$d__callAppReadyCallback$p$0=Function.createDelegate(this, this._callAppReadyCallback$p$0);
  43. this.$$d__getEwsUrl$p$0=Function.createDelegate(this, this._getEwsUrl$p$0);
  44. this.$$d__getDiagnostics$p$0=Function.createDelegate(this, this._getDiagnostics$p$0);
  45. this.$$d__getUserProfile$p$0=Function.createDelegate(this, this._getUserProfile$p$0);
  46. this.$$d__getItem$p$0=Function.createDelegate(this, this._getItem$p$0);
  47. this.$$d__getInitialDataResponseHandler$p$0=Function.createDelegate(this, this._getInitialDataResponseHandler$p$0);
  48. OSF.DDA.OutlookAppOm._instance$p=this;
  49. this._officeAppContext$p$0=officeAppContext;
  50. this._appReadyCallback$p$0=appReadyCallback;
  51. var $$t_4=this;
  52. var stringLoadedCallback=function() {
  53. if (appReadyCallback) {
  54. $$t_4._invokeHostMethod$i$0(1, 'GetInitialData', null, $$t_4.$$d__getInitialDataResponseHandler$p$0);
  55. }
  56. };
  57. if (this._areStringsLoaded$p$0()) {
  58. stringLoadedCallback();
  59. }
  60. else {
  61. this._loadLocalizedScript$p$0(stringLoadedCallback);
  62. }
  63. }
  64. OSF.DDA.OutlookAppOm._createAsyncResult$i=function OSF_DDA_OutlookAppOm$_createAsyncResult$i(value, errorCode, errorDescription, userContext) {
  65. var initArgs={};
  66. initArgs[OSF.DDA.AsyncResultEnum.Properties.Value]=value;
  67. initArgs[OSF.DDA.AsyncResultEnum.Properties.Context]=userContext;
  68. var errorArgs=null;
  69. if (0 !==errorCode) {
  70. errorArgs={};
  71. errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Name]=errorCode;
  72. errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Message]=errorDescription;
  73. }
  74. return new OSF.DDA.AsyncResult(initArgs, errorArgs);
  75. }
  76. OSF.DDA.OutlookAppOm._throwOnPropertyAccessForRestrictedPermission$i=function OSF_DDA_OutlookAppOm$_throwOnPropertyAccessForRestrictedPermission$i(currentPermissionLevel) {
  77. if (!currentPermissionLevel) {
  78. throw Error.create(_u.ExtensibilityStrings.l_ElevatedPermissionNeeded_Text);
  79. }
  80. }
  81. OSF.DDA.OutlookAppOm._throwOnMethodCallForInsufficientPermission$i=function OSF_DDA_OutlookAppOm$_throwOnMethodCallForInsufficientPermission$i(currentPermissionLevel, requiredPermissionLevel, methodName) {
  82. if (currentPermissionLevel < requiredPermissionLevel) {
  83. throw Error.create(String.format(_u.ExtensibilityStrings.l_ElevatedPermissionNeededForMethod_Text, methodName));
  84. }
  85. }
  86. OSF.DDA.OutlookAppOm._throwOnArgumentType$p=function OSF_DDA_OutlookAppOm$_throwOnArgumentType$p(value, expectedType, argumentName) {
  87. if (Object.getType(value) !==expectedType) {
  88. throw Error.argumentType(argumentName);
  89. }
  90. }
  91. OSF.DDA.OutlookAppOm._throwOnOutOfRange$p=function OSF_DDA_OutlookAppOm$_throwOnOutOfRange$p(value, minValue, maxValue, argumentName) {
  92. if (value < minValue || value > maxValue) {
  93. throw Error.argumentOutOfRange(argumentName);
  94. }
  95. }
  96. OSF.DDA.OutlookAppOm._validateOptionalStringParameter$p=function OSF_DDA_OutlookAppOm$_validateOptionalStringParameter$p(value, minLength, maxLength, name) {
  97. if ($h.ScriptHelpers.isNullOrUndefined(value)) {
  98. return;
  99. }
  100. OSF.DDA.OutlookAppOm._throwOnArgumentType$p(value, String, name);
  101. var stringValue=value;
  102. OSF.DDA.OutlookAppOm._throwOnOutOfRange$p(stringValue.length, minLength, maxLength, name);
  103. }
  104. OSF.DDA.OutlookAppOm._convertToOutlookParameters$p=function OSF_DDA_OutlookAppOm$_convertToOutlookParameters$p(dispid, data) {
  105. var executeParameters=null;
  106. switch (dispid) {
  107. case 1:
  108. case 2:
  109. case 12:
  110. case 3:
  111. break;
  112. case 4:
  113. var jsonProperty=JSON.stringify(data['customProperties']);
  114. executeParameters=[ jsonProperty ];
  115. break;
  116. case 5:
  117. executeParameters=[ data['body'] ];
  118. break;
  119. case 8:
  120. case 9:
  121. executeParameters=[ data['itemId'] ];
  122. break;
  123. case 7:
  124. executeParameters=[ OSF.DDA.OutlookAppOm._convertRecipientArrayParameterForOutlook$p(data['requiredAttendees']), OSF.DDA.OutlookAppOm._convertRecipientArrayParameterForOutlook$p(data['optionalAttendees']), data['start'], data['end'], data['location'], OSF.DDA.OutlookAppOm._convertRecipientArrayParameterForOutlook$p(data['resources']), data['subject'], data['body'] ];
  125. break;
  126. case 11:
  127. case 10:
  128. executeParameters=[ data['htmlBody'] ];
  129. break;
  130. default:
  131. Sys.Debug.fail('Unexpected method dispid');
  132. break;
  133. }
  134. return executeParameters;
  135. }
  136. OSF.DDA.OutlookAppOm._convertRecipientArrayParameterForOutlook$p=function OSF_DDA_OutlookAppOm$_convertRecipientArrayParameterForOutlook$p(array) {
  137. return (array) ? array.join(';') : null;
  138. }
  139. OSF.DDA.OutlookAppOm._validateAndNormalizeRecipientEmails$p=function OSF_DDA_OutlookAppOm$_validateAndNormalizeRecipientEmails$p(emailset, name) {
  140. if ($h.ScriptHelpers.isNullOrUndefined(emailset)) {
  141. return null;
  142. }
  143. OSF.DDA.OutlookAppOm._throwOnArgumentType$p(emailset, Array, name);
  144. var originalAttendees=emailset;
  145. var updatedAttendees=null;
  146. var normalizationNeeded=false;
  147. OSF.DDA.OutlookAppOm._throwOnOutOfRange$p(originalAttendees.length, 0, OSF.DDA.OutlookAppOm._maxRecipients$p, String.format('{0}.length', name));
  148. for (var i=0; i < originalAttendees.length; i++) {
  149. if ($h.EmailAddressDetails.isInstanceOfType(originalAttendees[i])) {
  150. normalizationNeeded=true;
  151. break;
  152. }
  153. }
  154. if (normalizationNeeded) {
  155. updatedAttendees=[];
  156. }
  157. for (var i=0; i < originalAttendees.length; i++) {
  158. if (normalizationNeeded) {
  159. updatedAttendees[i]=($h.EmailAddressDetails.isInstanceOfType(originalAttendees[i])) ? (originalAttendees[i]).emailAddress : originalAttendees[i];
  160. OSF.DDA.OutlookAppOm._throwOnArgumentType$p(updatedAttendees[i], String, String.format('{0}[{1}]', name, i));
  161. }
  162. else {
  163. OSF.DDA.OutlookAppOm._throwOnArgumentType$p(originalAttendees[i], String, String.format('{0}[{1}]', name, i));
  164. }
  165. }
  166. return updatedAttendees;
  167. }
  168. OSF.DDA.OutlookAppOm.prototype={
  169. _initialData$p$0: null,
  170. _item$p$0: null,
  171. _userProfile$p$0: null,
  172. _diagnostics$p$0: null,
  173. _officeAppContext$p$0: null,
  174. _appReadyCallback$p$0: null,
  175. get__appName$i$0: function OSF_DDA_OutlookAppOm$get__appName$i$0() {
  176. return this._officeAppContext$p$0.get_appName();
  177. },
  178. initialize: function OSF_DDA_OutlookAppOm$initialize(initialData) {
  179. var ItemTypeKey='itemType';
  180. this._initialData$p$0=new $h.InitialData(initialData);
  181. if (1===initialData[ItemTypeKey]) {
  182. this._item$p$0=new $h.Message(this._initialData$p$0);
  183. }
  184. else if (3===initialData[ItemTypeKey]) {
  185. this._item$p$0=new $h.MeetingRequest(this._initialData$p$0);
  186. }
  187. else if (2===initialData[ItemTypeKey]) {
  188. this._item$p$0=new $h.Appointment(this._initialData$p$0);
  189. }
  190. else {
  191. Sys.Debug.trace('Unexpected item type was received from the host.');
  192. }
  193. this._userProfile$p$0=new $h.UserProfile(this._initialData$p$0);
  194. this._diagnostics$p$0=new $h.Diagnostics(this._initialData$p$0, this._officeAppContext$p$0.get_appName());
  195. $h.InitialData._defineReadOnlyProperty$i(this, 'item', this.$$d__getItem$p$0);
  196. $h.InitialData._defineReadOnlyProperty$i(this, 'userProfile', this.$$d__getUserProfile$p$0);
  197. $h.InitialData._defineReadOnlyProperty$i(this, 'diagnostics', this.$$d__getDiagnostics$p$0);
  198. if (OSF.DDA.OutlookAppOm._instance$p.get__appName$i$0()===64) {
  199. $h.InitialData._defineReadOnlyProperty$i(this, 'ewsUrl', this.$$d__getEwsUrl$p$0);
  200. }
  201. },
  202. makeEwsRequestAsync: function OSF_DDA_OutlookAppOm$makeEwsRequestAsync(data, callback, userContext) {
  203. if ($h.ScriptHelpers.isNullOrUndefined(data)) {
  204. throw Error.argumentNull('data');
  205. }
  206. if (data.length > OSF.DDA.OutlookAppOm._maxEwsRequestSize$p) {
  207. throw Error.argument('data', _u.ExtensibilityStrings.l_EwsRequestOversized_Text);
  208. }
  209. OSF.DDA.OutlookAppOm._throwOnMethodCallForInsufficientPermission$i(this._initialData$p$0.get__permissionLevel$i$0(), 2, 'makeEwsRequestAsync');
  210. var ewsRequest=new $h.EwsRequest(userContext);
  211. var $$t_4=this;
  212. ewsRequest.onreadystatechange=function() {
  213. if (4===ewsRequest.get__requestState$i$1()) {
  214. callback(ewsRequest._asyncResult$p$0);
  215. }
  216. };
  217. ewsRequest.send(data);
  218. },
  219. recordDataPoint: function OSF_DDA_OutlookAppOm$recordDataPoint(data) {
  220. if ($h.ScriptHelpers.isNullOrUndefined(data)) {
  221. throw Error.argumentNull('data');
  222. }
  223. this._invokeHostMethod$i$0(0, 'RecordDataPoint', data, null);
  224. },
  225. recordTrace: function OSF_DDA_OutlookAppOm$recordTrace(data) {
  226. if ($h.ScriptHelpers.isNullOrUndefined(data)) {
  227. throw Error.argumentNull('data');
  228. }
  229. this._invokeHostMethod$i$0(0, 'RecordTrace', data, null);
  230. },
  231. trackCtq: function OSF_DDA_OutlookAppOm$trackCtq(data) {
  232. if ($h.ScriptHelpers.isNullOrUndefined(data)) {
  233. throw Error.argumentNull('data');
  234. }
  235. this._invokeHostMethod$i$0(0, 'TrackCtq', data, null);
  236. },
  237. convertToLocalClientTime: function OSF_DDA_OutlookAppOm$convertToLocalClientTime(timeValue) {
  238. var date=new Date(timeValue.getTime());
  239. var offset=date.getTimezoneOffset() * -1;
  240. if (this._initialData$p$0 && this._initialData$p$0.get__timeZoneOffsets$i$0()) {
  241. date.setUTCMinutes(date.getUTCMinutes() - offset);
  242. offset=this._findOffset$p$0(date);
  243. date.setUTCMinutes(date.getUTCMinutes()+offset);
  244. }
  245. var retValue=this._dateToDictionary$i$0(date);
  246. retValue['timezoneOffset']=offset;
  247. return retValue;
  248. },
  249. convertToUtcClientTime: function OSF_DDA_OutlookAppOm$convertToUtcClientTime(input) {
  250. var retValue=this._dictionaryToDate$i$0(input);
  251. if (this._initialData$p$0 && this._initialData$p$0.get__timeZoneOffsets$i$0()) {
  252. var offset=this._findOffset$p$0(retValue);
  253. retValue.setUTCMinutes(retValue.getUTCMinutes() - offset);
  254. offset=(!input['timezoneOffset']) ? retValue.getTimezoneOffset() * -1 : input['timezoneOffset'];
  255. retValue.setUTCMinutes(retValue.getUTCMinutes()+offset);
  256. }
  257. return retValue;
  258. },
  259. getUserIdentityTokenAsync: function OSF_DDA_OutlookAppOm$getUserIdentityTokenAsync(callback, userContext) {
  260. OSF.DDA.OutlookAppOm._throwOnMethodCallForInsufficientPermission$i(this._initialData$p$0.get__permissionLevel$i$0(), 1, 'getUserIdentityTokenAsync');
  261. this._invokeGetTokenMethodAsync$p$0(2, 'GetUserIdentityToken', callback, userContext);
  262. },
  263. getCallbackTokenAsync: function OSF_DDA_OutlookAppOm$getCallbackTokenAsync(callback, userContext) {
  264. OSF.DDA.OutlookAppOm._throwOnMethodCallForInsufficientPermission$i(this._initialData$p$0.get__permissionLevel$i$0(), 1, 'getCallbackTokenAsync');
  265. if (64 !==this._officeAppContext$p$0.get_appName()) {
  266. throw Error.notImplemented('The getCallbackTokenAsync is not supported by outlook for now.');
  267. }
  268. this._invokeGetTokenMethodAsync$p$0(12, 'GetCallbackToken', callback, userContext);
  269. },
  270. displayMessageForm: function OSF_DDA_OutlookAppOm$displayMessageForm(itemId) {
  271. if ($h.ScriptHelpers.isNullOrUndefined(itemId)) {
  272. throw Error.argumentNull('itemId');
  273. }
  274. this._invokeHostMethod$i$0(8, 'DisplayExistingMessageForm', { itemId: itemId }, null);
  275. },
  276. displayAppointmentForm: function OSF_DDA_OutlookAppOm$displayAppointmentForm(itemId) {
  277. if ($h.ScriptHelpers.isNullOrUndefined(itemId)) {
  278. throw Error.argumentNull('itemId');
  279. }
  280. this._invokeHostMethod$i$0(9, 'DisplayExistingAppointmentForm', { itemId: itemId }, null);
  281. },
  282. displayNewAppointmentForm: function OSF_DDA_OutlookAppOm$displayNewAppointmentForm(parameters) {
  283. var normalizedRequiredAttendees=OSF.DDA.OutlookAppOm._validateAndNormalizeRecipientEmails$p(parameters['requiredAttendees'], 'requiredAttendees');
  284. var normalizedOptionalAttendees=OSF.DDA.OutlookAppOm._validateAndNormalizeRecipientEmails$p(parameters['optionalAttendees'], 'optionalAttendees');
  285. OSF.DDA.OutlookAppOm._validateOptionalStringParameter$p(parameters['location'], 0, OSF.DDA.OutlookAppOm._maxLocationLength$p, 'location');
  286. OSF.DDA.OutlookAppOm._validateOptionalStringParameter$p(parameters['body'], 0, OSF.DDA.OutlookAppOm._maxBodyLength$p, 'body');
  287. OSF.DDA.OutlookAppOm._validateOptionalStringParameter$p(parameters['subject'], 0, OSF.DDA.OutlookAppOm._maxSubjectLength$p, 'subject');
  288. if (!$h.ScriptHelpers.isNullOrUndefined(parameters['start'])) {
  289. OSF.DDA.OutlookAppOm._throwOnArgumentType$p(parameters['start'], Date, 'start');
  290. var startDateTime=parameters['start'];
  291. parameters['start']=startDateTime.getTime();
  292. if (!$h.ScriptHelpers.isNullOrUndefined(parameters['end'])) {
  293. OSF.DDA.OutlookAppOm._throwOnArgumentType$p(parameters['end'], Date, 'end');
  294. var endDateTime=parameters['end'];
  295. if (endDateTime < startDateTime) {
  296. throw Error.argumentOutOfRange('end', endDateTime, _u.ExtensibilityStrings.l_InvalidEventDates_Text);
  297. }
  298. parameters['end']=endDateTime.getTime();
  299. }
  300. }
  301. var updatedParameters=null;
  302. if (normalizedRequiredAttendees || normalizedOptionalAttendees) {
  303. updatedParameters={};
  304. var $$dict_6=parameters;
  305. for (var $$key_7 in $$dict_6) {
  306. var entry={ key: $$key_7, value: $$dict_6[$$key_7] };
  307. updatedParameters[entry.key]=entry.value;
  308. }
  309. if (normalizedRequiredAttendees) {
  310. updatedParameters['requiredAttendees']=normalizedRequiredAttendees;
  311. }
  312. if (normalizedOptionalAttendees) {
  313. updatedParameters['optionalAttendees']=normalizedOptionalAttendees;
  314. }
  315. }
  316. this._invokeHostMethod$i$0(7, 'DisplayNewAppointmentForm', updatedParameters || parameters, null);
  317. },
  318. _displayReplyForm$i$0: function OSF_DDA_OutlookAppOm$_displayReplyForm$i$0(htmlBody) {
  319. if (!$h.ScriptHelpers.isNullOrUndefined(htmlBody)) {
  320. OSF.DDA.OutlookAppOm._throwOnOutOfRange$p(htmlBody.length, 0, OSF.DDA.OutlookAppOm._maxBodyLength$p, 'htmlBody');
  321. }
  322. this._invokeHostMethod$i$0(10, 'DisplayReplyForm', { htmlBody: htmlBody }, null);
  323. },
  324. _displayReplyAllForm$i$0: function OSF_DDA_OutlookAppOm$_displayReplyAllForm$i$0(htmlBody) {
  325. if (!$h.ScriptHelpers.isNullOrUndefined(htmlBody)) {
  326. OSF.DDA.OutlookAppOm._throwOnOutOfRange$p(htmlBody.length, 0, OSF.DDA.OutlookAppOm._maxBodyLength$p, 'htmlBody');
  327. }
  328. this._invokeHostMethod$i$0(11, 'DisplayReplyAllForm', { htmlBody: htmlBody }, null);
  329. },
  330. _invokeHostMethod$i$0: function OSF_DDA_OutlookAppOm$_invokeHostMethod$i$0(dispid, name, data, responseCallback) {
  331. if (64===this._officeAppContext$p$0.get_appName()) {
  332. OSF._OfficeAppFactory.getClientEndPoint().invoke(name, responseCallback, data);
  333. }
  334. else if (dispid) {
  335. var executeParameters=OSF.DDA.OutlookAppOm._convertToOutlookParameters$p(dispid, data);
  336. var $$t_9=this;
  337. window.external.Execute(dispid, executeParameters, function(nativeData, resultCode) {
  338. if (responseCallback) {
  339. var serializedData=nativeData.getItem(0);
  340. var deserializedData=JSON.parse(serializedData);
  341. responseCallback(resultCode, deserializedData);
  342. }
  343. });
  344. }
  345. else if (responseCallback) {
  346. responseCallback(-2, null);
  347. }
  348. },
  349. _dictionaryToDate$i$0: function OSF_DDA_OutlookAppOm$_dictionaryToDate$i$0(input) {
  350. var retValue=new Date(input['year'], input['month'], input['date'], input['hours'], input['minutes'], input['seconds'], (!input['milliseconds']) ? 0 : input['milliseconds']);
  351. if (isNaN(retValue.getTime())) {
  352. throw Error.format(_u.ExtensibilityStrings.l_InvalidDate_Text);
  353. }
  354. return retValue;
  355. },
  356. _dateToDictionary$i$0: function OSF_DDA_OutlookAppOm$_dateToDictionary$i$0(input) {
  357. var retValue={};
  358. retValue['month']=input.getMonth();
  359. retValue['date']=input.getDate();
  360. retValue['year']=input.getFullYear();
  361. retValue['hours']=input.getHours();
  362. retValue['minutes']=input.getMinutes();
  363. retValue['seconds']=input.getSeconds();
  364. retValue['milliseconds']=input.getMilliseconds();
  365. return retValue;
  366. },
  367. _getInitialDataResponseHandler$p$0: function OSF_DDA_OutlookAppOm$_getInitialDataResponseHandler$p$0(resultCode, data) {
  368. if (resultCode) {
  369. return;
  370. }
  371. this.initialize(data);
  372. (this).displayName='mailbox';
  373. window.setTimeout(this.$$d__callAppReadyCallback$p$0, 0);
  374. },
  375. _callAppReadyCallback$p$0: function OSF_DDA_OutlookAppOm$_callAppReadyCallback$p$0() {
  376. this._appReadyCallback$p$0();
  377. },
  378. _invokeGetTokenMethodAsync$p$0: function OSF_DDA_OutlookAppOm$_invokeGetTokenMethodAsync$p$0(outlookDispid, methodName, callback, userContext) {
  379. if ($h.ScriptHelpers.isNullOrUndefined(callback)) {
  380. throw Error.argumentNull('callback');
  381. }
  382. var $$t_8=this;
  383. this._invokeHostMethod$i$0(outlookDispid, methodName, null, function(resultCode, response) {
  384. var asyncResult;
  385. if (resultCode) {
  386. asyncResult=OSF.DDA.OutlookAppOm._createAsyncResult$i(null, 1, String.format(_u.ExtensibilityStrings.l_InternalProtocolError_Text, resultCode), userContext);
  387. }
  388. else {
  389. var responseDictionary=response;
  390. if (responseDictionary['wasSuccessful']) {
  391. asyncResult=OSF.DDA.OutlookAppOm._createAsyncResult$i(responseDictionary['token'], 0, null, userContext);
  392. }
  393. else {
  394. asyncResult=OSF.DDA.OutlookAppOm._createAsyncResult$i(null, 1, responseDictionary['errorMessage'], userContext);
  395. }
  396. }
  397. callback(asyncResult);
  398. });
  399. },
  400. _getItem$p$0: function OSF_DDA_OutlookAppOm$_getItem$p$0() {
  401. return this._item$p$0;
  402. },
  403. _getUserProfile$p$0: function OSF_DDA_OutlookAppOm$_getUserProfile$p$0() {
  404. OSF.DDA.OutlookAppOm._throwOnPropertyAccessForRestrictedPermission$i(this._initialData$p$0.get__permissionLevel$i$0());
  405. return this._userProfile$p$0;
  406. },
  407. _getDiagnostics$p$0: function OSF_DDA_OutlookAppOm$_getDiagnostics$p$0() {
  408. return this._diagnostics$p$0;
  409. },
  410. _getEwsUrl$p$0: function OSF_DDA_OutlookAppOm$_getEwsUrl$p$0() {
  411. OSF.DDA.OutlookAppOm._throwOnPropertyAccessForRestrictedPermission$i(this._initialData$p$0.get__permissionLevel$i$0());
  412. return this._initialData$p$0.get__ewsUrl$i$0();
  413. },
  414. _findOffset$p$0: function OSF_DDA_OutlookAppOm$_findOffset$p$0(value) {
  415. var ranges=this._initialData$p$0.get__timeZoneOffsets$i$0();
  416. for (var r=0; r < ranges.length; r++) {
  417. var range=ranges[r];
  418. var start=parseInt(range['start']);
  419. var end=parseInt(range['end']);
  420. if (value.getTime() - start >=0 && value.getTime() - end < 0) {
  421. return parseInt(range['offset']);
  422. }
  423. }
  424. throw Error.format(_u.ExtensibilityStrings.l_InvalidDate_Text);
  425. },
  426. _areStringsLoaded$p$0: function OSF_DDA_OutlookAppOm$_areStringsLoaded$p$0() {
  427. var stringsLoaded=false;
  428. try {
  429. stringsLoaded=!$h.ScriptHelpers.isNullOrUndefined(_u.ExtensibilityStrings.l_EwsRequestOversized_Text);
  430. }
  431. catch ($$e_1) {
  432. }
  433. return stringsLoaded;
  434. },
  435. _loadLocalizedScript$p$0: function OSF_DDA_OutlookAppOm$_loadLocalizedScript$p$0(stringLoadedCallback) {
  436. var url=null;
  437. var baseUrl='';
  438. var scripts=document.getElementsByTagName('script');
  439. for (var i=scripts.length - 1; i >=0; i--) {
  440. var filename=null;
  441. var attributes=scripts[i].attributes;
  442. if (attributes) {
  443. var attribute=attributes.getNamedItem('src');
  444. if (attribute) {
  445. filename=attribute.value;
  446. }
  447. if (filename) {
  448. var debug=false;
  449. filename=filename.toLowerCase();
  450. var officeIndex=filename.indexOf('office_strings.js');
  451. if (officeIndex < 0) {
  452. officeIndex=filename.indexOf('office_strings.debug.js');
  453. debug=true;
  454. }
  455. if ((officeIndex > 0) && (officeIndex < filename.length)) {
  456. url=filename.replace((debug) ? 'office_strings.debug.js' : 'office_strings.js', 'outlook_strings.js');
  457. var languageUrl=filename.substring(0, officeIndex);
  458. var lastIndexOfSlash=languageUrl.lastIndexOf('/', languageUrl.length - 2);
  459. if (lastIndexOfSlash===-1) {
  460. lastIndexOfSlash=languageUrl.lastIndexOf('\\', languageUrl.length - 2);
  461. }
  462. if (lastIndexOfSlash !==-1 && languageUrl.length > lastIndexOfSlash+1) {
  463. baseUrl=languageUrl.substring(0, lastIndexOfSlash+1);
  464. }
  465. break;
  466. }
  467. }
  468. }
  469. }
  470. if (url) {
  471. var head=document.getElementsByTagName('head')[0];
  472. var scriptElement=null;
  473. var $$t_H=this;
  474. var scriptElementCallback=function() {
  475. if (stringLoadedCallback && (!scriptElement.readyState || (scriptElement.readyState && (scriptElement.readyState==='loaded' || scriptElement.readyState==='complete')))) {
  476. scriptElement.onload=null;
  477. scriptElement.onreadystatechange=null;
  478. stringLoadedCallback();
  479. }
  480. };
  481. var $$t_I=this;
  482. var failureCallback=function() {
  483. if (!$$t_I._areStringsLoaded$p$0()) {
  484. var fallbackUrl=baseUrl+'en-us/'+'outlook_strings.js';
  485. scriptElement.onload=null;
  486. scriptElement.onreadystatechange=null;
  487. scriptElement=$$t_I._createScriptElement$p$0(fallbackUrl);
  488. scriptElement.onload=scriptElementCallback;
  489. scriptElement.onreadystatechange=scriptElementCallback;
  490. head.appendChild(scriptElement);
  491. }
  492. };
  493. scriptElement=this._createScriptElement$p$0(url);
  494. scriptElement.onload=scriptElementCallback;
  495. scriptElement.onreadystatechange=scriptElementCallback;
  496. window.setTimeout(failureCallback, 2000);
  497. head.appendChild(scriptElement);
  498. }
  499. },
  500. _createScriptElement$p$0: function OSF_DDA_OutlookAppOm$_createScriptElement$p$0(url) {
  501. var scriptElement=document.createElement('script');
  502. scriptElement.type='text/javascript';
  503. scriptElement.src=url;
  504. return scriptElement;
  505. }
  506. }
  507. OSF.DDA.Settings=function OSF_DDA_Settings(data) {
  508. this._rawData$p$0=data;
  509. }
  510. OSF.DDA.Settings._convertFromRawSettings$p=function OSF_DDA_Settings$_convertFromRawSettings$p(rawSettings) {
  511. if (!rawSettings) {
  512. return {};
  513. }
  514. if (OSF.DDA.OutlookAppOm._instance$p.get__appName$i$0()===8) {
  515. var outlookSettings=rawSettings['SettingsKey'];
  516. if (outlookSettings) {
  517. return OSF.DDA.SettingsManager.deserializeSettings(outlookSettings);
  518. }
  519. }
  520. return rawSettings;
  521. }
  522. OSF.DDA.Settings.prototype={
  523. _rawData$p$0: null,
  524. _settingsData$p$0: null,
  525. get__data$p$0: function OSF_DDA_Settings$get__data$p$0() {
  526. if (!this._settingsData$p$0) {
  527. this._settingsData$p$0=OSF.DDA.Settings._convertFromRawSettings$p(this._rawData$p$0);
  528. this._rawData$p$0=null;
  529. }
  530. return this._settingsData$p$0;
  531. },
  532. get: function OSF_DDA_Settings$get(name) {
  533. return this.get__data$p$0()[name];
  534. },
  535. set: function OSF_DDA_Settings$set(name, value) {
  536. this.get__data$p$0()[name]=value;
  537. },
  538. remove: function OSF_DDA_Settings$remove(name) {
  539. delete this.get__data$p$0()[name];
  540. },
  541. saveAsync: function OSF_DDA_Settings$saveAsync() {
  542. var args=[];
  543. for (var $$pai_4=0; $$pai_4 < arguments.length;++$$pai_4) {
  544. args[$$pai_4]=arguments[$$pai_4];
  545. }
  546. var callback=null;
  547. var userContext=null;
  548. if (args && args.length > 0) {
  549. var currentArgument=args.length - 1;
  550. if (Function.isInstanceOfType(args[currentArgument])) {
  551. callback=args[currentArgument];
  552. currentArgument--;
  553. if (currentArgument >=0) {
  554. userContext=(args[currentArgument])['asyncContext'];
  555. }
  556. }
  557. }
  558. if (OSF.DDA.OutlookAppOm._instance$p.get__appName$i$0()===64) {
  559. this._saveSettingsForOwa$p$0(callback, userContext);
  560. }
  561. else {
  562. this._saveSettingsForOutlook$p$0(callback, userContext);
  563. }
  564. },
  565. _saveSettingsForOutlook$p$0: function OSF_DDA_Settings$_saveSettingsForOutlook$p$0(callback, userContext) {
  566. var storedException=null;
  567. try {
  568. var serializedSettings=OSF.DDA.SettingsManager.serializeSettings(this.get__data$p$0());
  569. var jsonSettings=JSON.stringify(serializedSettings);
  570. var settingsObjectToSave={ SettingsKey: jsonSettings };
  571. OSF.DDA.RichClientSettingsManager.write(settingsObjectToSave);
  572. }
  573. catch (ex) {
  574. storedException=ex;
  575. }
  576. if (callback) {
  577. var asyncResult;
  578. if (storedException) {
  579. asyncResult=OSF.DDA.OutlookAppOm._createAsyncResult$i(null, 1, storedException.message, userContext);
  580. }
  581. else {
  582. asyncResult=OSF.DDA.OutlookAppOm._createAsyncResult$i(null, 0, null, userContext);
  583. }
  584. callback(asyncResult);
  585. }
  586. },
  587. _saveSettingsForOwa$p$0: function OSF_DDA_Settings$_saveSettingsForOwa$p$0(callback, userContext) {
  588. var serializedSettings=OSF.DDA.SettingsManager.serializeSettings(this.get__data$p$0());
  589. var $$t_7=this;
  590. OSF._OfficeAppFactory.getClientEndPoint().invoke('saveSettingsAsync', function(resultCode, response) {
  591. if (callback) {
  592. var asyncResult;
  593. if (resultCode) {
  594. asyncResult=OSF.DDA.OutlookAppOm._createAsyncResult$i(null, 1, String.format(_u.ExtensibilityStrings.l_InternalProtocolError_Text, resultCode), userContext);
  595. }
  596. else {
  597. var responseDictionary=response;
  598. if (!(responseDictionary['error'])) {
  599. asyncResult=OSF.DDA.OutlookAppOm._createAsyncResult$i(null, 0, null, userContext);
  600. }
  601. else {
  602. asyncResult=OSF.DDA.OutlookAppOm._createAsyncResult$i(null, 1, responseDictionary['errorMessage'], userContext);
  603. }
  604. }
  605. callback(asyncResult);
  606. }
  607. }, [ serializedSettings ]);
  608. }
  609. }
  610. Type.registerNamespace('$h');
  611. $h.Appointment=function $h_Appointment(dataDictionary) {
  612. this.$$d__getOrganizer$p$1=Function.createDelegate(this, this._getOrganizer$p$1);
  613. this.$$d__getNormalizedSubject$p$1=Function.createDelegate(this, this._getNormalizedSubject$p$1);
  614. this.$$d__getSubject$p$1=Function.createDelegate(this, this._getSubject$p$1);
  615. this.$$d__getResources$p$1=Function.createDelegate(this, this._getResources$p$1);
  616. this.$$d__getRequiredAttendees$p$1=Function.createDelegate(this, this._getRequiredAttendees$p$1);
  617. this.$$d__getOptionalAttendees$p$1=Function.createDelegate(this, this._getOptionalAttendees$p$1);
  618. this.$$d__getLocation$p$1=Function.createDelegate(this, this._getLocation$p$1);
  619. this.$$d__getEnd$p$1=Function.createDelegate(this, this._getEnd$p$1);
  620. this.$$d__getStart$p$1=Function.createDelegate(this, this._getStart$p$1);
  621. $h.Appointment.initializeBase(this, [ dataDictionary ]);
  622. $h.InitialData._defineReadOnlyProperty$i(this, 'start', this.$$d__getStart$p$1);
  623. $h.InitialData._defineReadOnlyProperty$i(this, 'end', this.$$d__getEnd$p$1);
  624. $h.InitialData._defineReadOnlyProperty$i(this, 'location', this.$$d__getLocation$p$1);
  625. $h.InitialData._defineReadOnlyProperty$i(this, 'optionalAttendees', this.$$d__getOptionalAttendees$p$1);
  626. $h.InitialData._defineReadOnlyProperty$i(this, 'requiredAttendees', this.$$d__getRequiredAttendees$p$1);
  627. $h.InitialData._defineReadOnlyProperty$i(this, 'resources', this.$$d__getResources$p$1);
  628. $h.InitialData._defineReadOnlyProperty$i(this, 'subject', this.$$d__getSubject$p$1);
  629. $h.InitialData._defineReadOnlyProperty$i(this, 'normalizedSubject', this.$$d__getNormalizedSubject$p$1);
  630. $h.InitialData._defineReadOnlyProperty$i(this, 'organizer', this.$$d__getOrganizer$p$1);
  631. }
  632. $h.Appointment.prototype={
  633. getEntities: function $h_Appointment$getEntities() {
  634. return this._data$p$0._getEntities$i$0();
  635. },
  636. getEntitiesByType: function $h_Appointment$getEntitiesByType(entityType) {
  637. return this._data$p$0._getEntitiesByType$i$0(entityType);
  638. },
  639. getRegExMatches: function $h_Appointment$getRegExMatches() {
  640. OSF.DDA.OutlookAppOm._throwOnMethodCallForInsufficientPermission$i(this._data$p$0.get__permissionLevel$i$0(), 1, 'getRegExMatches');
  641. return this._data$p$0._getRegExMatches$i$0();
  642. },
  643. getFilteredEntitiesByName: function $h_Appointment$getFilteredEntitiesByName(name) {
  644. return this._data$p$0._getFilteredEntitiesByName$i$0(name);
  645. },
  646. getRegExMatchesByName: function $h_Appointment$getRegExMatchesByName(name) {
  647. OSF.DDA.OutlookAppOm._throwOnMethodCallForInsufficientPermission$i(this._data$p$0.get__permissionLevel$i$0(), 1, 'getRegExMatchesByName');
  648. return this._data$p$0._getRegExMatchesByName$i$0(name);
  649. },
  650. displayReplyForm: function $h_Appointment$displayReplyForm(htmlBody) {
  651. OSF.DDA.OutlookAppOm._instance$p._displayReplyForm$i$0(htmlBody);
  652. },
  653. displayReplyAllForm: function $h_Appointment$displayReplyAllForm(htmlBody) {
  654. OSF.DDA.OutlookAppOm._instance$p._displayReplyAllForm$i$0(htmlBody);
  655. },
  656. getItemType: function $h_Appointment$getItemType() {
  657. return Microsoft.Office.WebExtension.MailboxEnums.ItemType.Appointment;
  658. },
  659. _getStart$p$1: function $h_Appointment$_getStart$p$1() {
  660. return this._data$p$0.get__start$i$0();
  661. },
  662. _getEnd$p$1: function $h_Appointment$_getEnd$p$1() {
  663. return this._data$p$0.get__end$i$0();
  664. },
  665. _getLocation$p$1: function $h_Appointment$_getLocation$p$1() {
  666. return this._data$p$0.get__location$i$0();
  667. },
  668. _getOptionalAttendees$p$1: function $h_Appointment$_getOptionalAttendees$p$1() {
  669. return this._data$p$0.get__cc$i$0();
  670. },
  671. _getRequiredAttendees$p$1: function $h_Appointment$_getRequiredAttendees$p$1() {
  672. return this._data$p$0.get__to$i$0();
  673. },
  674. _getResources$p$1: function $h_Appointment$_getResources$p$1() {
  675. return this._data$p$0.get__resources$i$0();
  676. },
  677. _getSubject$p$1: function $h_Appointment$_getSubject$p$1() {
  678. return this._data$p$0.get__subject$i$0();
  679. },
  680. _getNormalizedSubject$p$1: function $h_Appointment$_getNormalizedSubject$p$1() {
  681. return this._data$p$0.get__normalizedSubject$i$0();
  682. },
  683. _getOrganizer$p$1: function $h_Appointment$_getOrganizer$p$1() {
  684. return this._data$p$0.get__organizer$i$0();
  685. }
  686. }
  687. $h.AttachmentDetails=function $h_AttachmentDetails(data) {
  688. this.$$d__getIsInline$p$0=Function.createDelegate(this, this._getIsInline$p$0);
  689. this.$$d__getAttachmentType$p$0=Function.createDelegate(this, this._getAttachmentType$p$0);
  690. this.$$d__getSize$p$0=Function.createDelegate(this, this._getSize$p$0);
  691. this.$$d__getContentType$p$0=Function.createDelegate(this, this._getContentType$p$0);
  692. this.$$d__getName$p$0=Function.createDelegate(this, this._getName$p$0);
  693. this.$$d__getId$p$0=Function.createDelegate(this, this._getId$p$0);
  694. this._data$p$0=data;
  695. $h.InitialData._defineReadOnlyProperty$i(this, 'id', this.$$d__getId$p$0);
  696. $h.InitialData._defineReadOnlyProperty$i(this, 'name', this.$$d__getName$p$0);
  697. $h.InitialData._defineReadOnlyProperty$i(this, 'contentType', this.$$d__getContentType$p$0);
  698. $h.InitialData._defineReadOnlyProperty$i(this, 'size', this.$$d__getSize$p$0);
  699. $h.InitialData._defineReadOnlyProperty$i(this, 'attachmentType', this.$$d__getAttachmentType$p$0);
  700. $h.InitialData._defineReadOnlyProperty$i(this, 'isInline', this.$$d__getIsInline$p$0);
  701. }
  702. $h.AttachmentDetails.prototype={
  703. _data$p$0: null,
  704. _getId$p$0: function $h_AttachmentDetails$_getId$p$0() {
  705. return this._data$p$0['id'];
  706. },
  707. _getName$p$0: function $h_AttachmentDetails$_getName$p$0() {
  708. return this._data$p$0['name'];
  709. },
  710. _getContentType$p$0: function $h_AttachmentDetails$_getContentType$p$0() {
  711. return this._data$p$0['contentType'];
  712. },
  713. _getSize$p$0: function $h_AttachmentDetails$_getSize$p$0() {
  714. return this._data$p$0['size'];
  715. },
  716. _getAttachmentType$p$0: function $h_AttachmentDetails$_getAttachmentType$p$0() {
  717. var response=this._data$p$0['attachmentType'];
  718. return (response < $h.AttachmentDetails._attachmentTypeMap$p.length) ? $h.AttachmentDetails._attachmentTypeMap$p[response] : Microsoft.Office.WebExtension.MailboxEnums.AttachmentType.File;
  719. },
  720. _getIsInline$p$0: function $h_AttachmentDetails$_getIsInline$p$0() {
  721. return this._data$p$0['isInline'];
  722. }
  723. }
  724. $h.Contact=function $h_Contact(data) {
  725. this.$$d__getContactString$p$0=Function.createDelegate(this, this._getContactString$p$0);
  726. this.$$d__getAddresses$p$0=Function.createDelegate(this, this._getAddresses$p$0);
  727. this.$$d__getUrls$p$0=Function.createDelegate(this, this._getUrls$p$0);
  728. this.$$d__getEmailAddresses$p$0=Function.createDelegate(this, this._getEmailAddresses$p$0);
  729. this.$$d__getPhoneNumbers$p$0=Function.createDelegate(this, this._getPhoneNumbers$p$0);
  730. this.$$d__getBusinessName$p$0=Function.createDelegate(this, this._getBusinessName$p$0);
  731. this.$$d__getPersonName$p$0=Function.createDelegate(this, this._getPersonName$p$0);
  732. this._data$p$0=data;
  733. $h.InitialData._defineReadOnlyProperty$i(this, 'personName', this.$$d__getPersonName$p$0);
  734. $h.InitialData._defineReadOnlyProperty$i(this, 'businessName', this.$$d__getBusinessName$p$0);
  735. $h.InitialData._defineReadOnlyProperty$i(this, 'phoneNumbers', this.$$d__getPhoneNumbers$p$0);
  736. $h.InitialData._defineReadOnlyProperty$i(this, 'emailAddresses', this.$$d__getEmailAddresses$p$0);
  737. $h.InitialData._defineReadOnlyProperty$i(this, 'urls', this.$$d__getUrls$p$0);
  738. $h.InitialData._defineReadOnlyProperty$i(this, 'addresses', this.$$d__getAddresses$p$0);
  739. $h.InitialData._defineReadOnlyProperty$i(this, 'contactString', this.$$d__getContactString$p$0);
  740. }
  741. $h.Contact.prototype={
  742. _data$p$0: null,
  743. _phoneNumbers$p$0: null,
  744. _getPersonName$p$0: function $h_Contact$_getPersonName$p$0() {
  745. return this._data$p$0['PersonName'];
  746. },
  747. _getBusinessName$p$0: function $h_Contact$_getBusinessName$p$0() {
  748. return this._data$p$0['BusinessName'];
  749. },
  750. _getAddresses$p$0: function $h_Contact$_getAddresses$p$0() {
  751. return $h.Entities._getExtractedStringProperty$i(this._data$p$0, 'Addresses');
  752. },
  753. _getEmailAddresses$p$0: function $h_Contact$_getEmailAddresses$p$0() {
  754. return $h.Entities._getExtractedStringProperty$i(this._data$p$0, 'EmailAddresses');
  755. },
  756. _getUrls$p$0: function $h_Contact$_getUrls$p$0() {
  757. return $h.Entities._getExtractedStringProperty$i(this._data$p$0, 'Urls');
  758. },
  759. _getPhoneNumbers$p$0: function $h_Contact$_getPhoneNumbers$p$0() {
  760. if (!this._phoneNumbers$p$0) {
  761. var $$t_1=this;
  762. this._phoneNumbers$p$0=$h.Entities._getExtractedObjects$i($h.PhoneNumber, this._data$p$0, 'PhoneNumbers', function(data) {
  763. return new $h.PhoneNumber(data);
  764. });
  765. }
  766. return this._phoneNumbers$p$0;
  767. },
  768. _getContactString$p$0: function $h_Contact$_getContactString$p$0() {
  769. return this._data$p$0['ContactString'];
  770. }
  771. }
  772. $h.CustomProperties=function $h_CustomProperties(data) {
  773. if ($h.ScriptHelpers.isNullOrUndefined(data)) {
  774. throw Error.argumentNull('data');
  775. }
  776. this._data$p$0=data;
  777. }
  778. $h.CustomProperties.prototype={
  779. _data$p$0: null,
  780. get: function $h_CustomProperties$get(name) {
  781. var value=this._data$p$0[name];
  782. if (typeof(value)==='string') {
  783. var valueString=value;
  784. if (valueString.length > 6 && valueString.startsWith('Date(') && valueString.endsWith(')')) {
  785. var ticksString=valueString.substring(5, valueString.length - 1);
  786. var ticks=parseInt(ticksString);
  787. if (!isNaN(ticks)) {
  788. var dateTimeValue=new Date(ticks);
  789. if (dateTimeValue) {
  790. value=dateTimeValue;
  791. }
  792. }
  793. }
  794. }
  795. return value;
  796. },
  797. set: function $h_CustomProperties$set(name, value) {
  798. if (OSF.OUtil.isDate(value)) {
  799. value='Date('+(value).getTime()+')';
  800. }
  801. this._data$p$0[name]=value;
  802. },
  803. remove: function $h_CustomProperties$remove(name) {
  804. delete this._data$p$0[name];
  805. },
  806. saveAsync: function $h_CustomProperties$saveAsync(callback, userContext) {
  807. var MaxCustomPropertiesLength=2500;
  808. if (JSON.stringify(this._data$p$0).length > MaxCustomPropertiesLength) {
  809. throw Error.argument();
  810. }
  811. var saveCustomProperties=new $h._saveDictionaryRequest(callback, userContext);
  812. saveCustomProperties._sendRequest$i$0(4, 'SaveCustomProperties', { customProperties: this._data$p$0 });
  813. }
  814. }
  815. $h.Diagnostics=function $h_Diagnostics(data, appName) {
  816. this.$$d__getOwaView$p$0=Function.createDelegate(this, this._getOwaView$p$0);
  817. this.$$d__getHostVersion$p$0=Function.createDelegate(this, this._getHostVersion$p$0);
  818. this.$$d__getHostName$p$0=Function.createDelegate(this, this._getHostName$p$0);
  819. this._data$p$0=data;
  820. this._appName$p$0=appName;
  821. $h.InitialData._defineReadOnlyProperty$i(this, 'hostName', this.$$d__getHostName$p$0);
  822. $h.InitialData._defineReadOnlyProperty$i(this, 'hostVersion', this.$$d__getHostVersion$p$0);
  823. if (64===this._appName$p$0) {
  824. $h.InitialData._defineReadOnlyProperty$i(this, 'OWAView', this.$$d__getOwaView$p$0);
  825. }
  826. }
  827. $h.Diagnostics.prototype={
  828. _data$p$0: null,
  829. _appName$p$0: 0,
  830. _getHostName$p$0: function $h_Diagnostics$_getHostName$p$0() {
  831. if (8===this._appName$p$0) {
  832. return 'Outlook';
  833. }
  834. else if (64===this._appName$p$0) {
  835. return 'OutlookWebApp';
  836. }
  837. return null;
  838. },
  839. _getHostVersion$p$0: function $h_Diagnostics$_getHostVersion$p$0() {
  840. return this._data$p$0.get__hostVersion$i$0();
  841. },
  842. _getOwaView$p$0: function $h_Diagnostics$_getOwaView$p$0() {
  843. return this._data$p$0.get__owaView$i$0();
  844. }
  845. }
  846. $h.EmailAddressDetails=function $h_EmailAddressDetails(data) {
  847. this.$$d__getRecipientType$p$0=Function.createDelegate(this, this._getRecipientType$p$0);
  848. this.$$d__getAppointmentResponse$p$0=Function.createDelegate(this, this._getAppointmentResponse$p$0);
  849. this.$$d__getDisplayName$p$0=Function.createDelegate(this, this._getDisplayName$p$0);
  850. this.$$d__getEmailAddress$p$0=Function.createDelegate(this, this._getEmailAddress$p$0);
  851. this._data$p$0=data;
  852. $h.InitialData._defineReadOnlyProperty$i(this, 'emailAddress', this.$$d__getEmailAddress$p$0);
  853. $h.InitialData._defineReadOnlyProperty$i(this, 'displayName', this.$$d__getDisplayName$p$0);
  854. if ($h.ScriptHelpers.dictionaryContainsKey(data, 'appointmentResponse')) {
  855. $h.InitialData._defineReadOnlyProperty$i(this, 'appointmentResponse', this.$$d__getAppointmentResponse$p$0);
  856. }
  857. if ($h.ScriptHelpers.dictionaryContainsKey(data, 'recipientType')) {
  858. $h.InitialData._defineReadOnlyProperty$i(this, 'recipientType', this.$$d__getRecipientType$p$0);
  859. }
  860. }
  861. $h.EmailAddressDetails._createFromEmailUserDictionary$i=function $h_EmailAddressDetails$_createFromEmailUserDictionary$i(data) {
  862. var emailAddressDetailsDictionary={};
  863. var displayName=data['Name'];
  864. var emailAddress=data['UserId'];
  865. emailAddressDetailsDictionary['name']=displayName || $h.EmailAddressDetails._emptyString$p;
  866. emailAddressDetailsDictionary['address']=emailAddress || $h.EmailAddressDetails._emptyString$p;
  867. return new $h.EmailAddressDetails(emailAddressDetailsDictionary);
  868. }
  869. $h.EmailAddressDetails.prototype={
  870. _data$p$0: null,
  871. _getEmailAddress$p$0: function $h_EmailAddressDetails$_getEmailAddress$p$0() {
  872. return this._data$p$0['address'];
  873. },
  874. _getDisplayName$p$0: function $h_EmailAddressDetails$_getDisplayName$p$0() {
  875. return this._data$p$0['name'];
  876. },
  877. _getAppointmentResponse$p$0: function $h_EmailAddressDetails$_getAppointmentResponse$p$0() {
  878. var response=this._data$p$0['appointmentResponse'];
  879. return (response < $h.EmailAddressDetails._responseTypeMap$p.length) ? $h.EmailAddressDetails._responseTypeMap$p[response] : Microsoft.Office.WebExtension.MailboxEnums.ResponseType.None;
  880. },
  881. _getRecipientType$p$0: function $h_EmailAddressDetails$_getRecipientType$p$0() {
  882. var response=this._data$p$0['recipientType'];
  883. return (response < $h.EmailAddressDetails._recipientTypeMap$p.length) ? $h.EmailAddressDetails._recipientTypeMap$p[response] : Microsoft.Office.WebExtension.MailboxEnums.RecipientType.Other;
  884. }
  885. }
  886. $h.Entities=function $h_Entities(data, filteredEntitiesData, timeSent, permissionLevel) {
  887. this.$$d__createMeetingSuggestion$p$0=Function.createDelegate(this, this._createMeetingSuggestion$p$0);
  888. this.$$d__getContacts$p$0=Function.createDelegate(this, this._getContacts$p$0);
  889. this.$$d__getPhoneNumbers$p$0=Function.createDelegate(this, this._getPhoneNumbers$p$0);
  890. this.$$d__getUrls$p$0=Function.createDelegate(this, this._getUrls$p$0);
  891. this.$$d__getEmailAddresses$p$0=Function.createDelegate(this, this._getEmailAddresses$p$0);
  892. this.$$d__getMeetingSuggestions$p$0=Function.createDelegate(this, this._getMeetingSuggestions$p$0);
  893. this.$$d__getTaskSuggestions$p$0=Function.createDelegate(this, this._getTaskSuggestions$p$0);
  894. this.$$d__getAddresses$p$0=Function.createDelegate(this, this._getAddresses$p$0);
  895. this._data$p$0=data || {};
  896. this._filteredData$p$0=filteredEntitiesData || {};
  897. this._dateTimeSent$p$0=timeSent;
  898. $h.InitialData._defineReadOnlyProperty$i(this, 'addresses', this.$$d__getAddresses$p$0);
  899. $h.InitialData._defineReadOnlyProperty$i(this, 'taskSuggestions', this.$$d__getTaskSuggestions$p$0);
  900. $h.InitialData._defineReadOnlyProperty$i(this, 'meetingSuggestions', this.$$d__getMeetingSuggestions$p$0);
  901. $h.InitialData._defineReadOnlyProperty$i(this, 'emailAddresses', this.$$d__getEmailAddresses$p$0);
  902. $h.InitialData._defineReadOnlyProperty$i(this, 'urls', this.$$d__getUrls$p$0);
  903. $h.InitialData._defineReadOnlyProperty$i(this, 'phoneNumbers', this.$$d__getPhoneNumbers$p$0);
  904. $h.InitialData._defineReadOnlyProperty$i(this, 'contacts', this.$$d__getContacts$p$0);
  905. this._permissionLevel$p$0=permissionLevel;
  906. }
  907. $h.Entities._getExtractedObjects$i=function $h_Entities$_getExtractedObjects$i(T, data, name, creator, removeDuplicates, stringPropertyName) {
  908. var results=null;
  909. var extractedObjects=data[name];
  910. if (!extractedObjects) {
  911. return new Array(0);
  912. }
  913. if (removeDuplicates) {
  914. extractedObjects=$h.Entities._removeDuplicate$p(Object, extractedObjects, $h.Entities._entityDictionaryEquals$p, stringPropertyName);
  915. }
  916. results=new Array(extractedObjects.length);
  917. var count=0;
  918. for (var $$arr_9=extractedObjects, $$len_A=$$arr_9.length, $$idx_B=0; $$idx_B < $$len_A;++$$idx_B) {
  919. var extractedObject=$$arr_9[$$idx_B];
  920. results[count++]=creator(extractedObject);
  921. }
  922. return results;
  923. }
  924. $h.Entities._getExtractedStringProperty$i=function $h_Entities$_getExtractedStringProperty$i(data, name, removeDuplicate) {
  925. var extractedProperties=data[name];
  926. if (!extractedProperties) {
  927. return new Array(0);
  928. }
  929. if (removeDuplicate) {
  930. extractedProperties=$h.Entities._removeDuplicate$p(String, extractedProperties, $h.Entities._stringEquals$p, null);
  931. }
  932. return extractedProperties;
  933. }
  934. $h.Entities._createContact$p=function $h_Entities$_createContact$p(data) {
  935. return new $h.Contact(data);
  936. }
  937. $h.Entities._createTaskSuggestion$p=function $h_Entities$_createTaskSuggestion$p(data) {
  938. return new $h.TaskSuggestion(data);
  939. }
  940. $h.Entities._createPhoneNumber$p=function $h_Entities$_createPhoneNumber$p(data) {
  941. return new $h.PhoneNumber(data);
  942. }
  943. $h.Entities._entityDictionaryEquals$p=function $h_Entities$_entityDictionaryEquals$p(dictionary1, dictionary2, entityPropertyIdentifier) {
  944. if (dictionary1===dictionary2) {
  945. return true;
  946. }
  947. if (!dictionary1 || !dictionary2) {
  948. return false;
  949. }
  950. if (dictionary1[entityPropertyIdentifier]===dictionary2[entityPropertyIdentifier]) {
  951. return true;
  952. }
  953. return false;
  954. }
  955. $h.Entities._stringEquals$p=function $h_Entities$_stringEquals$p(string1, string2, entityProperty) {
  956. return string1===string2;
  957. }
  958. $h.Entities._removeDuplicate$p=function $h_Entities$_removeDuplicate$p(T, array, entityEquals, entityPropertyIdentifier) {
  959. for (var matchIndex1=array.length - 1; matchIndex1 >=0; matchIndex1--) {
  960. var removeMatch=false;
  961. for (var matchIndex2=matchIndex1 - 1; matchIndex2 >=0; matchIndex2--) {
  962. if (entityEquals(array[matchIndex1], array[matchIndex2], entityPropertyIdentifier)) {
  963. removeMatch=true;
  964. break;
  965. }
  966. }
  967. if (removeMatch) {
  968. Array.removeAt(array, matchIndex1);
  969. }
  970. }
  971. return array;
  972. }
  973. $h.Entities.prototype={
  974. _dateTimeSent$p$0: null,
  975. _data$p$0: null,
  976. _filteredData$p$0: null,
  977. _filteredEntitiesCache$p$0: null,
  978. _permissionLevel$p$0: 0,
  979. _taskSuggestions$p$0: null,
  980. _meetingSuggestions$p$0: null,
  981. _phoneNumbers$p$0: null,
  982. _contacts$p$0: null,
  983. _addresses$p$0: null,
  984. _emailAddresses$p$0: null,
  985. _urls$p$0: null,
  986. _getByType$i$0: function $h_Entities$_getByType$i$0(entityType) {
  987. if (entityType===Microsoft.Office.WebExtension.MailboxEnums.EntityType.MeetingSuggestion) {
  988. return this._getMeetingSuggestions$p$0();
  989. }
  990. else if (entityType===Microsoft.Office.WebExtension.MailboxEnums.EntityType.TaskSuggestion) {
  991. return this._getTaskSuggestions$p$0();
  992. }
  993. else if (entityType===Microsoft.Office.WebExtension.MailboxEnums.EntityType.Address) {
  994. return this._getAddresses$p$0();
  995. }
  996. else if (entityType===Microsoft.Office.WebExtension.MailboxEnums.EntityType.PhoneNumber) {
  997. return this._getPhoneNumbers$p$0();
  998. }
  999. else if (entityType===Microsoft.Office.WebExtension.MailboxEnums.EntityType.EmailAddress) {
  1000. return this._getEmailAddresses$p$0();
  1001. }
  1002. else if (entityType===Microsoft.Office.WebExtension.MailboxEnums.EntityType.Url) {
  1003. return this._getUrls$p$0();
  1004. }
  1005. else if (entityType===Microsoft.Office.WebExtension.MailboxEnums.EntityType.Contact) {
  1006. return this._getContacts$p$0();
  1007. }
  1008. return null;
  1009. },
  1010. _getFilteredEntitiesByName$i$0: function $h_Entities$_getFilteredEntitiesByName$i$0(name) {
  1011. if (!this._filteredEntitiesCache$p$0) {
  1012. this._filteredEntitiesCache$p$0={};
  1013. }
  1014. if (!$h.ScriptHelpers.dictionaryContainsKey(this._filteredEntitiesCache$p$0, name)) {
  1015. var found=false;
  1016. for (var i=0; i < $h.Entities._allEntityKeys$p.length; i++) {
  1017. var entityTypeKey=$h.Entities._allEntityKeys$p[i];
  1018. var perEntityTypeDictionary=this._filteredData$p$0[entityTypeKey];
  1019. if (!perEntityTypeDictionary) {
  1020. continue;
  1021. }
  1022. if ($h.ScriptHelpers.dictionaryContainsKey(perEntityTypeDictionary, name)) {
  1023. switch (entityTypeKey) {
  1024. case 'EmailAddresses':
  1025. case 'Urls':
  1026. this._filteredEntitiesCache$p$0[name]=$h.Entities._getExtractedStringProperty$i(perEntityTypeDictionary, name);
  1027. break;
  1028. case 'Addresses':
  1029. this._filteredEntitiesCache$p$0[name]=$h.Entities._getExtractedStringProperty$i(perEntityTypeDictionary, name, true);
  1030. break;
  1031. case 'PhoneNumbers':
  1032. this._filteredEntitiesCache$p$0[name]=$h.Entities._getExtractedObjects$i($h.PhoneNumber, perEntityTypeDictionary, name, $h.Entities._createPhoneNumber$p, false, null);
  1033. break;
  1034. case 'TaskSuggestions':
  1035. this._filteredEntitiesCache$p$0[name]=$h.Entities._getExtractedObjects$i($h.TaskSuggestion, perEntityTypeDictionary, name, $h.Entities._createTaskSuggestion$p, true, 'TaskString');
  1036. break;
  1037. case 'MeetingSuggestions':
  1038. this._filteredEntitiesCache$p$0[name]=$h.Entities._getExtractedObjects$i($h.MeetingSuggestion, perEntityTypeDictionary, name, this.$$d__createMeetingSuggestion$p$0, true, 'MeetingString');
  1039. break;
  1040. case 'Contacts':
  1041. this._filteredEntitiesCache$p$0[name]=$h.Entities._getExtractedObjects$i($h.Contact, perEntityTypeDictionary, name, $h.Entities._createContact$p, true, 'ContactString');
  1042. break;
  1043. }
  1044. found=true;
  1045. break;
  1046. }
  1047. }
  1048. if (!found) {
  1049. this._filteredEntitiesCache$p$0[name]=null;
  1050. }
  1051. }
  1052. return this._filteredEntitiesCache$p$0[name];
  1053. },
  1054. _createMeetingSuggestion$p$0: function $h_Entities$_createMeetingSuggestion$p$0(data) {
  1055. return new $h.MeetingSuggestion(data, this._dateTimeSent$p$0);
  1056. },
  1057. _getAddresses$p$0: function $h_Entities$_getAddresses$p$0() {
  1058. if (!this._addresses$p$0) {
  1059. this._addresses$p$0=$h.Entities._getExtractedStringProperty$i(this._data$p$0, 'Addresses', true);
  1060. }
  1061. return this._addresses$p$0;
  1062. },
  1063. _getEmailAddresses$p$0: function $h_Entities$_getEmailAddresses$p$0() {
  1064. OSF.DDA.OutlookAppOm._throwOnPropertyAccessForRestrictedPermission$i(this._permissionLevel$p$0);
  1065. if (!this._emailAddresses$p$0) {
  1066. this._emailAddresses$p$0=$h.Entities._getExtractedStringProperty$i(this._data$p$0, 'EmailAddresses', false);
  1067. }
  1068. return this._emailAddresses$p$0;
  1069. },
  1070. _getUrls$p$0: function $h_Entities$_getUrls$p$0() {
  1071. if (!this._urls$p$0) {
  1072. this._urls$p$0=$h.Entities._getExtractedStringProperty$i(this._data$p$0, 'Urls', false);
  1073. }
  1074. return this._urls$p$0;
  1075. },
  1076. _getPhoneNumbers$p$0: function $h_Entities$_getPhoneNumbers$p$0() {
  1077. if (!this._phoneNumbers$p$0) {
  1078. this._phoneNumbers$p$0=$h.Entities._getExtractedObjects$i($h.PhoneNumber, this._data$p$0, 'PhoneNumbers', $h.Entities._createPhoneNumber$p);
  1079. }
  1080. return this._phoneNumbers$p$0;
  1081. },
  1082. _getTaskSuggestions$p$0: function $h_Entities$_getTaskSuggestions$p$0() {
  1083. OSF.DDA.OutlookAppOm._throwOnPropertyAccessForRestrictedPermission$i(this._permissionLevel$p$0);
  1084. if (!this._taskSuggestions$p$0) {
  1085. this._taskSuggestions$p$0=$h.Entities._getExtractedObjects$i($h.TaskSuggestion, this._data$p$0, 'TaskSuggestions', $h.Entities._createTaskSuggestion$p, true, 'TaskString');
  1086. }
  1087. return this._taskSuggestions$p$0;
  1088. },
  1089. _getMeetingSuggestions$p$0: function $h_Entities$_getMeetingSuggestions$p$0() {
  1090. OSF.DDA.OutlookAppOm._throwOnPropertyAccessForRestrictedPermission$i(this._permissionLevel$p$0);
  1091. if (!this._meetingSuggestions$p$0) {
  1092. this._meetingSuggestions$p$0=$h.Entities._getExtractedObjects$i($h.MeetingSuggestion, this._data$p$0, 'MeetingSuggestions', this.$$d__createMeetingSuggestion$p$0, true, 'MeetingString');
  1093. }
  1094. return this._meetingSuggestions$p$0;
  1095. },
  1096. _getContacts$p$0: function $h_Entities$_getContacts$p$0() {
  1097. OSF.DDA.OutlookAppOm._throwOnPropertyAccessForRestrictedPermission$i(this._permissionLevel$p$0);
  1098. if (!this._contacts$p$0) {
  1099. this._contacts$p$0=$h.Entities._getExtractedObjects$i($h.Contact, this._data$p$0, 'Contacts', $h.Entities._createContact$p, true, 'ContactString');
  1100. }
  1101. return this._contacts$p$0;
  1102. }
  1103. }
  1104. $h.Item=function $h_Item(data) {
  1105. this.$$d__createCustomProperties$i$0=Function.createDelegate(this, this._createCustomProperties$i$0);
  1106. this.$$d__getAttachments$p$0=Function.createDelegate(this, this._getAttachments$p$0);
  1107. this.$$d__getItemClass$p$0=Function.createDelegate(this, this._getItemClass$p$0);
  1108. this.$$d__getItemId$p$0=Function.createDelegate(this, this._getItemId$p$0);
  1109. this.$$d__getDateTimeModified$p$0=Function.createDelegate(this, this._getDateTimeModified$p$0);
  1110. this.$$d__getDateTimeCreated$p$0=Function.createDelegate(this, this._getDateTimeCreated$p$0);
  1111. this._data$p$0=data;
  1112. $h.InitialData._defineReadOnlyProperty$i(this, 'dateTimeCreated', this.$$d__getDateTimeCreated$p$0);
  1113. $h.InitialData._defineReadOnlyProperty$i(this, 'dateTimeModified', this.$$d__getDateTimeModified$p$0);
  1114. $h.InitialData._defineReadOnlyProperty$i(this, 'itemId', this.$$d__getItemId$p$0);
  1115. var $$t_1=this;
  1116. $h.InitialData._defineReadOnlyProperty$i(this, 'itemType', function() {
  1117. return $$t_1.getItemType();
  1118. });
  1119. $h.InitialData._defineReadOnlyProperty$i(this, 'itemClass', this.$$d__getItemClass$p$0);
  1120. if (OSF.DDA.OutlookAppOm._instance$p.get__appName$i$0()===64) {
  1121. $h.InitialData._defineReadOnlyProperty$i(this, 'attachments', this.$$d__getAttachments$p$0);
  1122. }
  1123. }
  1124. $h.Item.prototype={
  1125. _data$p$0: null,
  1126. loadCustomPropertiesAsync: function $h_Item$loadCustomPropertiesAsync(callback, userContext) {
  1127. if ($h.ScriptHelpers.isNullOrUndefined(callback)) {
  1128. throw Error.argumentNull('callback');
  1129. }
  1130. var loadCustomProperties=new $h._loadDictionaryRequest(this.$$d__createCustomProperties$i$0, 'customProperties', callback, userContext);
  1131. loadCustomProperties._sendRequest$i$0(3, 'LoadCustomProperties', {});
  1132. },
  1133. _createCustomProperties$i$0: function $h_Item$_createCustomProperties$i$0(data) {
  1134. return new $h.CustomProperties(data);
  1135. },
  1136. _getItemId$p$0: function $h_Item$_getItemId$p$0() {
  1137. return this._data$p$0.get__itemId$i$0();
  1138. },
  1139. _getItemClass$p$0: function $h_Item$_getItemClass$p$0() {
  1140. return this._data$p$0.get__itemClass$i$0();
  1141. },
  1142. _getDateTimeCreated$p$0: function $h_Item$_getDateTimeCreated$p$0() {
  1143. return this._data$p$0.get__dateTimeCreated$i$0();
  1144. },
  1145. _getDateTimeModified$p$0: function $h_Item$_getDateTimeModified$p$0() {
  1146. return this._data$p$0.get__dateTimeModified$i$0();
  1147. },
  1148. _getAttachments$p$0: function $h_Item$_getAttachments$p$0() {
  1149. return this._data$p$0.get__attachments$i$0();
  1150. }
  1151. }
  1152. $h.MeetingRequest=function $h_MeetingRequest(data) {
  1153. this.$$d__getRequiredAttendees$p$2=Function.createDelegate(this, this._getRequiredAttendees$p$2);
  1154. this.$$d__getOptionalAttendees$p$2=Function.createDelegate(this, this._getOptionalAttendees$p$2);
  1155. this.$$d__getLocation$p$2=Function.createDelegate(this, this._getLocation$p$2);
  1156. this.$$d__getEnd$p$2=Function.createDelegate(this, this._getEnd$p$2);
  1157. this.$$d__getStart$p$2=Function.createDelegate(this, this._getStart$p$2);
  1158. $h.MeetingRequest.initializeBase(this, [ data ]);
  1159. $h.InitialData._defineReadOnlyProperty$i(this, 'start', this.$$d__getStart$p$2);
  1160. $h.InitialData._defineReadOnlyProperty$i(this, 'end', this.$$d__getEnd$p$2);
  1161. $h.InitialData._defineReadOnlyProperty$i(this, 'location', this.$$d__getLocation$p$2);
  1162. $h.InitialData._defineReadOnlyProperty$i(this, 'optionalAttendees', this.$$d__getOptionalAttendees$p$2);
  1163. $h.InitialData._defineReadOnlyProperty$i(this, 'requiredAttendees', this.$$d__getRequiredAttendees$p$2);
  1164. }
  1165. $h.MeetingRequest.prototype={
  1166. _getStart$p$2: function $h_MeetingRequest$_getStart$p$2() {
  1167. return this._data$p$0.get__start$i$0();
  1168. },
  1169. _getEnd$p$2: function $h_MeetingRequest$_getEnd$p$2() {
  1170. return this._data$p$0.get__end$i$0();
  1171. },
  1172. _getLocation$p$2: function $h_MeetingRequest$_getLocation$p$2() {
  1173. return this._data$p$0.get__location$i$0();
  1174. },
  1175. _getOptionalAttendees$p$2: function $h_MeetingRequest$_getOptionalAttendees$p$2() {
  1176. return this._data$p$0.get__cc$i$0();
  1177. },
  1178. _getRequiredAttendees$p$2: function $h_MeetingRequest$_getRequiredAttendees$p$2() {
  1179. return this._data$p$0.get__to$i$0();
  1180. }
  1181. }
  1182. $h.MeetingSuggestion=function $h_MeetingSuggestion(data, dateTimeSent) {
  1183. this.$$d__getEndTime$p$0=Function.createDelegate(this, this._getEndTime$p$0);
  1184. this.$$d__getStartTime$p$0=Function.createDelegate(this, this._getStartTime$p$0);
  1185. this.$$d__getSubject$p$0=Function.createDelegate(this, this._getSubject$p$0);
  1186. this.$$d__getLocation$p$0=Function.createDelegate(this, this._getLocation$p$0);
  1187. this.$$d__getAttendees$p$0=Function.createDelegate(this, this._getAttendees$p$0);
  1188. this.$$d__getMeetingString$p$0=Function.createDelegate(this, this._getMeetingString$p$0);
  1189. this._data$p$0=data;
  1190. this._dateTimeSent$p$0=dateTimeSent;
  1191. $h.InitialData._defineReadOnlyProperty$i(this, 'meetingString', this.$$d__getMeetingString$p$0);
  1192. $h.InitialData._defineReadOnlyProperty$i(this, 'attendees', this.$$d__getAttendees$p$0);
  1193. $h.InitialData._defineReadOnlyProperty$i(this, 'location', this.$$d__getLocation$p$0);
  1194. $h.InitialData._defineReadOnlyProperty$i(this, 'subject', this.$$d__getSubject$p$0);
  1195. $h.InitialData._defineReadOnlyProperty$i(this, 'start', this.$$d__getStartTime$p$0);
  1196. $h.InitialData._defineReadOnlyProperty$i(this, 'end', this.$$d__getEndTime$p$0);
  1197. }
  1198. $h.MeetingSuggestion.prototype={
  1199. _dateTimeSent$p$0: null,
  1200. _data$p$0: null,
  1201. _attendees$p$0: null,
  1202. _getMeetingString$p$0: function $h_MeetingSuggestion$_getMeetingString$p$0() {
  1203. return this._data$p$0['MeetingString'];
  1204. },
  1205. _getLocation$p$0: function $h_MeetingSuggestion$_getLocation$p$0() {
  1206. return this._data$p$0['Location'];
  1207. },
  1208. _getSubject$p$0: function $h_MeetingSuggestion$_getSubject$p$0() {
  1209. return this._data$p$0['Subject'];
  1210. },
  1211. _getStartTime$p$0: function $h_MeetingSuggestion$_getStartTime$p$0() {
  1212. var time=this._createDateTimeFromParameter$p$0('StartTime');
  1213. var resolvedTime=$h.MeetingSuggestionTimeDecoder.resolve(time, this._dateTimeSent$p$0);
  1214. if (resolvedTime.getTime() !==time.getTime()) {
  1215. return OSF.DDA.OutlookAppOm._instance$p.convertToUtcClientTime(OSF.DDA.OutlookAppOm._instance$p._dateToDictionary$i$0(resolvedTime));
  1216. }
  1217. return time;
  1218. },
  1219. _getEndTime$p$0: function $h_MeetingSuggestion$_getEndTime$p$0() {
  1220. var time=this._createDateTimeFromParameter$p$0('EndTime');
  1221. var resolvedTime=$h.MeetingSuggestionTimeDecoder.resolve(time, this._dateTimeSent$p$0);
  1222. if (resolvedTime.getTime() !==time.getTime()) {
  1223. return OSF.DDA.OutlookAppOm._instance$p.convertToUtcClientTime(OSF.DDA.OutlookAppOm._instance$p._dateToDictionary$i$0(resolvedTime));
  1224. }
  1225. return time;
  1226. },
  1227. _createDateTimeFromParameter$p$0: function $h_MeetingSuggestion$_createDateTimeFromParameter$p$0(keyName) {
  1228. var dateTimeString=this._data$p$0[keyName];
  1229. if (!dateTimeString) {
  1230. return null;
  1231. }
  1232. return new Date(dateTimeString);
  1233. },
  1234. _getAttendees$p$0: function $h_MeetingSuggestion$_getAttendees$p$0() {
  1235. if (!this._attendees$p$0) {
  1236. var $$t_1=this;
  1237. this._attendees$p$0=$h.Entities._getExtractedObjects$i($h.EmailAddressDetails, this._data$p$0, 'Attendees', function(data) {
  1238. return $h.EmailAddressDetails._createFromEmailUserDictionary$i(data);
  1239. });
  1240. }
  1241. return this._attendees$p$0;
  1242. }
  1243. }
  1244. $h.MeetingSuggestionTimeDecoder=function $h_MeetingSuggestionTimeDecoder() {
  1245. }
  1246. $h.MeetingSuggestionTimeDecoder.resolve=function $h_MeetingSuggestionTimeDecoder$resolve(inTime, sentTime) {
  1247. if (!sentTime) {
  1248. return inTime;
  1249. }
  1250. try {
  1251. var tod;
  1252. var outDate;
  1253. var extractedDate;
  1254. var sentDate=new Date(sentTime.getFullYear(), sentTime.getMonth(), sentTime.getDate(), 0, 0, 0, 0);
  1255. var $$t_7, $$t_8, $$t_9;
  1256. if (!(($$t_9=$h.MeetingSuggestionTimeDecoder._decode$p(inTime, ($$t_7={'val': extractedDate}), ($$t_8={'val': tod}))), extractedDate=$$t_7.val, tod=$$t_8.val, $$t_9)) {
  1257. return inTime;
  1258. }
  1259. else {
  1260. if ($h._preciseDate.isInstanceOfType(extractedDate)) {
  1261. outDate=$h.MeetingSuggestionTimeDecoder._resolvePreciseDate$p(sentDate, extractedDate);
  1262. }
  1263. else {
  1264. if ($h._relativeDate.isInstanceOfType(extractedDate)) {
  1265. outDate=$h.MeetingSuggestionTimeDecoder._resolveRelativeDate$p(sentDate, extractedDate);
  1266. }
  1267. else {
  1268. outDate=sentDate;
  1269. }
  1270. }
  1271. if (isNaN(outDate.getTime())) {
  1272. return sentTime;
  1273. }
  1274. outDate.setMilliseconds(outDate.getMilliseconds()+tod);
  1275. return outDate;
  1276. }
  1277. }
  1278. catch ($$e_6) {
  1279. return sentTime;
  1280. }
  1281. }
  1282. $h.MeetingSuggestionTimeDecoder._isNullOrUndefined$i=function $h_MeetingSuggestionTimeDecoder$_isNullOrUndefined$i(value) {
  1283. return null===value || value===undefined;
  1284. }
  1285. $h.MeetingSuggestionTimeDecoder._resolvePreciseDate$p=function $h_MeetingSuggestionTimeDecoder$_resolvePreciseDate$p(sentDate, precise) {
  1286. var year=precise._year$i$1;
  1287. var month=(!precise._month$i$1) ? sentDate.getMonth() : precise._month$i$1 - 1;
  1288. var day=precise._day$i$1;
  1289. if (!day) {
  1290. return sentDate;
  1291. }
  1292. var candidate;
  1293. if ($h.MeetingSuggestionTimeDecoder._isNullOrUndefined$i(year)) {
  1294. candidate=new Date(sentDate.getFullYear(), month, day);
  1295. if (candidate.getTime() < sentDate.getTime()) {
  1296. candidate=new Date(sentDate.getFullYear()+1, month, day);
  1297. }
  1298. }
  1299. else {
  1300. candidate=new Date((year < 50) ? 2000+year : 1900+year, month, day);
  1301. }
  1302. if (candidate.getMonth() !==month) {
  1303. return sentDate;
  1304. }
  1305. return candidate;
  1306. }
  1307. $h.MeetingSuggestionTimeDecoder._resolveRelativeDate$p=function $h_MeetingSuggestionTimeDecoder$_resolveRelativeDate$p(sentDate, relative) {
  1308. var date;
  1309. switch (relative._unit$i$1) {
  1310. case 0:
  1311. date=new Date(sentDate.getFullYear(), sentDate.getMonth(), sentDate.getDate());
  1312. date.setDate(date.getDate()+relative._offset$i$1);
  1313. return date;
  1314. case 5:
  1315. return $h.MeetingSuggestionTimeDecoder._findBestDateForWeekDate$p(sentDate, relative._offset$i$1, relative._tag$i$1);
  1316. case 2:
  1317. var days=1;
  1318. switch (relative._modifier$i$1) {
  1319. case 1:
  1320. break;
  1321. case 2:
  1322. days=16;
  1323. break;
  1324. default:
  1325. if (!relative._offset$i$1) {
  1326. days=sentDate.getDate();
  1327. }
  1328. break;
  1329. }
  1330. date=new Date(sentDate.getFullYear(), sentDate.getMonth(), days);
  1331. date.setMonth(date.getMonth()+relative._offset$i$1);
  1332. if (date.getTime() < sentDate.getTime()) {
  1333. date.setDate(date.getDate()+sentDate.getDate() - 1);
  1334. }
  1335. return date;
  1336. case 1:
  1337. date=new Date(sentDate.getFullYear(), sentDate.getMonth(), sentDate.getDate());
  1338. date.setDate(sentDate.getDate()+(7 * relative._offset$i$1));
  1339. if (relative._modifier$i$1===1 || !relative._modifier$i$1) {
  1340. date.setDate(date.getDate()+1 - date.getDay());
  1341. if (date.getTime() < sentDate.getTime()) {
  1342. return sentDate;
  1343. }
  1344. return date;
  1345. }
  1346. else if (relative._modifier$i$1===2) {
  1347. date.setDate(date.getDate()+5 - date.getDay());
  1348. return date;
  1349. }
  1350. break;
  1351. case 4:
  1352. return $h.MeetingSuggestionTimeDecoder._findBestDateForWeekOfMonthDate$p(sentDate, relative);
  1353. case 3:
  1354. if (relative._offset$i$1 > 0) {
  1355. return new Date(sentDate.getFullYear()+relative._offset$i$1, 0, 1);
  1356. }
  1357. break;
  1358. default:
  1359. break;
  1360. }
  1361. return sentDate;
  1362. }
  1363. $h.MeetingSuggestionTimeDecoder._findBestDateForWeekDate$p=function $h_MeetingSuggestionTimeDecoder$_findBestDateForWeekDate$p(sentDate, offset, tag) {
  1364. if (offset > -5 && offset < 5) {
  1365. var dayOfWeek;
  1366. var days;
  1367. dayOfWeek=((tag+6) % 7)+1;
  1368. days=(7 * offset)+(dayOfWeek - sentDate.getDay());
  1369. sentDate.setDate(sentDate.getDate()+days);
  1370. return sentDate;
  1371. }
  1372. else {
  1373. var days=(tag - sentDate.getDay()) % 7;
  1374. if (days < 0) {
  1375. days+=7;
  1376. }
  1377. sentDate.setDate(sentDate.getDate()+days);
  1378. return sentDate;
  1379. }
  1380. }
  1381. $h.MeetingSuggestionTimeDecoder._findBestDateForWeekOfMonthDate$p=function $h_MeetingSuggestionTimeDecoder$_findBestDateForWeekOfMonthDate$p(sentDate, relative) {
  1382. var date;
  1383. var firstDay;
  1384. var newDate;
  1385. date=sentDate;
  1386. if (relative._tag$i$1 <=0 || relative._tag$i$1 > 12 || relative._offset$i$1 <=0 || relative._offset$i$1 > 5) {
  1387. return sentDate;
  1388. }
  1389. var monthOffset=(12+relative._tag$i$1 - date.getMonth() - 1) % 12;
  1390. firstDay=new Date(date.getFullYear(), date.getMonth()+monthOffset, 1);
  1391. if (relative._modifier$i$1===1) {
  1392. if (relative._offset$i$1===1 && firstDay.getDay() !==6 && firstDay.getDay() !==0) {
  1393. return firstDay;
  1394. }
  1395. else {
  1396. newDate=new Date(firstDay.getFullYear(), firstDay.getMonth(), firstDay.getDate());
  1397. newDate.setDate(newDate.getDate()+((7+(1 - firstDay.getDay())) % 7));
  1398. if (firstDay.getDay() !==6 && firstDay.getDay() !==0 && firstDay.getDay() !==1) {
  1399. newDate.setDate(newDate.getDate() - 7);
  1400. }
  1401. newDate.setDate(newDate.getDate()+(7 * (relative._offset$i$1 - 1)));
  1402. if (newDate.getMonth()+1 !==relative._tag$i$1) {
  1403. return sentDate;
  1404. }
  1405. return newDate;
  1406. }
  1407. }
  1408. else {
  1409. newDate=new Date(firstDay.getFullYear(), firstDay.getMonth(), $h.MeetingSuggestionTimeDecoder._daysInMonth$p(firstDay.getMonth(), firstDay.getFullYear()));
  1410. var offset=1 - newDate.getDay();
  1411. if (offset > 0) {
  1412. offset=offset - 7;
  1413. }
  1414. newDate.setDate(newDate.getDate()+offset);
  1415. newDate.setDate(newDate.getDate()+(7 * (1 - relative._offset$i$1)));
  1416. if (newDate.getMonth()+1 !==relative._tag$i$1) {
  1417. if (firstDay.getDay() !==6 && firstDay.getDay() !==0) {
  1418. return firstDay;
  1419. }
  1420. else {
  1421. return sentDate;
  1422. }
  1423. }
  1424. else {
  1425. return newDate;
  1426. }
  1427. }
  1428. }
  1429. $h.MeetingSuggestionTimeDecoder._decode$p=function $h_MeetingSuggestionTimeDecoder$_decode$p(inDate, date, time) {
  1430. var DateValueMask=32767;
  1431. date.val=null;
  1432. time.val=0;
  1433. if (!inDate) {
  1434. return false;
  1435. }
  1436. time.val=$h.MeetingSuggestionTimeDecoder._getTimeOfDayInMillisecondsUTC$p(inDate);
  1437. var inDateAtMidnight=inDate.getTime() - time.val;
  1438. var value=(inDateAtMidnight - $h.MeetingSuggestionTimeDecoder._baseDate$p.getTime()) / 86400000;
  1439. if (value < 0) {
  1440. return false;
  1441. }
  1442. else if (value >=262144) {
  1443. return false;
  1444. }
  1445. else {
  1446. var type=value >> 15;
  1447. value=value & DateValueMask;
  1448. switch (type) {
  1449. case 0:
  1450. return $h.MeetingSuggestionTimeDecoder._decodePreciseDate$p(value, date);
  1451. case 1:
  1452. return $h.MeetingSuggestionTimeDecoder._decodeRelativeDate$p(value, date);
  1453. default:
  1454. return false;
  1455. }
  1456. }
  1457. }
  1458. $h.MeetingSuggestionTimeDecoder._decodePreciseDate$p=function $h_MeetingSuggestionTimeDecoder$_decodePreciseDate$p(value, date) {
  1459. var c_SubTypeMask=7;
  1460. var c_MonthMask=15;
  1461. var c_DayMask=31;
  1462. var c_YearMask=127;
  1463. var year=null;
  1464. var month=0;
  1465. var day=0;
  1466. date.val=null;
  1467. var subType=(value >> 12) & c_SubTypeMask;
  1468. if ((subType & 4)===4) {
  1469. year=(value >> 5) & c_YearMask;
  1470. if ((subType & 2)===2) {
  1471. if ((subType & 1)===1) {
  1472. return false;
  1473. }
  1474. month=(value >> 1) & c_MonthMask;
  1475. }
  1476. }
  1477. else {
  1478. if ((subType & 2)===2) {
  1479. month=(value >> 8) & c_MonthMask;
  1480. }
  1481. if ((subType & 1)===1) {
  1482. day=(value >> 3) & c_DayMask;
  1483. }
  1484. }
  1485. date.val=new $h._preciseDate(day, month, year);
  1486. return true;
  1487. }
  1488. $h.MeetingSuggestionTimeDecoder._decodeRelativeDate$p=function $h_MeetingSuggestionTimeDecoder$_decodeRelativeDate$p(value, date) {
  1489. var TagMask=15;
  1490. var OffsetMask=63;
  1491. var UnitMask=7;
  1492. var ModifierMask=3;
  1493. var tag=value & TagMask;
  1494. value >>=4;
  1495. var offset=$h.MeetingSuggestionTimeDecoder._fromComplement$p(value & OffsetMask, 6);
  1496. value >>=6;
  1497. var unit=value & UnitMask;
  1498. value >>=3;
  1499. var modifier=value & ModifierMask;
  1500. try {
  1501. date.val=new $h._relativeDate(modifier, offset, unit, tag);
  1502. return true;
  1503. }
  1504. catch ($$e_A) {
  1505. date.val=null;
  1506. return false;
  1507. }
  1508. }
  1509. $h.MeetingSuggestionTimeDecoder._fromComplement$p=function $h_MeetingSuggestionTimeDecoder$_fromComplement$p(value, n) {
  1510. var signed=1 << (n - 1);
  1511. var mask=(1 << n) - 1;
  1512. if ((value & signed)===signed) {
  1513. return -((value ^ mask)+1);
  1514. }
  1515. else {
  1516. return value;
  1517. }
  1518. }
  1519. $h.MeetingSuggestionTimeDecoder._daysInMonth$p=function $h_MeetingSuggestionTimeDecoder$_daysInMonth$p(month, year) {
  1520. return 32 - new Date(year, month, 32).getDate();
  1521. }
  1522. $h.MeetingSuggestionTimeDecoder._getTimeOfDayInMillisecondsUTC$p=function $h_MeetingSuggestionTimeDecoder$_getTimeOfDayInMillisecondsUTC$p(inputTime) {
  1523. var timeOfDay=0;
  1524. timeOfDay+=inputTime.getUTCHours() * 3600;
  1525. timeOfDay+=inputTime.getUTCMinutes() * 60;
  1526. timeOfDay+=inputTime.getUTCSeconds();
  1527. timeOfDay *=1000;
  1528. timeOfDay+=inputTime.getUTCMilliseconds();
  1529. return timeOfDay;
  1530. }
  1531. $h._extractedDate=function $h__extractedDate() {
  1532. }
  1533. $h._preciseDate=function $h__preciseDate(day, month, year) {
  1534. $h._preciseDate.initializeBase(this);
  1535. if (day < 0 || day > 31) {
  1536. throw Error.argumentOutOfRange('day');
  1537. }
  1538. if (month < 0 || month > 12) {
  1539. throw Error.argumentOutOfRange('month');
  1540. }
  1541. this._day$i$1=day;
  1542. this._month$i$1=month;
  1543. if (!$h.MeetingSuggestionTimeDecoder._isNullOrUndefined$i(year)) {
  1544. if (!month && day) {
  1545. throw Error.argument('Invalid arguments');
  1546. }
  1547. if (year < 0 || year > 2099) {
  1548. throw Error.argumentOutOfRange('year');
  1549. }
  1550. this._year$i$1=year % 100;
  1551. }
  1552. else if (!this._month$i$1 && !this._day$i$1) {
  1553. throw Error.argument('Invalid datetime');
  1554. }
  1555. }
  1556. $h._preciseDate.prototype={
  1557. _day$i$1: 0,
  1558. _month$i$1: 0,
  1559. _year$i$1: null
  1560. }
  1561. $h._relativeDate=function $h__relativeDate(modifier, offset, unit, tag) {
  1562. $h._relativeDate.initializeBase(this);
  1563. if (offset < -32 || offset > 31) {
  1564. throw Error.argumentOutOfRange('offset');
  1565. }
  1566. if (tag < 0 || tag > 15) {
  1567. throw Error.argumentOutOfRange('tag');
  1568. }
  1569. if (!unit && offset < 0) {
  1570. throw Error.argument('unit & offset do not form a valid date');
  1571. }
  1572. this._modifier$i$1=modifier;
  1573. this._offset$i$1=offset;
  1574. this._unit$i$1=unit;
  1575. this._tag$i$1=tag;
  1576. }
  1577. $h._relativeDate.prototype={
  1578. _modifier$i$1: 0,
  1579. _offset$i$1: 0,
  1580. _unit$i$1: 0,
  1581. _tag$i$1: 0
  1582. }
  1583. $h.Message=function $h_Message(dataDictionary) {
  1584. this.$$d__getConversationId$p$1=Function.createDelegate(this, this._getConversationId$p$1);
  1585. this.$$d__getInternetMessageId$p$1=Function.createDelegate(this, this._getInternetMessageId$p$1);
  1586. this.$$d__getCc$p$1=Function.createDelegate(this, this._getCc$p$1);
  1587. this.$$d__getTo$p$1=Function.createDelegate(this, this._getTo$p$1);
  1588. this.$$d__getFrom$p$1=Function.createDelegate(this, this._getFrom$p$1);
  1589. this.$$d__getSender$p$1=Function.createDelegate(this, this._getSender$p$1);
  1590. this.$$d__getNormalizedSubject$p$1=Function.createDelegate(this, this._getNormalizedSubject$p$1);
  1591. this.$$d__getSubject$p$1=Function.createDelegate(this, this._getSubject$p$1);
  1592. $h.Message.initializeBase(this, [ dataDictionary ]);
  1593. $h.InitialData._defineReadOnlyProperty$i(this, 'subject', this.$$d__getSubject$p$1);
  1594. $h.InitialData._defineReadOnlyProperty$i(this, 'normalizedSubject', this.$$d__getNormalizedSubject$p$1);
  1595. $h.InitialData._defineReadOnlyProperty$i(this, 'sender', this.$$d__getSender$p$1);
  1596. $h.InitialData._defineReadOnlyProperty$i(this, 'from', this.$$d__getFrom$p$1);
  1597. $h.InitialData._defineReadOnlyProperty$i(this, 'to', this.$$d__getTo$p$1);
  1598. $h.InitialData._defineReadOnlyProperty$i(this, 'cc', this.$$d__getCc$p$1);
  1599. $h.InitialData._defineReadOnlyProperty$i(this, 'internetMessageId', this.$$d__getInternetMessageId$p$1);
  1600. $h.InitialData._defineReadOnlyProperty$i(this, 'conversationId', this.$$d__getConversationId$p$1);
  1601. }
  1602. $h.Message.prototype={
  1603. getEntities: function $h_Message$getEntities() {
  1604. return this._data$p$0._getEntities$i$0();
  1605. },
  1606. getEntitiesByType: function $h_Message$getEntitiesByType(entityType) {
  1607. return this._data$p$0._getEntitiesByType$i$0(entityType);
  1608. },
  1609. getFilteredEntitiesByName: function $h_Message$getFilteredEntitiesByName(name) {
  1610. return this._data$p$0._getFilteredEntitiesByName$i$0(name);
  1611. },
  1612. getRegExMatches: function $h_Message$getRegExMatches() {
  1613. OSF.DDA.OutlookAppOm._throwOnMethodCallForInsufficientPermission$i(this._data$p$0.get__permissionLevel$i$0(), 1, 'getRegExMatches');
  1614. return this._data$p$0._getRegExMatches$i$0();
  1615. },
  1616. getRegExMatchesByName: function $h_Message$getRegExMatchesByName(name) {
  1617. OSF.DDA.OutlookAppOm._throwOnMethodCallForInsufficientPermission$i(this._data$p$0.get__permissionLevel$i$0(), 1, 'getRegExMatchesByName');
  1618. return this._data$p$0._getRegExMatchesByName$i$0(name);
  1619. },
  1620. displayReplyForm: function $h_Message$displayReplyForm(htmlBody) {
  1621. OSF.DDA.OutlookAppOm._instance$p._displayReplyForm$i$0(htmlBody);
  1622. },
  1623. displayReplyAllForm: function $h_Message$displayReplyAllForm(htmlBody) {
  1624. OSF.DDA.OutlookAppOm._instance$p._displayReplyAllForm$i$0(htmlBody);
  1625. },
  1626. getItemType: function $h_Message$getItemType() {
  1627. return Microsoft.Office.WebExtension.MailboxEnums.ItemType.Message;
  1628. },
  1629. _getSubject$p$1: function $h_Message$_getSubject$p$1() {
  1630. return this._data$p$0.get__subject$i$0();
  1631. },
  1632. _getNormalizedSubject$p$1: function $h_Message$_getNormalizedSubject$p$1() {
  1633. return this._data$p$0.get__normalizedSubject$i$0();
  1634. },
  1635. _getSender$p$1: function $h_Message$_getSender$p$1() {
  1636. return this._data$p$0.get__sender$i$0();
  1637. },
  1638. _getFrom$p$1: function $h_Message$_getFrom$p$1() {
  1639. return this._data$p$0.get__from$i$0();
  1640. },
  1641. _getTo$p$1: function $h_Message$_getTo$p$1() {
  1642. return this._data$p$0.get__to$i$0();
  1643. },
  1644. _getCc$p$1: function $h_Message$_getCc$p$1() {
  1645. return this._data$p$0.get__cc$i$0();
  1646. },
  1647. _getInternetMessageId$p$1: function $h_Message$_getInternetMessageId$p$1() {
  1648. return this._data$p$0.get__internetMessageId$i$0();
  1649. },
  1650. _getConversationId$p$1: function $h_Message$_getConversationId$p$1() {
  1651. return this._data$p$0.get__conversationId$i$0();
  1652. }
  1653. }
  1654. $h.PhoneNumber=function $h_PhoneNumber(data) {
  1655. this.$$d__getPhoneType$p$0=Function.createDelegate(this, this._getPhoneType$p$0);
  1656. this.$$d__getOriginalPhoneString$p$0=Function.createDelegate(this, this._getOriginalPhoneString$p$0);
  1657. this.$$d__getPhoneString$p$0=Function.createDelegate(this, this._getPhoneString$p$0);
  1658. this._data$p$0=data;
  1659. $h.InitialData._defineReadOnlyProperty$i(this, 'phoneString', this.$$d__getPhoneString$p$0);
  1660. $h.InitialData._defineReadOnlyProperty$i(this, 'originalPhoneString', this.$$d__getOriginalPhoneString$p$0);
  1661. $h.InitialData._defineReadOnlyProperty$i(this, 'type', this.$$d__getPhoneType$p$0);
  1662. }
  1663. $h.PhoneNumber.prototype={
  1664. _data$p$0: null,
  1665. _getPhoneString$p$0: function $h_PhoneNumber$_getPhoneString$p$0() {
  1666. return this._data$p$0['PhoneString'];
  1667. },
  1668. _getOriginalPhoneString$p$0: function $h_PhoneNumber$_getOriginalPhoneString$p$0() {
  1669. return this._data$p$0['OriginalPhoneString'];
  1670. },
  1671. _getPhoneType$p$0: function $h_PhoneNumber$_getPhoneType$p$0() {
  1672. return this._data$p$0['Type'];
  1673. }
  1674. }
  1675. $h.TaskSuggestion=function $h_TaskSuggestion(data) {
  1676. this.$$d__getAssignees$p$0=Function.createDelegate(this, this._getAssignees$p$0);
  1677. this.$$d__getTaskString$p$0=Function.createDelegate(this, this._getTaskString$p$0);
  1678. this._data$p$0=data;
  1679. $h.InitialData._defineReadOnlyProperty$i(this, 'taskString', this.$$d__getTaskString$p$0);
  1680. $h.InitialData._defineReadOnlyProperty$i(this, 'assignees', this.$$d__getAssignees$p$0);
  1681. }
  1682. $h.TaskSuggestion.prototype={
  1683. _data$p$0: null,
  1684. _assignees$p$0: null,
  1685. _getTaskString$p$0: function $h_TaskSuggestion$_getTaskString$p$0() {
  1686. return this._data$p$0['TaskString'];
  1687. },
  1688. _getAssignees$p$0: function $h_TaskSuggestion$_getAssignees$p$0() {
  1689. if (!this._assignees$p$0) {
  1690. var $$t_1=this;
  1691. this._assignees$p$0=$h.Entities._getExtractedObjects$i($h.EmailAddressDetails, this._data$p$0, 'Assignees', function(data) {
  1692. return $h.EmailAddressDetails._createFromEmailUserDictionary$i(data);
  1693. });
  1694. }
  1695. return this._assignees$p$0;
  1696. }
  1697. }
  1698. $h.UserProfile=function $h_UserProfile(data) {
  1699. this.$$d__getTimeZone$p$0=Function.createDelegate(this, this._getTimeZone$p$0);
  1700. this.$$d__getEmailAddress$p$0=Function.createDelegate(this, this._getEmailAddress$p$0);
  1701. this.$$d__getDisplayName$p$0=Function.createDelegate(this, this._getDisplayName$p$0);
  1702. this._data$p$0=data;
  1703. $h.InitialData._defineReadOnlyProperty$i(this, 'displayName', this.$$d__getDisplayName$p$0);
  1704. $h.InitialData._defineReadOnlyProperty$i(this, 'emailAddress', this.$$d__getEmailAddress$p$0);
  1705. $h.InitialData._defineReadOnlyProperty$i(this, 'timeZone', this.$$d__getTimeZone$p$0);
  1706. }
  1707. $h.UserProfile.prototype={
  1708. _data$p$0: null,
  1709. _getDisplayName$p$0: function $h_UserProfile$_getDisplayName$p$0() {
  1710. return this._data$p$0.get__userDisplayName$i$0();
  1711. },
  1712. _getEmailAddress$p$0: function $h_UserProfile$_getEmailAddress$p$0() {
  1713. return this._data$p$0.get__userEmailAddress$i$0();
  1714. },
  1715. _getTimeZone$p$0: function $h_UserProfile$_getTimeZone$p$0() {
  1716. return this._data$p$0.get__userTimeZone$i$0();
  1717. }
  1718. }
  1719. $h.RequestState=function() {}
  1720. $h.RequestState.prototype={
  1721. unsent: 0,
  1722. opened: 1,
  1723. headersReceived: 2,
  1724. loading: 3,
  1725. done: 4
  1726. }
  1727. $h.RequestState.registerEnum('$h.RequestState', false);
  1728. $h.EwsRequest=function $h_EwsRequest(userContext) {
  1729. this.readyState=1;
  1730. $h.EwsRequest.initializeBase(this, [ userContext ]);
  1731. }
  1732. $h.EwsRequest.prototype={
  1733. status: 0,
  1734. statusText: null,
  1735. onreadystatechange: null,
  1736. responseText: null,
  1737. get__statusCode$i$1: function $h_EwsRequest$get__statusCode$i$1() {
  1738. return this.status;
  1739. },
  1740. set__statusCode$i$1: function $h_EwsRequest$set__statusCode$i$1(value) {
  1741. this.status=value;
  1742. return value;
  1743. },
  1744. get__statusDescription$i$1: function $h_EwsRequest$get__statusDescription$i$1() {
  1745. return this.statusText;
  1746. },
  1747. set__statusDescription$i$1: function $h_EwsRequest$set__statusDescription$i$1(value) {
  1748. this.statusText=value;
  1749. return value;
  1750. },
  1751. get__requestState$i$1: function $h_EwsRequest$get__requestState$i$1() {
  1752. return this.readyState;
  1753. },
  1754. set__requestState$i$1: function $h_EwsRequest$set__requestState$i$1(value) {
  1755. this.readyState=value;
  1756. return value;
  1757. },
  1758. get__response$i$1: function $h_EwsRequest$get__response$i$1() {
  1759. return this.responseText;
  1760. },
  1761. set__response$i$1: function $h_EwsRequest$set__response$i$1(value) {
  1762. this.responseText=value;
  1763. return value;
  1764. },
  1765. send: function $h_EwsRequest$send(data) {
  1766. this._checkSendConditions$i$1();
  1767. if ($h.ScriptHelpers.isNullOrUndefined(data)) {
  1768. this._throwInvalidStateException$i$1();
  1769. }
  1770. this._sendRequest$i$0(5, 'EwsRequest', { body: data });
  1771. },
  1772. _callOnReadyStateChangeCallback$i$1: function $h_EwsRequest$_callOnReadyStateChangeCallback$i$1() {
  1773. if (!$h.ScriptHelpers.isNullOrUndefined(this.onreadystatechange)) {
  1774. this.onreadystatechange();
  1775. }
  1776. },
  1777. _parseExtraResponseData$i$1: function $h_EwsRequest$_parseExtraResponseData$i$1(response) {
  1778. }
  1779. }
  1780. $h.InitialData=function $h_InitialData(data) {
  1781. this._data$p$0=data;
  1782. }
  1783. $h.InitialData._defineReadOnlyProperty$i=function $h_InitialData$_defineReadOnlyProperty$i(o, methodName, getter) {
  1784. var propertyDescriptor={ get: getter, configurable: false };
  1785. Object.defineProperty(o, methodName, propertyDescriptor);
  1786. }
  1787. $h.InitialData.prototype={
  1788. _toRecipients$p$0: null,
  1789. _ccRecipients$p$0: null,
  1790. _attachments$p$0: null,
  1791. _resources$p$0: null,
  1792. _entities$p$0: null,
  1793. _data$p$0: null,
  1794. get__permissionLevel$i$0: function $h_InitialData$get__permissionLevel$i$0() {
  1795. var permissionLevel=this._data$p$0['permissionLevel'];
  1796. return (!$h.ScriptHelpers.isUndefined(permissionLevel)) ? permissionLevel : 0;
  1797. },
  1798. get__itemId$i$0: function $h_InitialData$get__itemId$i$0() {
  1799. return this._data$p$0['id'];
  1800. },
  1801. get__itemClass$i$0: function $h_InitialData$get__itemClass$i$0() {
  1802. return this._data$p$0['itemClass'];
  1803. },
  1804. get__dateTimeCreated$i$0: function $h_InitialData$get__dateTimeCreated$i$0() {
  1805. return new Date(this._data$p$0['dateTimeCreated']);
  1806. },
  1807. get__dateTimeModified$i$0: function $h_InitialData$get__dateTimeModified$i$0() {
  1808. return new Date(this._data$p$0['dateTimeModified']);
  1809. },
  1810. get__dateTimeSent$i$0: function $h_InitialData$get__dateTimeSent$i$0() {
  1811. return new Date(this._data$p$0['dateTimeSent']);
  1812. },
  1813. get__subject$i$0: function $h_InitialData$get__subject$i$0() {
  1814. return this._data$p$0['subject'];
  1815. },
  1816. get__normalizedSubject$i$0: function $h_InitialData$get__normalizedSubject$i$0() {
  1817. return this._data$p$0['normalizedSubject'];
  1818. },
  1819. get__internetMessageId$i$0: function $h_InitialData$get__internetMessageId$i$0() {
  1820. return this._data$p$0['internetMessageId'];
  1821. },
  1822. get__conversationId$i$0: function $h_InitialData$get__conversationId$i$0() {
  1823. return this._data$p$0['conversationId'];
  1824. },
  1825. get__sender$i$0: function $h_InitialData$get__sender$i$0() {
  1826. this._throwOnRestrictedPermissionLevel$p$0();
  1827. var sender=this._data$p$0['sender'];
  1828. return ($h.ScriptHelpers.isNullOrUndefined(sender)) ? null : new $h.EmailAddressDetails(sender);
  1829. },
  1830. get__from$i$0: function $h_InitialData$get__from$i$0() {
  1831. this._throwOnRestrictedPermissionLevel$p$0();
  1832. var from=this._data$p$0['from'];
  1833. return ($h.ScriptHelpers.isNullOrUndefined(from)) ? null : new $h.EmailAddressDetails(from);
  1834. },
  1835. get__to$i$0: function $h_InitialData$get__to$i$0() {
  1836. this._throwOnRestrictedPermissionLevel$p$0();
  1837. if (null===this._toRecipients$p$0) {
  1838. this._toRecipients$p$0=this._createEmailAddressDetails$p$0('to');
  1839. }
  1840. return this._toRecipients$p$0;
  1841. },
  1842. get__cc$i$0: function $h_InitialData$get__cc$i$0() {
  1843. this._throwOnRestrictedPermissionLevel$p$0();
  1844. if (null===this._ccRecipients$p$0) {
  1845. this._ccRecipients$p$0=this._createEmailAddressDetails$p$0('cc');
  1846. }
  1847. return this._ccRecipients$p$0;
  1848. },
  1849. get__attachments$i$0: function $h_InitialData$get__attachments$i$0() {
  1850. this._throwOnRestrictedPermissionLevel$p$0();
  1851. if (null===this._attachments$p$0) {
  1852. this._attachments$p$0=this._createAttachmentDetails$p$0();
  1853. }
  1854. return this._attachments$p$0;
  1855. },
  1856. get__ewsUrl$i$0: function $h_InitialData$get__ewsUrl$i$0() {
  1857. return this._data$p$0['ewsUrl'];
  1858. },
  1859. get__start$i$0: function $h_InitialData$get__start$i$0() {
  1860. return new Date(this._data$p$0['start']);
  1861. },
  1862. get__end$i$0: function $h_InitialData$get__end$i$0() {
  1863. return new Date(this._data$p$0['end']);
  1864. },
  1865. get__location$i$0: function $h_InitialData$get__location$i$0() {
  1866. return this._data$p$0['location'];
  1867. },
  1868. get__resources$i$0: function $h_InitialData$get__resources$i$0() {
  1869. this._throwOnRestrictedPermissionLevel$p$0();
  1870. if (null===this._resources$p$0) {
  1871. this._resources$p$0=this._createEmailAddressDetails$p$0('resources');
  1872. }
  1873. return this._resources$p$0;
  1874. },
  1875. get__organizer$i$0: function $h_InitialData$get__organizer$i$0() {
  1876. this._throwOnRestrictedPermissionLevel$p$0();
  1877. var organizer=this._data$p$0['organizer'];
  1878. return ($h.ScriptHelpers.isNullOrUndefined(organizer)) ? null : new $h.EmailAddressDetails(organizer);
  1879. },
  1880. get__userDisplayName$i$0: function $h_InitialData$get__userDisplayName$i$0() {
  1881. return this._data$p$0['userDisplayName'];
  1882. },
  1883. get__userEmailAddress$i$0: function $h_InitialData$get__userEmailAddress$i$0() {
  1884. return this._data$p$0['userEmailAddress'];
  1885. },
  1886. get__userTimeZone$i$0: function $h_InitialData$get__userTimeZone$i$0() {
  1887. return this._data$p$0['userTimeZone'];
  1888. },
  1889. get__timeZoneOffsets$i$0: function $h_InitialData$get__timeZoneOffsets$i$0() {
  1890. return this._data$p$0['timeZoneOffsets'];
  1891. },
  1892. get__hostVersion$i$0: function $h_InitialData$get__hostVersion$i$0() {
  1893. return this._data$p$0['hostVersion'];
  1894. },
  1895. get__owaView$i$0: function $h_InitialData$get__owaView$i$0() {
  1896. return this._data$p$0['owaView'];
  1897. },
  1898. _getEntities$i$0: function $h_InitialData$_getEntities$i$0() {
  1899. if (!this._entities$p$0) {
  1900. this._entities$p$0=new $h.Entities(this._data$p$0['entities'], this._data$p$0['filteredEntities'], this.get__dateTimeSent$i$0(), this.get__permissionLevel$i$0());
  1901. }
  1902. return this._entities$p$0;
  1903. },
  1904. _getEntitiesByType$i$0: function $h_InitialData$_getEntitiesByType$i$0(entityType) {
  1905. var entites=this._getEntities$i$0();
  1906. return entites._getByType$i$0(entityType);
  1907. },
  1908. _getFilteredEntitiesByName$i$0: function $h_InitialData$_getFilteredEntitiesByName$i$0(name) {
  1909. var entities=this._getEntities$i$0();
  1910. return entities._getFilteredEntitiesByName$i$0(name);
  1911. },
  1912. _getRegExMatches$i$0: function $h_InitialData$_getRegExMatches$i$0() {
  1913. if (!this._data$p$0['regExMatches']) {
  1914. return null;
  1915. }
  1916. return this._data$p$0['regExMatches'];
  1917. },
  1918. _getRegExMatchesByName$i$0: function $h_InitialData$_getRegExMatchesByName$i$0(regexName) {
  1919. var regexMatches=this._getRegExMatches$i$0();
  1920. if (!regexMatches || !regexMatches[regexName]) {
  1921. return null;
  1922. }
  1923. return regexMatches[regexName];
  1924. },
  1925. _createEmailAddressDetails$p$0: function $h_InitialData$_createEmailAddressDetails$p$0(key) {
  1926. var to=this._data$p$0[key];
  1927. if ($h.ScriptHelpers.isNullOrUndefined(to)) {
  1928. return [];
  1929. }
  1930. var recipients=[];
  1931. for (var i=0; i < to.length; i++) {
  1932. if (!$h.ScriptHelpers.isNullOrUndefined(to[i])) {
  1933. recipients[i]=new $h.EmailAddressDetails(to[i]);
  1934. }
  1935. }
  1936. return recipients;
  1937. },
  1938. _createAttachmentDetails$p$0: function $h_InitialData$_createAttachmentDetails$p$0() {
  1939. var attachments=this._data$p$0['attachments'];
  1940. if ($h.ScriptHelpers.isNullOrUndefined(attachments)) {
  1941. return [];
  1942. }
  1943. var attachmentDetails=[];
  1944. for (var i=0; i < attachments.length; i++) {
  1945. if (!$h.ScriptHelpers.isNullOrUndefined(attachments[i])) {
  1946. attachmentDetails[i]=new $h.AttachmentDetails(attachments[i]);
  1947. }
  1948. }
  1949. return attachmentDetails;
  1950. },
  1951. _throwOnRestrictedPermissionLevel$p$0: function $h_InitialData$_throwOnRestrictedPermissionLevel$p$0() {
  1952. OSF.DDA.OutlookAppOm._throwOnPropertyAccessForRestrictedPermission$i(this.get__permissionLevel$i$0());
  1953. }
  1954. }
  1955. $h._loadDictionaryRequest=function $h__loadDictionaryRequest(createResultObject, dictionaryName, callback, userContext) {
  1956. $h._loadDictionaryRequest.initializeBase(this, [ userContext ]);
  1957. this._createResultObject$p$1=createResultObject;
  1958. this._dictionaryName$p$1=dictionaryName;
  1959. this._callback$p$1=callback;
  1960. }
  1961. $h._loadDictionaryRequest.prototype={
  1962. _dictionaryName$p$1: null,
  1963. _createResultObject$p$1: null,
  1964. _callback$p$1: null,
  1965. handleResponse: function $h__loadDictionaryRequest$handleResponse(response) {
  1966. if (response['wasSuccessful']) {
  1967. var value=response[this._dictionaryName$p$1];
  1968. var responseData=JSON.parse(value);
  1969. this.createAsyncResult(this._createResultObject$p$1(responseData), 0, null);
  1970. }
  1971. else {
  1972. this.createAsyncResult(null, 1, response['errorMessage']);
  1973. }
  1974. this._callback$p$1(this._asyncResult$p$0);
  1975. }
  1976. }
  1977. $h.ProxyRequestBase=function $h_ProxyRequestBase(userContext) {
  1978. $h.ProxyRequestBase.initializeBase(this, [ userContext ]);
  1979. }
  1980. $h.ProxyRequestBase.prototype={
  1981. handleResponse: function $h_ProxyRequestBase$handleResponse(response) {
  1982. if (!(response['wasProxySuccessful'])) {
  1983. this.set__statusCode$i$1(500);
  1984. this.set__statusDescription$i$1('Error');
  1985. var errorMessage=response['errorMessage'];
  1986. this.set__response$i$1(errorMessage);
  1987. this.createAsyncResult(null, 1, errorMessage);
  1988. }
  1989. else {
  1990. this.set__statusCode$i$1(response['statusCode']);
  1991. this.set__statusDescription$i$1(response['statusDescription']);
  1992. this.set__response$i$1(response['body']);
  1993. this.createAsyncResult(this.get__response$i$1(), 0, null);
  1994. }
  1995. this._parseExtraResponseData$i$1(response);
  1996. this._cycleReadyStateFromHeadersReceivedToLoadingToDone$i$1();
  1997. },
  1998. _throwInvalidStateException$i$1: function $h_ProxyRequestBase$_throwInvalidStateException$i$1() {
  1999. throw Error.create('DOMException', { code: 11, message: 'INVALID_STATE_ERR' });
  2000. },
  2001. _cycleReadyStateFromHeadersReceivedToLoadingToDone$i$1: function $h_ProxyRequestBase$_cycleReadyStateFromHeadersReceivedToLoadingToDone$i$1() {
  2002. var $$t_0=this;
  2003. this._changeReadyState$i$1(2, function() {
  2004. $$t_0._changeReadyState$i$1(3, function() {
  2005. $$t_0._changeReadyState$i$1(4, null);
  2006. });
  2007. });
  2008. },
  2009. _changeReadyState$i$1: function $h_ProxyRequestBase$_changeReadyState$i$1(state, nextStep) {
  2010. this.set__requestState$i$1(state);
  2011. var $$t_2=this;
  2012. window.setTimeout(function() {
  2013. try {
  2014. $$t_2._callOnReadyStateChangeCallback$i$1();
  2015. }
  2016. finally {
  2017. if (!$h.ScriptHelpers.isNullOrUndefined(nextStep)) {
  2018. nextStep();
  2019. }
  2020. }
  2021. }, 0);
  2022. },
  2023. _checkSendConditions$i$1: function $h_ProxyRequestBase$_checkSendConditions$i$1() {
  2024. if (this.get__requestState$i$1() !==1) {
  2025. this._throwInvalidStateException$i$1();
  2026. }
  2027. if (this._isSent$p$0) {
  2028. this._throwInvalidStateException$i$1();
  2029. }
  2030. }
  2031. }
  2032. $h.RequestBase=function $h_RequestBase(userContext) {
  2033. this._userContext$p$0=userContext;
  2034. }
  2035. $h.RequestBase.prototype={
  2036. _isSent$p$0: false,
  2037. _asyncResult$p$0: null,
  2038. _userContext$p$0: null,
  2039. _sendRequest$i$0: function $h_RequestBase$_sendRequest$i$0(dispid, methodName, dataToSend) {
  2040. this._isSent$p$0=true;
  2041. var $$t_5=this;
  2042. OSF.DDA.OutlookAppOm._instance$p._invokeHostMethod$i$0(dispid, methodName, dataToSend, function(resultCode, response) {
  2043. if (resultCode) {
  2044. $$t_5.createAsyncResult(null, 1, String.format(_u.ExtensibilityStrings.l_InternalProtocolError_Text, resultCode));
  2045. }
  2046. else {
  2047. $$t_5.handleResponse(response);
  2048. }
  2049. });
  2050. },
  2051. createAsyncResult: function $h_RequestBase$createAsyncResult(value, errorCode, errorDescription) {
  2052. this._asyncResult$p$0=OSF.DDA.OutlookAppOm._createAsyncResult$i(value, errorCode, errorDescription, this._userContext$p$0);
  2053. }
  2054. }
  2055. $h._saveDictionaryRequest=function $h__saveDictionaryRequest(callback, userContext) {
  2056. $h._saveDictionaryRequest.initializeBase(this, [ userContext ]);
  2057. if (!$h.ScriptHelpers.isNullOrUndefined(callback)) {
  2058. this._callback$p$1=callback;
  2059. }
  2060. }
  2061. $h._saveDictionaryRequest.prototype={
  2062. _callback$p$1: null,
  2063. handleResponse: function $h__saveDictionaryRequest$handleResponse(response) {
  2064. if (response['wasSuccessful']) {
  2065. this.createAsyncResult(null, 0, null);
  2066. }
  2067. else {
  2068. this.createAsyncResult(null, 1, response['errorMessage']);
  2069. }
  2070. if (!$h.ScriptHelpers.isNullOrUndefined(this._callback$p$1)) {
  2071. this._callback$p$1(this._asyncResult$p$0);
  2072. }
  2073. }
  2074. }
  2075. $h.ScriptHelpers=function $h_ScriptHelpers() {
  2076. }
  2077. $h.ScriptHelpers.isNull=function $h_ScriptHelpers$isNull(value) {
  2078. return null===value;
  2079. }
  2080. $h.ScriptHelpers.isNullOrUndefined=function $h_ScriptHelpers$isNullOrUndefined(value) {
  2081. return $h.ScriptHelpers.isNull(value) || $h.ScriptHelpers.isUndefined(value);
  2082. }
  2083. $h.ScriptHelpers.isUndefined=function $h_ScriptHelpers$isUndefined(value) {
  2084. return value===undefined;
  2085. }
  2086. $h.ScriptHelpers.dictionaryContainsKey=function $h_ScriptHelpers$dictionaryContainsKey(obj, keyName) {
  2087. return (Object.isInstanceOfType(obj)) ? keyName in obj : false;
  2088. }
  2089. OSF.DDA.OutlookAppOm.registerClass('OSF.DDA.OutlookAppOm');
  2090. OSF.DDA.Settings.registerClass('OSF.DDA.Settings');
  2091. $h.Item.registerClass('$h.Item');
  2092. $h.Appointment.registerClass('$h.Appointment', $h.Item);
  2093. $h.AttachmentDetails.registerClass('$h.AttachmentDetails');
  2094. $h.Contact.registerClass('$h.Contact');
  2095. $h.CustomProperties.registerClass('$h.CustomProperties');
  2096. $h.Diagnostics.registerClass('$h.Diagnostics');
  2097. $h.EmailAddressDetails.registerClass('$h.EmailAddressDetails');
  2098. $h.Entities.registerClass('$h.Entities');
  2099. $h.Message.registerClass('$h.Message', $h.Item);
  2100. $h.MeetingRequest.registerClass('$h.MeetingRequest', $h.Message);
  2101. $h.MeetingSuggestion.registerClass('$h.MeetingSuggestion');
  2102. $h.MeetingSuggestionTimeDecoder.registerClass('$h.MeetingSuggestionTimeDecoder');
  2103. $h._extractedDate.registerClass('$h._extractedDate');
  2104. $h._preciseDate.registerClass('$h._preciseDate', $h._extractedDate);
  2105. $h._relativeDate.registerClass('$h._relativeDate', $h._extractedDate);
  2106. $h.PhoneNumber.registerClass('$h.PhoneNumber');
  2107. $h.TaskSuggestion.registerClass('$h.TaskSuggestion');
  2108. $h.UserProfile.registerClass('$h.UserProfile');
  2109. $h.RequestBase.registerClass('$h.RequestBase');
  2110. $h.ProxyRequestBase.registerClass('$h.ProxyRequestBase', $h.RequestBase);
  2111. $h.EwsRequest.registerClass('$h.EwsRequest', $h.ProxyRequestBase);
  2112. $h.InitialData.registerClass('$h.InitialData');
  2113. $h._loadDictionaryRequest.registerClass('$h._loadDictionaryRequest', $h.RequestBase);
  2114. $h._saveDictionaryRequest.registerClass('$h._saveDictionaryRequest', $h.RequestBase);
  2115. $h.ScriptHelpers.registerClass('$h.ScriptHelpers');
  2116. OSF.DDA.OutlookAppOm._maxRecipients$p=100;
  2117. OSF.DDA.OutlookAppOm._maxSubjectLength$p=255;
  2118. OSF.DDA.OutlookAppOm._maxBodyLength$p=32768;
  2119. OSF.DDA.OutlookAppOm._maxLocationLength$p=255;
  2120. OSF.DDA.OutlookAppOm._maxEwsRequestSize$p=1000000;
  2121. OSF.DDA.OutlookAppOm._instance$p=null;
  2122. $h.AttachmentDetails._attachmentTypeMap$p=[ Microsoft.Office.WebExtension.MailboxEnums.AttachmentType.File, Microsoft.Office.WebExtension.MailboxEnums.AttachmentType.Item ];
  2123. $h.Diagnostics.outlookAppName='Outlook';
  2124. $h.Diagnostics.outlookWebAppName='OutlookWebApp';
  2125. $h.EmailAddressDetails._emptyString$p='';
  2126. $h.EmailAddressDetails._responseTypeMap$p=[ Microsoft.Office.WebExtension.MailboxEnums.ResponseType.None, Microsoft.Office.WebExtension.MailboxEnums.ResponseType.Organizer, Microsoft.Office.WebExtension.MailboxEnums.ResponseType.Tentative, Microsoft.Office.WebExtension.MailboxEnums.ResponseType.Accepted, Microsoft.Office.WebExtension.MailboxEnums.ResponseType.Declined ];
  2127. $h.EmailAddressDetails._recipientTypeMap$p=[ Microsoft.Office.WebExtension.MailboxEnums.RecipientType.Other, Microsoft.Office.WebExtension.MailboxEnums.RecipientType.DistributionList, Microsoft.Office.WebExtension.MailboxEnums.RecipientType.User, Microsoft.Office.WebExtension.MailboxEnums.RecipientType.ExternalUser ];
  2128. $h.Entities._allEntityKeys$p=[ 'Addresses', 'EmailAddresses', 'Urls', 'PhoneNumbers', 'TaskSuggestions', 'MeetingSuggestions', 'Contacts' ];
  2129. $h.MeetingSuggestionTimeDecoder._baseDate$p=new Date('0001-01-01T00:00:00Z');
  2130. $h.ScriptHelpers.emptyString='';
  2131. OSF.ClientMode={
  2132. ReadWrite: 0,
  2133. ReadOnly: 1
  2134. }
  2135. OSF.DDA.RichInitializationReason={
  2136. 1: Microsoft.Office.WebExtension.InitializationReason.Inserted,
  2137. 2: Microsoft.Office.WebExtension.InitializationReason.DocumentOpened
  2138. };
  2139. Microsoft.Office.WebExtension.FileType={
  2140. Text: "text",
  2141. Compressed: "compressed"
  2142. };
  2143. OSF.DDA.RichClientSettingsManager={
  2144. read: function OSF_DDA_RichClientSettingsManager$Read(onCalling, onReceiving) {
  2145. var keys=[];
  2146. var values=[];
  2147. if (onCalling) {
  2148. onCalling();
  2149. }
  2150. window.external.GetContext().GetSettings().Read(keys, values);
  2151. if (onReceiving) {
  2152. onReceiving();
  2153. }
  2154. var serializedSettings={};
  2155. for (var index=0; index < keys.length; index++) {
  2156. serializedSettings[keys[index]]=values[index];
  2157. }
  2158. return serializedSettings;
  2159. },
  2160. write: function OSF_DDA_RichClientSettingsManager$Write(serializedSettings, overwriteIfStale, onCalling, onReceiving) {
  2161. var keys=[];
  2162. var values=[];
  2163. for (var key in serializedSettings) {
  2164. keys.push(key);
  2165. values.push(serializedSettings[key]);
  2166. }
  2167. if (onCalling) {
  2168. onCalling();
  2169. }
  2170. window.external.GetContext().GetSettings().Write(keys, values);
  2171. if (onReceiving) {
  2172. onReceiving();
  2173. }
  2174. }
  2175. };
  2176. OSF.DDA.DispIdHost.getRichClientDelegateMethods=function (actionId) {
  2177. var delegateMethods={};
  2178. delegateMethods[OSF.DDA.DispIdHost.Delegates.ExecuteAsync]=OSF.DDA.SafeArray.Delegate.executeAsync;
  2179. delegateMethods[OSF.DDA.DispIdHost.Delegates.RegisterEventAsync]=OSF.DDA.SafeArray.Delegate.registerEventAsync;
  2180. delegateMethods[OSF.DDA.DispIdHost.Delegates.UnregisterEventAsync]=OSF.DDA.SafeArray.Delegate.unregisterEventAsync;
  2181. function getSettingsExecuteMethod(hostDelegateMethod) {
  2182. return function (args) {
  2183. var status, response;
  2184. try {
  2185. response=hostDelegateMethod(args.hostCallArgs, args.onCalling, args.onReceiving);
  2186. status=OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess;
  2187. } catch (ex) {
  2188. status=OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError;
  2189. response={ name : Strings.OfficeOM.L_InternalError, message : ex };
  2190. }
  2191. if (args.onComplete) {
  2192. args.onComplete(status, response);
  2193. }
  2194. };
  2195. }
  2196. function readSerializedSettings(hostCallArgs, onCalling, onReceiving) {
  2197. return OSF.DDA.RichClientSettingsManager.read(onCalling, onReceiving);
  2198. }
  2199. function writeSerializedSettings(hostCallArgs, onCalling, onReceiving) {
  2200. return OSF.DDA.RichClientSettingsManager.write(
  2201. hostCallArgs[OSF.DDA.SettingsManager.SerializedSettings],
  2202. hostCallArgs[Microsoft.Office.WebExtension.Parameters.OverwriteIfStale],
  2203. onCalling,
  2204. onReceiving
  2205. );
  2206. }
  2207. switch (actionId) {
  2208. case OSF.DDA.AsyncMethodNames.RefreshAsync.id:
  2209. delegateMethods[OSF.DDA.DispIdHost.Delegates.ExecuteAsync]=getSettingsExecuteMethod(readSerializedSettings);
  2210. break;
  2211. case OSF.DDA.AsyncMethodNames.SaveAsync.id:
  2212. delegateMethods[OSF.DDA.DispIdHost.Delegates.ExecuteAsync]=getSettingsExecuteMethod(writeSerializedSettings);
  2213. break;
  2214. default:
  2215. break;
  2216. }
  2217. return delegateMethods;
  2218. }
  2219. OSF.DDA.File=function OSF_DDA_File(handle, fileSize, sliceSize) {
  2220. OSF.OUtil.defineEnumerableProperties(this, {
  2221. "size": {
  2222. value: fileSize
  2223. },
  2224. "sliceCount": {
  2225. value: Math.ceil(fileSize / sliceSize)
  2226. }
  2227. });
  2228. var privateState={};
  2229. privateState[OSF.DDA.FileProperties.Handle]=handle;
  2230. privateState[OSF.DDA.FileProperties.SliceSize]=sliceSize;
  2231. var am=OSF.DDA.AsyncMethodNames;
  2232. OSF.DDA.DispIdHost.addAsyncMethods(
  2233. this, [
  2234. am.GetDocumentCopyChunkAsync,
  2235. am.ReleaseDocumentCopyAsync
  2236. ],
  2237. privateState
  2238. );
  2239. }
  2240. OSF.DDA.FileSliceOffset="fileSliceoffset";
  2241. OSF.DDA.CustomXmlParts=function OSF_DDA_CustomXmlParts() {
  2242. this._eventDispatches=[];
  2243. var am=OSF.DDA.AsyncMethodNames;
  2244. OSF.DDA.DispIdHost.addAsyncMethods(this, [
  2245. am.AddDataPartAsync,
  2246. am.GetDataPartByIdAsync,
  2247. am.GetDataPartsByNameSpaceAsync
  2248. ]);
  2249. };
  2250. OSF.DDA.CustomXmlPart=function OSF_DDA_CustomXmlPart(customXmlParts, id, builtIn) {
  2251. OSF.OUtil.defineEnumerableProperties(this, {
  2252. "builtIn": {
  2253. value: builtIn
  2254. },
  2255. "id": {
  2256. value: id
  2257. },
  2258. "namespaceManager": {
  2259. value: new OSF.DDA.CustomXmlPrefixMappings(id)
  2260. }
  2261. });
  2262. var am=OSF.DDA.AsyncMethodNames;
  2263. OSF.DDA.DispIdHost.addAsyncMethods(this, [
  2264. am.DeleteDataPartAsync,
  2265. am.GetPartNodesAsync,
  2266. am.GetPartXmlAsync
  2267. ]);
  2268. var customXmlPartEventDispatches=customXmlParts._eventDispatches;
  2269. var dispatch=customXmlPartEventDispatches[id];
  2270. if (!dispatch) {
  2271. var et=Microsoft.Office.WebExtension.EventType;
  2272. dispatch=new OSF.EventDispatch([
  2273. et.DataNodeDeleted,
  2274. et.DataNodeInserted,
  2275. et.DataNodeReplaced
  2276. ]);
  2277. customXmlPartEventDispatches[id]=dispatch;
  2278. }
  2279. OSF.DDA.DispIdHost.addEventSupport(this, dispatch);
  2280. };
  2281. OSF.DDA.CustomXmlPrefixMappings=function OSF_DDA_CustomXmlPrefixMappings(partId) {
  2282. var am=OSF.DDA.AsyncMethodNames;
  2283. OSF.DDA.DispIdHost.addAsyncMethods(
  2284. this,
  2285. [
  2286. am.AddDataPartNamespaceAsync,
  2287. am.GetDataPartNamespaceAsync,
  2288. am.GetDataPartPrefixAsync
  2289. ],
  2290. partId
  2291. );
  2292. };
  2293. OSF.DDA.CustomXmlNode=function OSF_DDA_CustomXmlNode(handle, nodeType, ns, baseName) {
  2294. OSF.OUtil.defineEnumerableProperties(this, {
  2295. "baseName": {
  2296. value: baseName
  2297. },
  2298. "namespaceUri": {
  2299. value: ns
  2300. },
  2301. "nodeType": {
  2302. value: nodeType
  2303. }
  2304. });
  2305. var am=OSF.DDA.AsyncMethodNames;
  2306. OSF.DDA.DispIdHost.addAsyncMethods(
  2307. this,
  2308. [
  2309. am.GetRelativeNodesAsync,
  2310. am.GetNodeValueAsync,
  2311. am.GetNodeXmlAsync,
  2312. am.SetNodeValueAsync,
  2313. am.SetNodeXmlAsync
  2314. ],
  2315. handle
  2316. );
  2317. };
  2318. OSF.DDA.NodeInsertedEventArgs=function OSF_DDA_NodeInsertedEventArgs(newNode, inUndoRedo) {
  2319. OSF.OUtil.defineEnumerableProperties(this, {
  2320. "type": {
  2321. value: Microsoft.Office.WebExtension.EventType.DataNodeInserted
  2322. },
  2323. "newNode": {
  2324. value: newNode
  2325. },
  2326. "inUndoRedo": {
  2327. value: inUndoRedo
  2328. }
  2329. });
  2330. };
  2331. OSF.DDA.NodeReplacedEventArgs=function OSF_DDA_NodeReplacedEventArgs(oldNode, newNode, inUndoRedo) {
  2332. OSF.OUtil.defineEnumerableProperties(this, {
  2333. "type": {
  2334. value: Microsoft.Office.WebExtension.EventType.DataNodeReplaced
  2335. },
  2336. "oldNode": {
  2337. value: oldNode
  2338. },
  2339. "newNode": {
  2340. value: newNode
  2341. },
  2342. "inUndoRedo": {
  2343. value: inUndoRedo
  2344. }
  2345. });
  2346. };
  2347. OSF.DDA.NodeDeletedEventArgs=function OSF_DDA_NodeDeletedEventArgs(oldNode, oldNextSibling, inUndoRedo) {
  2348. OSF.OUtil.defineEnumerableProperties(this, {
  2349. "type": {
  2350. value: Microsoft.Office.WebExtension.EventType.DataNodeDeleted
  2351. },
  2352. "oldNode": {
  2353. value: oldNode
  2354. },
  2355. "oldNextSibling": {
  2356. value: oldNextSibling
  2357. },
  2358. "inUndoRedo": {
  2359. value: inUndoRedo
  2360. }
  2361. });
  2362. };