"use strict"; var CloudExperienceHost; (function (CloudExperienceHost) { function getUserPreferredColors() { var userPreferredColors = {}; userPreferredColors.controlDarkLinkRest = CloudExperienceHost.Styling.getHexStringFromColor(CloudExperienceHostAPI.UserColorPreference.UserPreferredColors.controlDarkLinkRest); userPreferredColors.controlDarkLinkHover = CloudExperienceHost.Styling.getHexStringFromColor(CloudExperienceHostAPI.UserColorPreference.UserPreferredColors.controlDarkLinkHover); userPreferredColors.controlDarkLinkPressed = CloudExperienceHost.Styling.getHexStringFromColor(CloudExperienceHostAPI.UserColorPreference.UserPreferredColors.controlDarkLinkPressed); userPreferredColors.controlDarkSelectHighlightSelectedHover = CloudExperienceHost.Styling.getHexStringFromColor(CloudExperienceHostAPI.UserColorPreference.UserPreferredColors.controlDarkSelectHighlightSelectedHover); userPreferredColors.controlDarkSelectHighlightSelected = CloudExperienceHost.Styling.getHexStringFromColor(CloudExperienceHostAPI.UserColorPreference.UserPreferredColors.controlDarkSelectHighlightSelected); userPreferredColors.controlDefaultDarkButtonBackgroundRest = CloudExperienceHost.Styling.getHexStringFromColor(CloudExperienceHostAPI.UserColorPreference.UserPreferredColors.controlDefaultDarkButtonBackgroundRest); userPreferredColors.controlDefaultDarkButtonBackgroundHover = CloudExperienceHost.Styling.getHexStringFromColor(CloudExperienceHostAPI.UserColorPreference.UserPreferredColors.controlDefaultDarkButtonBackgroundHover); userPreferredColors.saturatedBackground = CloudExperienceHost.Styling.getHexStringFromColor(CloudExperienceHostAPI.UserColorPreference.UserPreferredColors.saturatedBackground); userPreferredColors.controlDarkSelectPopupBackgroundSelected = CloudExperienceHost.Styling.getHexStringFromColor(CloudExperienceHostAPI.UserColorPreference.UserPreferredColors.controlDarkSelectPopupBackgroundSelected); userPreferredColors.saturatedInlineErrorText = CloudExperienceHost.Styling.getHexStringFromColor(CloudExperienceHostAPI.UserColorPreference.UserPreferredColors.saturatedInlineErrorText); userPreferredColors.saturatedSecondaryText = CloudExperienceHost.Styling.getHexStringFromColor(CloudExperienceHostAPI.UserColorPreference.UserPreferredColors.saturatedSecondaryText); userPreferredColors.saturatedSelectionBackground = CloudExperienceHost.Styling.getHexStringFromColor(CloudExperienceHostAPI.UserColorPreference.UserPreferredColors.saturatedSelectionBackground); return JSON.stringify(userPreferredColors); } CloudExperienceHost.getUserPreferredColors = getUserPreferredColors; var InputSwitchButton = (function () { function InputSwitchButton() { } return InputSwitchButton; })(); CloudExperienceHost.InputSwitchButton = InputSwitchButton; var EaseOfAccessControl = (function () { function EaseOfAccessControl() { } return EaseOfAccessControl; })(); CloudExperienceHost.EaseOfAccessControl = EaseOfAccessControl; function shouldShowInputSwitchButton() { if (InputSwitchButton.hasBeenChecked) { return InputSwitchButton.shouldShow; } else { var inputSwitchControl = new CloudExperienceHostAPI.InputSwitchControl(); InputSwitchButton.shouldShow = inputSwitchControl.shouldShowButton; InputSwitchButton.hasBeenChecked = true; return InputSwitchButton.shouldShow; } } CloudExperienceHost.shouldShowInputSwitchButton = shouldShowInputSwitchButton; function showInputSwitchFlyout(left, top, right, bottom) { return new WinJS.Promise(function (completeDispatch, errorDispatch, progressDispatch) { var inputSwitchControl = new CloudExperienceHostAPI.InputSwitchControl(); var rect = { height: bottom - top, width: right - left, x: left, y: top }; inputSwitchControl.showFlyoutAsync(rect) .done(function () { completeDispatch(); }, function (err) { errorDispatch(err); }, function (progress) { progressDispatch(progress); }); }); } CloudExperienceHost.showInputSwitchFlyout = showInputSwitchFlyout; function shouldShowEaseOfAccessControl() { if (!EaseOfAccessControl.hasBeenChecked) { var easeOfAccessControl = new CloudExperienceHostAPI.Accessibility.EaseOfAccessControl(); EaseOfAccessControl.shouldShow = easeOfAccessControl.shouldShow; EaseOfAccessControl.hasBeenChecked = true; } return EaseOfAccessControl.shouldShow; } CloudExperienceHost.shouldShowEaseOfAccessControl = shouldShowEaseOfAccessControl; function showEaseOfAccessFlyout(boundingRectOfEOAButton) { return new WinJS.Promise(function (completeDispatch, errorDispatch, progressDispatch) { if (boundingRectOfEOAButton) { var easeOfAccessControl = new CloudExperienceHostAPI.Accessibility.EaseOfAccessControl(); var rect = { height: boundingRectOfEOAButton.bottom - boundingRectOfEOAButton.top, width: boundingRectOfEOAButton.right - boundingRectOfEOAButton.left, x: boundingRectOfEOAButton.left, y: boundingRectOfEOAButton.top }; easeOfAccessControl.show(rect); completeDispatch(); } else { errorDispatch(new CloudExperienceHost.InvalidArgumentError("Missing bounding rectangle info")); } }); } CloudExperienceHost.showEaseOfAccessFlyout = showEaseOfAccessFlyout; function getAllowedIdentityProviders() { var allowedProviders = CloudExperienceHostAPI.SignInIdentities.allowedProviders; var listOfallowedproviders = []; var signInProvidersflag = CloudExperienceHostAPI.SignInIdentityProviders; if (allowedProviders & signInProvidersflag.local) { listOfallowedproviders.push(CloudExperienceHost.SignInIdentityProviders.Local); } if (allowedProviders & signInProvidersflag.msa) { listOfallowedproviders.push(CloudExperienceHost.SignInIdentityProviders.MSA); } if (allowedProviders & signInProvidersflag.aad) { listOfallowedproviders.push(CloudExperienceHost.SignInIdentityProviders.AAD); } return listOfallowedproviders; } CloudExperienceHost.getAllowedIdentityProviders = getAllowedIdentityProviders; })(CloudExperienceHost || (CloudExperienceHost = {}));