<commit_before># This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
from django.conf import settings
from django.urls import path, re_path

import bedrock.releasenotes.views
from bedrock.firefox import views
from bedrock.mozorg.util import page
from bedrock.releasenotes import version_re
from bedrock.utils import views as utils_views
from bedrock.utils.views import VariationTemplateView

latest_re = r"^firefox(?:/(?P<version>%s))?/%s/$"
firstrun_re = latest_re % (version_re, "firstrun")
whatsnew_re = latest_re % (version_re, "whatsnew")
platform_re = "(?P<platform>android|ios)"
channel_re = "(?P<channel>beta|aurora|developer|nightly|organizations)"
releasenotes_re = latest_re % (version_re, r"(aurora|release)notes")
android_releasenotes_re = releasenotes_re.replace(r"firefox", "firefox/android")
ios_releasenotes_re = releasenotes_re.replace(r"firefox", "firefox/ios")
sysreq_re = latest_re % (version_re, "system-requirements")
android_sysreq_re = sysreq_re.replace(r"firefox", "firefox/android")
ios_sysreq_re = sysreq_re.replace(r"firefox", "firefox/ios")


urlpatterns = (
    path("firefox/", views.FirefoxHomeView.as_view(), name="firefox"),
    path("firefox/all/", views.firefox_all, name="firefox.all"),
    page("firefox/accounts", "firefox/accounts.html", ftl_files=["firefox/accounts"]),
    page("firefox/browsers", "firefox/browsers/index.html", ftl_files=["firefox/browsers"]),
    page("firefox/products", "firefox/products/index.html", ftl_files=["firefox/products"]),
    page("firefox/flashback", "firefox/flashback/index.html", active_locales=["en-US", "de", "fr"]),
    page("firefox/channel/desktop", "firefox/channel/desktop.html", ftl_files=["firefox/channel"]),
    page("firefox/channel/android", "firefox/channel/android.html", ftl_files=["firefox/channel"]),
    page("firefox/channel/ios", "firefox/channel/ios.html", ftl_files=["firefox/channel"]),
    page("firefox/developer", "firefox/developer/index.html", ftl_files=["firefox/developer"]),
    page("firefox/enterprise", "firefox/enterprise/index.html", ftl_files=["firefox/enterprise"]),
    page("firefox/facebookcontainer", "firefox/facebookcontainer/index.html", ftl_files=["firefox/facebook_container"]),
    page("firefox/features", "firefox/features/index.html", ftl_files=["firefox/features/shared", "firefox/features/index"]),
    page("firefox/features/adblocker", "firefox/features/adblocker.html", ftl_files=["firefox/features/adblocker"]),
    page("firefox/features/bookmarks", "firefox/features/bookmarks.html", ftl_files=["firefox/features/shared", "firefox/features/bookmarks"]),
    page("firefox/features/fast", "firefox/features/fast.html", ftl_files=["firefox/features/shared", "firefox/features/fast"]),
    page(
        "firefox/features/block-fingerprinting",
        "firefox/features/fingerprinting.html",
        ftl_files=["firefox/features/shared", "firefox/features/fingerprinting"],
    ),
    page("firefox/features/independent", "firefox/features/independent.html", ftl_files=["firefox/features/shared", "firefox/features/independent"]),
    page("firefox/features/memory", "firefox/features/memory.html", ftl_files=["firefox/features/shared", "firefox/features/memory"]),
    page(
        "firefox/features/password-manager",
        "firefox/features/password-manager.html",
        ftl_files=["firefox/features/shared", "firefox/features/password-manager"],
    ),
    page(
        "firefox/features/private-browsing",
        "firefox/features/private-browsing.html",
        ftl_files=["firefox/features/shared", "firefox/features/private-browsing"],
    ),
    page("firefox/features/safebrowser", "firefox/features/safebrowser.html"),
    path("firefox/features/translate/", views.firefox_features_translate, name="firefox.features.translate"),
    page(
        "firefox/features/picture-in-picture",
        "firefox/features/picture-in-picture.html",
        ftl_files=["firefox/features/shared", "firefox/features/picture-in-picture"],
    ),
    path(
        "firefox/features/tips/",
        VariationTemplateView.as_view(
            template_name="firefox/features/tips/tips.html",
            template_context_variations=["picture-in-picture", "eyedropper", "forget"],
        ),
        name="firefox.features.tips",
    ),
    path("firefox/ios/testflight/", views.ios_testflight, name="firefox.ios.testflight"),
    page("firefox/mobile/get-app", "firefox/mobile/get-app.html", ftl_files=["firefox/mobile"]),
    path("firefox/send-to-device-post/", views.send_to_device_ajax, name="firefox.send-to-device-post"),
    page("firefox/unsupported-systems", "firefox/unsupported-systems.html"),
    path("firefox/new/", views.NewView.as_view(), name="firefox.new"),
    path("firefox/download/thanks/", views.DownloadThanksView.as_view(), name="firefox.download.thanks"),
    page("firefox/nightly/firstrun", "firefox/nightly/firstrun.html", ftl_files=["firefox/nightly/firstrun"]),
    path("firefox/installer-help/", views.InstallerHelpView.as_view(), name="firefox.installer-help"),
    re_path(firstrun_re, views.FirstrunView.as_view(), name="firefox.firstrun"),
    re_path(whatsnew_re, views.WhatsnewView.as_view(), name="firefox.whatsnew"),
    # Release notes
    re_path("^firefox/(?:%s/)?(?:%s/)?notes/$" % (platform_re, channel_re), bedrock.releasenotes.views.latest_notes, name="firefox.notes"),
    path("firefox/nightly/notes/feed/", bedrock.releasenotes.views.nightly_feed, name="firefox.nightly.notes.feed"),
    re_path("firefox/(?:latest/)?releasenotes/$", bedrock.releasenotes.views.latest_notes, {"product": "firefox"}),
    re_path(
        "^firefox/(?:%s/)?(?:%s/)?system-requirements/$" % (platform_re, channel_re),
        bedrock.releasenotes.views.latest_sysreq,
        {"product": "firefox"},
        name="firefox.sysreq",
    ),
    re_path(releasenotes_re, bedrock.releasenotes.views.release_notes, name="firefox.desktop.releasenotes"),
    re_path(
        android_releasenotes_re, bedrock.releasenotes.views.release_notes, {"product": "Firefox for Android"}, name="firefox.android.releasenotes"
    ),
    re_path(ios_releasenotes_re, bedrock.releasenotes.views.release_notes, {"product": "Firefox for iOS"}, name="firefox.ios.releasenotes"),
    re_path(sysreq_re, bedrock.releasenotes.views.system_requirements, name="firefox.system_requirements"),
    re_path(
        android_sysreq_re,
        bedrock.releasenotes.views.system_requirements,
        {"product": "Firefox for Android"},
        name="firefox.android.system_requirements",
    ),
    re_path(ios_sysreq_re, bedrock.releasenotes.views.system_requirements, {"product": "Firefox for iOS"}, name="firefox.ios.system_requirements"),
    path("firefox/releases/", bedrock.releasenotes.views.releases_index, {"product": "Firefox"}, name="firefox.releases.index"),
    path("firefox/stub_attribution_code/", views.stub_attribution_code, name="firefox.stub_attribution_code"),
    path("firefox/welcome/1/", views.firefox_welcome_page1, name="firefox.welcome.page1"),
    page("firefox/welcome/2", "firefox/welcome/page2.html", ftl_files=["firefox/welcome/page2"]),
    page("firefox/welcome/3", "firefox/welcome/page3.html", ftl_files=["firefox/welcome/page3"]),
    page("firefox/welcome/4", "firefox/welcome/page4.html", ftl_files=["firefox/welcome/page4"]),
    page("firefox/welcome/6", "firefox/welcome/page6.html", ftl_files=["firefox/welcome/page6"]),
    page("firefox/welcome/7", "firefox/welcome/page7.html", ftl_files=["firefox/welcome/page7"]),
    path(
        "firefox/welcome/8/",
        utils_views.VariationTemplateView.as_view(
            template_name="firefox/welcome/page8.html",
            ftl_files=["firefox/welcome/page8"],
            template_context_variations=["text", "image", "animation", "header-text"],
            variation_locales=["en-US", "en-CA", "en-GB", "de", "fr"],
        ),
        name="firefox.welcome.page8",
    ),
    page("firefox/welcome/9", "firefox/welcome/page9.html", active_locales=["de", "fr"]),
    page("firefox/welcome/10", "firefox/welcome/page10.html", ftl_files=["firefox/welcome/page10"]),
    page("firefox/welcome/11", "firefox/welcome/page11.html", ftl_files=["firefox/welcome/page11"]),
    page("firefox/welcome/12", "firefox/welcome/page12.html", active_locales=["en-US", "en-CA", "en-GB"]),
    page("firefox/welcome/13", "firefox/welcome/page13.html", ftl_files=["firefox/welcome/page13"]),
    page("firefox/switch", "firefox/switch.html", ftl_files=["firefox/switch"]),
    page("firefox/pocket", "firefox/pocket.html"),
    # Issue 6604, SEO firefox/new pages
    path("firefox/linux", views.PlatformViewLinux.as_view(), name="firefox.linux"),
    path("firefox/mac", views.PlatformViewMac.as_view(), name="firefox.mac"),
    path("firefox/windows", views.PlatformViewWindows.as_view(), name="firefox.windows"),
    page(
        "firefox/browsers/compare",
        "firefox/browsers/compare/index.html",
        ftl_files=["firefox/browsers/compare/index", "firefox/browsers/compare/shared"],
    ),
    page(
        "firefox/browsers/compare/brave",
        "firefox/browsers/compare/brave.html",
        ftl_files=["firefox/browsers/compare/brave", "firefox/browsers/compare/shared"],<commit_msg>Fix trailing slash for platform urls [no bug] (#11049)<commit_after># This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
from django.conf import settings
from django.urls import path, re_path

import bedrock.releasenotes.views
from bedrock.firefox import views
from bedrock.mozorg.util import page
from bedrock.releasenotes import version_re
from bedrock.utils import views as utils_views
from bedrock.utils.views import VariationTemplateView

latest_re = r"^firefox(?:/(?P<version>%s))?/%s/$"
firstrun_re = latest_re % (version_re, "firstrun")
whatsnew_re = latest_re % (version_re, "whatsnew")
platform_re = "(?P<platform>android|ios)"
channel_re = "(?P<channel>beta|aurora|developer|nightly|organizations)"
releasenotes_re = latest_re % (version_re, r"(aurora|release)notes")
android_releasenotes_re = releasenotes_re.replace(r"firefox", "firefox/android")
ios_releasenotes_re = releasenotes_re.replace(r"firefox", "firefox/ios")
sysreq_re = latest_re % (version_re, "system-requirements")
android_sysreq_re = sysreq_re.replace(r"firefox", "firefox/android")
ios_sysreq_re = sysreq_re.replace(r"firefox", "firefox/ios")


urlpatterns = (
    path("firefox/", views.FirefoxHomeView.as_view(), name="firefox"),
    path("firefox/all/", views.firefox_all, name="firefox.all"),
    page("firefox/accounts", "firefox/accounts.html", ftl_files=["firefox/accounts"]),
    page("firefox/browsers", "firefox/browsers/index.html", ftl_files=["firefox/browsers"]),
    page("firefox/products", "firefox/products/index.html", ftl_files=["firefox/products"]),
    page("firefox/flashback", "firefox/flashback/index.html", active_locales=["en-US", "de", "fr"]),
    page("firefox/channel/desktop", "firefox/channel/desktop.html", ftl_files=["firefox/channel"]),
    page("firefox/channel/android", "firefox/channel/android.html", ftl_files=["firefox/channel"]),
    page("firefox/channel/ios", "firefox/channel/ios.html", ftl_files=["firefox/channel"]),
    page("firefox/developer", "firefox/developer/index.html", ftl_files=["firefox/developer"]),
    page("firefox/enterprise", "firefox/enterprise/index.html", ftl_files=["firefox/enterprise"]),
    page("firefox/facebookcontainer", "firefox/facebookcontainer/index.html", ftl_files=["firefox/facebook_container"]),
    page("firefox/features", "firefox/features/index.html", ftl_files=["firefox/features/shared", "firefox/features/index"]),
    page("firefox/features/adblocker", "firefox/features/adblocker.html", ftl_files=["firefox/features/adblocker"]),
    page("firefox/features/bookmarks", "firefox/features/bookmarks.html", ftl_files=["firefox/features/shared", "firefox/features/bookmarks"]),
    page("firefox/features/fast", "firefox/features/fast.html", ftl_files=["firefox/features/shared", "firefox/features/fast"]),
    page(
        "firefox/features/block-fingerprinting",
        "firefox/features/fingerprinting.html",
        ftl_files=["firefox/features/shared", "firefox/features/fingerprinting"],
    ),
    page("firefox/features/independent", "firefox/features/independent.html", ftl_files=["firefox/features/shared", "firefox/features/independent"]),
    page("firefox/features/memory", "firefox/features/memory.html", ftl_files=["firefox/features/shared", "firefox/features/memory"]),
    page(
        "firefox/features/password-manager",
        "firefox/features/password-manager.html",
        ftl_files=["firefox/features/shared", "firefox/features/password-manager"],
    ),
    page(
        "firefox/features/private-browsing",
        "firefox/features/private-browsing.html",
        ftl_files=["firefox/features/shared", "firefox/features/private-browsing"],
    ),
    page("firefox/features/safebrowser", "firefox/features/safebrowser.html"),
    path("firefox/features/translate/", views.firefox_features_translate, name="firefox.features.translate"),
    page(
        "firefox/features/picture-in-picture",
        "firefox/features/picture-in-picture.html",
        ftl_files=["firefox/features/shared", "firefox/features/picture-in-picture"],
    ),
    path(
        "firefox/features/tips/",
        VariationTemplateView.as_view(
            template_name="firefox/features/tips/tips.html",
            template_context_variations=["picture-in-picture", "eyedropper", "forget"],
        ),
        name="firefox.features.tips",
    ),
    path("firefox/ios/testflight/", views.ios_testflight, name="firefox.ios.testflight"),
    page("firefox/mobile/get-app", "firefox/mobile/get-app.html", ftl_files=["firefox/mobile"]),
    path("firefox/send-to-device-post/", views.send_to_device_ajax, name="firefox.send-to-device-post"),
    page("firefox/unsupported-systems", "firefox/unsupported-systems.html"),
    path("firefox/new/", views.NewView.as_view(), name="firefox.new"),
    path("firefox/download/thanks/", views.DownloadThanksView.as_view(), name="firefox.download.thanks"),
    page("firefox/nightly/firstrun", "firefox/nightly/firstrun.html", ftl_files=["firefox/nightly/firstrun"]),
    path("firefox/installer-help/", views.InstallerHelpView.as_view(), name="firefox.installer-help"),
    re_path(firstrun_re, views.FirstrunView.as_view(), name="firefox.firstrun"),
    re_path(whatsnew_re, views.WhatsnewView.as_view(), name="firefox.whatsnew"),
    # Release notes
    re_path("^firefox/(?:%s/)?(?:%s/)?notes/$" % (platform_re, channel_re), bedrock.releasenotes.views.latest_notes, name="firefox.notes"),
    path("firefox/nightly/notes/feed/", bedrock.releasenotes.views.nightly_feed, name="firefox.nightly.notes.feed"),
    re_path("firefox/(?:latest/)?releasenotes/$", bedrock.releasenotes.views.latest_notes, {"product": "firefox"}),
    re_path(
        "^firefox/(?:%s/)?(?:%s/)?system-requirements/$" % (platform_re, channel_re),
        bedrock.releasenotes.views.latest_sysreq,
        {"product": "firefox"},
        name="firefox.sysreq",
    ),
    re_path(releasenotes_re, bedrock.releasenotes.views.release_notes, name="firefox.desktop.releasenotes"),
    re_path(
        android_releasenotes_re, bedrock.releasenotes.views.release_notes, {"product": "Firefox for Android"}, name="firefox.android.releasenotes"
    ),
    re_path(ios_releasenotes_re, bedrock.releasenotes.views.release_notes, {"product": "Firefox for iOS"}, name="firefox.ios.releasenotes"),
    re_path(sysreq_re, bedrock.releasenotes.views.system_requirements, name="firefox.system_requirements"),
    re_path(
        android_sysreq_re,
        bedrock.releasenotes.views.system_requirements,
        {"product": "Firefox for Android"},
        name="firefox.android.system_requirements",
    ),
    re_path(ios_sysreq_re, bedrock.releasenotes.views.system_requirements, {"product": "Firefox for iOS"}, name="firefox.ios.system_requirements"),
    path("firefox/releases/", bedrock.releasenotes.views.releases_index, {"product": "Firefox"}, name="firefox.releases.index"),
    path("firefox/stub_attribution_code/", views.stub_attribution_code, name="firefox.stub_attribution_code"),
    path("firefox/welcome/1/", views.firefox_welcome_page1, name="firefox.welcome.page1"),
    page("firefox/welcome/2", "firefox/welcome/page2.html", ftl_files=["firefox/welcome/page2"]),
    page("firefox/welcome/3", "firefox/welcome/page3.html", ftl_files=["firefox/welcome/page3"]),
    page("firefox/welcome/4", "firefox/welcome/page4.html", ftl_files=["firefox/welcome/page4"]),
    page("firefox/welcome/6", "firefox/welcome/page6.html", ftl_files=["firefox/welcome/page6"]),
    page("firefox/welcome/7", "firefox/welcome/page7.html", ftl_files=["firefox/welcome/page7"]),
    path(
        "firefox/welcome/8/",
        utils_views.VariationTemplateView.as_view(
            template_name="firefox/welcome/page8.html",
            ftl_files=["firefox/welcome/page8"],
            template_context_variations=["text", "image", "animation", "header-text"],
            variation_locales=["en-US", "en-CA", "en-GB", "de", "fr"],
        ),
        name="firefox.welcome.page8",
    ),
    page("firefox/welcome/9", "firefox/welcome/page9.html", active_locales=["de", "fr"]),
    page("firefox/welcome/10", "firefox/welcome/page10.html", ftl_files=["firefox/welcome/page10"]),
    page("firefox/welcome/11", "firefox/welcome/page11.html", ftl_files=["firefox/welcome/page11"]),
    page("firefox/welcome/12", "firefox/welcome/page12.html", active_locales=["en-US", "en-CA", "en-GB"]),
    page("firefox/welcome/13", "firefox/welcome/page13.html", ftl_files=["firefox/welcome/page13"]),
    page("firefox/switch", "firefox/switch.html", ftl_files=["firefox/switch"]),
    page("firefox/pocket", "firefox/pocket.html"),
    # Issue 6604, SEO firefox/new pages
    path("firefox/linux/", views.PlatformViewLinux.as_view(), name="firefox.linux"),
    path("firefox/mac/", views.PlatformViewMac.as_view(), name="firefox.mac"),
    path("firefox/windows/", views.PlatformViewWindows.as_view(), name="firefox.windows"),
    page(
        "firefox/browsers/compare",
        "firefox/browsers/compare/index.html",
        ftl_files=["firefox/browsers/compare/index", "firefox/browsers/compare/shared"],
    ),
    page(
        "firefox/browsers/compare/brave",
        "firefox/browsers/compare/brave.html",
        ftl_files=["firefox/browsers/compare/brave", "firefox/browsers/compare/shared"],
{'fraction_non_alphanumeric': 0.17195485519591142, 'fraction_numerical': 0.006015758091993186, 'mean_word_length': 4.997765006385696, 'pattern_counts': {'":': 14, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4703049', 'n_tokens_mistral': 6585, 'n_tokens_neox': 6422, 'n_words': 751}