public async Task Map(ApplicationModel source, PageViewModel destination)
        {
            if (destination == null)
            {
                return;
            }

            destination.LayoutName      = $"{Constants.LayoutPrefix}{source?.AppRegistrationModel.Layout.ToString()}";
            destination.Path            = source?.AppRegistrationModel.Path;
            destination.PageTitle       = source?.AppRegistrationModel.TopNavigationText;
            destination.PhaseBannerHtml = new HtmlString(source?.AppRegistrationModel.PhaseBannerHtml);

            var pageRegionContentModels = source?.AppRegistrationModel?.Regions
                                          .Select(region => new PageRegionContentModel {
                PageRegionType = region.PageRegion
            }).ToList();

            destination.PageRegionContentModels = pageRegionContentModels;

            var shellAppRegistrationModel = await appRegistryDataService.GetShellAppRegistrationModel().ConfigureAwait(false);

            if (shellAppRegistrationModel != null)
            {
                if (source?.AppRegistrationModel?.CssScriptNames != null && source.AppRegistrationModel.CssScriptNames.Any())
                {
                    foreach (var key in source.AppRegistrationModel.CssScriptNames.Keys)
                    {
                        var value = source.AppRegistrationModel.CssScriptNames[key];

                        var fullPathname = key.StartsWith("/", StringComparison.Ordinal) ? shellAppRegistrationModel.CdnLocation + key : key;

                        destination.VersionedPathForCssScripts.Add($"{fullPathname}?{value}");
                    }
                }
                if (source?.AppRegistrationModel?.JavaScriptNames != null && source.AppRegistrationModel.JavaScriptNames.Any())
                {
                    foreach (var key in source.AppRegistrationModel.JavaScriptNames.Keys)
                    {
                        var value = source.AppRegistrationModel.JavaScriptNames[key];

                        var fullPathname = key.StartsWith("/", StringComparison.Ordinal) ? shellAppRegistrationModel.CdnLocation + key : key;

                        destination.VersionedPathForJavaScripts.Add($"{fullPathname}?{value}");
                    }
                }
            }
        }
        public VersionedFiles(WebchatOptions webchatOptions, IAppRegistryDataService appRegistryDataService)
        {
            _ = webchatOptions ?? throw new ArgumentNullException(nameof(webchatOptions));
            _ = appRegistryDataService ?? throw new ArgumentNullException(nameof(appRegistryDataService));

            var shellAppRegistrationModel = appRegistryDataService.GetShellAppRegistrationModel().Result;

            if (shellAppRegistrationModel?.CssScriptNames != null && shellAppRegistrationModel.CssScriptNames.Any())
            {
                foreach (var key in shellAppRegistrationModel.CssScriptNames.Keys)
                {
                    var value        = shellAppRegistrationModel.CssScriptNames[key];
                    var fullPathname = key.StartsWith("/", StringComparison.Ordinal) ? shellAppRegistrationModel.CdnLocation + key : key;

                    VersionedPathForCssScripts.Add($"{fullPathname}?{value}");
                }
            }

            if (shellAppRegistrationModel?.JavaScriptNames != null && shellAppRegistrationModel.JavaScriptNames.Any())
            {
                foreach (var key in shellAppRegistrationModel.JavaScriptNames.Keys)
                {
                    var value = shellAppRegistrationModel.JavaScriptNames[key];

                    if (key.Equals(webchatOptions.ScriptUrl, StringComparison.OrdinalIgnoreCase))
                    {
                        VersionedPathForWebChatJs = $"{key}?{value}";
                    }
                    else
                    {
                        var fullPathname = key.StartsWith("/", StringComparison.Ordinal) ? shellAppRegistrationModel.CdnLocation + key : key;

                        VersionedPathForJavaScripts.Add($"{fullPathname}?{value}");
                    }
                }
            }

            if (webchatOptions.Enabled)
            {
                WebchatEnabled = webchatOptions.Enabled;
            }
        }