# Must have webform.settings route for config translation which is why there
# is no 'webform.settings.forms' route.
webform.settings:
  path: '/admin/structure/webform/settings'
  defaults:
    _form: '\Drupal\webform\Form\AdminSettings\WebformAdminSettingsFormsForm'
    _title: 'Webforms: Forms'
  requirements:
    _permission: 'administer webform'

webform.settings.elements:
  path: '/admin/structure/webform/settings/elements'
  defaults:
    _form: '\Drupal\webform\Form\AdminSettings\WebformAdminSettingsElementsForm'
    _title: 'Webforms: Elements'
  requirements:
    _permission: 'administer webform'

webform.settings.submissions:
  path: '/admin/structure/webform/settings/submissions'
  defaults:
    _form: '\Drupal\webform\Form\AdminSettings\WebformAdminSettingsSubmissionsForm'
    _title: 'Webforms: Submissions'
  requirements:
    _permission: 'administer webform'

webform.settings.handlers:
  path: '/admin/structure/webform/settings/handlers'
  defaults:
    _form: '\Drupal\webform\Form\AdminSettings\WebformAdminSettingsHandlersForm'
    _title: 'Webforms: Handlers'
  requirements:
    _permission: 'administer webform'

webform.settings.exporters:
  path: '/admin/structure/webform/settings/exporters'
  defaults:
    _form: '\Drupal\webform\Form\AdminSettings\WebformAdminSettingsExportersForm'
    _title: 'Webforms: Exporters'
  requirements:
    _permission: 'administer webform'

webform.settings.libraries:
  path: '/admin/structure/webform/settings/libraries'
  defaults:
    _form: '\Drupal\webform\Form\AdminSettings\WebformAdminSettingsLibrariesForm'
    _title: 'Webforms: Libraries'
  requirements:
    _permission: 'administer webform'

webform.settings.advanced:
  path: '/admin/structure/webform/settings/advanced'
  defaults:
    _form: '\Drupal\webform\Form\AdminSettings\WebformAdminSettingsAdvancedForm'
    _title: 'Webforms: Advanced'
  requirements:
    _permission: 'administer webform'

# Help
webform.help.video:
  path: '/admin/help/webform/video/{id}'
  defaults:
    _form: '\Drupal\webform\Form\WebformHelpVideoForm'
  requirements:
    _permission: 'access administration pages'

webform.help.about:
  path: '/admin/help/webform/about'
  defaults:
    _controller: '\Drupal\webform\Controller\WebformHelpController::about'
    _title: 'How can we help you?'
  requirements:
    _permission: 'access administration pages'

webform.addons:
  path: '/admin/structure/webform/addons'
  defaults:
    _controller: '\Drupal\webform\Controller\WebformAddonsController::index'
    _title: 'Webforms'
  requirements:
    _permission: 'administer webform'

# Forms

entity.webform.collection:
  path: '/admin/structure/webform'
  defaults:
    _entity_list: 'webform'
    _title: 'Webforms'
  requirements:
    _custom_access: '\Drupal\webform\Access\WebformAccess::checkOverviewAccess'

entity.webform.autocomplete:
  path: '/admin/structure/webform/autocomplete'
  defaults:
    _controller: '\Drupal\webform\Controller\WebformController::autocomplete'
  requirements:
    _custom_access: '\Drupal\webform\Access\WebformAccess::checkOverviewAccess'

entity.webform.canonical:
  path: '/webform/{webform}'
  defaults:
    _controller: '\Drupal\webform\Controller\WebformController::addForm'
    _title_callback: '\Drupal\webform\Controller\WebformController::title'
  requirements:
    _entity_access: 'webform.submission_page'

entity.webform.assets.javascript:
  path: '/webform/javascript/{webform}'
  defaults:
    _controller: '\Drupal\webform\Controller\WebformController::javascript'
  requirements:
    _entity_access: 'webform.view'

entity.webform.assets.css:
  path: '/webform/css/{webform}'
  defaults:
    _controller: '\Drupal\webform\Controller\WebformController::css'
  requirements:
    _entity_access: 'webform.view'

entity.webform.confirmation:
  path: '/webform/{webform}/confirmation'
  defaults:
    _controller: '\Drupal\webform\Controller\WebformController::confirmation'
    _title_callback: '\Drupal\webform\Controller\WebformController::title'
  requirements:
    _entity_access: 'webform.submission_create'

entity.webform.user.submissions:
  path: '/webform/{webform}/submissions'
  defaults:
    _entity_list: 'webform_submission'
    _title: 'Submissions'
  options:
    parameters:
      webform:
        type: 'entity:webform'
  requirements:
    _entity_access: 'webform.submission_view_own'

entity.webform.user.drafts:
  path: '/webform/{webform}/drafts'
  defaults:
    _entity_list: 'webform_submission'
    _title: 'Drafts'
  options:
    parameters:
      webform:
        type: 'entity:webform'
  requirements:
    _entity_access: 'webform.view'

entity.webform.user.submission:
  path: '/webform/{webform}/submissions/{webform_submission}'
  defaults:
    _controller: '\Drupal\webform\Controller\WebformSubmissionController::index'
    _title_callback: 'Drupal\webform\Controller\WebformSubmissionController::title'
    type: 'default'
  requirements:
    _entity_access: 'webform_submission.view'

entity.webform.user.submission.edit:
  path: '/webform/{webform}/submissions/{webform_submission}/edit'
  defaults:
    _entity_form: 'webform_submission.default'
    _title_callback: 'Drupal\webform\Controller\WebformSubmissionController::title'
  requirements:
    _entity_access: 'webform_submission.update'

entity.webform.user.submission.delete:
  path: '/webform/{webform}/submissions/{webform_submission}/delete'
  defaults:
    _entity_form: 'webform_submission.delete'
    _title: 'Delete webform submission'
  requirements:
    _entity_access: 'webform_submission.delete'

entity.webform.test:
  path: '/webform/{webform}/test'
  defaults:
    _controller: '\Drupal\webform\Controller\WebformTestController::testForm'
    _title_callback: '\Drupal\webform\Controller\WebformTestController::title'
  options:
    parameters:
      webform:
        type: 'entity:webform'
  requirements:
    _entity_access: 'webform.update'

entity.webform.add_form:
  path: '/admin/structure/webform/add'
  defaults:
    _entity_form: 'webform.default'
    _title: 'Add webform'
  requirements:
    _entity_create_access: 'webform'

entity.webform.edit_form:
  path: '/admin/structure/webform/manage/{webform}'
  defaults:
    _entity_form: 'webform.default'
    _title_callback: '\Drupal\webform\Controller\WebformController::title'
  requirements:
    _entity_access: 'webform.update'

entity.webform.settings_form:
  path: '/admin/structure/webform/manage/{webform}/settings'
  defaults:
    _entity_form: 'webform.settings'
    _title_callback: '\Drupal\webform\Controller\WebformController::title'
  requirements:
    _entity_access: 'webform.update'

entity.webform.assets_form:
  path: '/admin/structure/webform/manage/{webform}/assets'
  defaults:
    _entity_form: 'webform.assets'
    _title_callback: '\Drupal\webform\Controller\WebformController::title'
  requirements:
    _entity_access: 'webform.update'
    _permission: 'edit webform assets'

entity.webform.access_form:
  path: '/admin/structure/webform/manage/{webform}/access'
  defaults:
    _entity_form: 'webform.access'
    _title_callback: '\Drupal\webform\Controller\WebformController::title'
  requirements:
    _entity_access: 'webform.update'

entity.webform.duplicate_form:
  path: '/admin/structure/webform/manage/{webform}/duplicate'
  defaults:
    _entity_form: 'webform.duplicate'
    _title: 'Duplicate webform'
  requirements:
    _entity_access: 'webform.duplicate'

entity.webform.delete_form:
  path: '/admin/structure/webform/manage/{webform}/delete'
  defaults:
    _entity_form: 'webform.delete'
    _title: 'Delete webform'
  requirements:
    _entity_access: 'webform.delete'

# Webform submission results

entity.webform.results_user:
  path: '/admin/structure/webform/manage/{webform}/results/user'
  defaults:
    _entity_list: 'webform_submission'
    _title: 'Webform results'
  options:
    parameters:
      webform:
        type: 'entity:webform'
  requirements:
    _entity_access: 'webform.submission_view_own'
    _custom_access: '\Drupal\webform\Access\WebformAccess:checkResultsAccess'

entity.webform.results_submissions:
  path: '/admin/structure/webform/manage/{webform}/results/submissions'
  defaults:
    _entity_list: 'webform_submission'
    _title_callback: '\Drupal\webform\Controller\WebformController::title'
  options:
    parameters:
      webform:
        type: 'entity:webform'
  requirements:
    _entity_access: 'webform.submission_view_any'
    _custom_access: '\Drupal\webform\Access\WebformAccess:checkResultsAccess'

entity.webform.results_submissions.custom:
  path: '/admin/structure/webform/manage/{webform}/results/submissions/custom'
  defaults:
    _form: 'Drupal\webform\Form\WebformResultsCustomForm'
    _title: 'Customize table'
  options:
    parameters:
      webform:
        type: 'entity:webform'
  requirements:
    _entity_access: 'webform.submission_view_any'
    _custom_access: '\Drupal\webform\Access\WebformAccess:checkResultsAccess'

entity.webform.results_export:
  path: '/admin/structure/webform/manage/{webform}/results/download'
  defaults:
    _controller: '\Drupal\webform\Controller\WebformResultsExportController::index'
    _title_callback: 'Drupal\webform\Controller\WebformController::title'
  options:
    parameters:
      webform:
        type: 'entity:webform'
  requirements:
    _entity_access: 'webform.submission_view_any'
    _custom_access: '\Drupal\webform\Access\WebformAccess:checkResultsAccess'

entity.webform.results_export_file:
  path: '/admin/structure/webform/manage/{webform}/results/download/file/{filename}'
  defaults:
    _controller: '\Drupal\webform\Controller\WebformResultsExportController::file'
    _title_callback: 'Drupal\webform\Controller\WebformController::title'
  options:
    parameters:
      webform:
        type: 'entity:webform'
  requirements:
    _entity_access: 'webform.submission_view_any'
    _custom_access: '\Drupal\webform\Access\WebformAccess:checkResultsAccess'

entity.webform.results_clear:
  path: '/admin/structure/webform/manage/{webform}/results/clear'
  defaults:
    _form: 'Drupal\webform\Form\WebformResultsClearForm'
    _title_callback: 'Drupal\webform\Controller\WebformController::title'
  options:
    parameters:
      webform:
        type: 'entity:webform'
  requirements:
    _entity_access: 'webform.submission_purge_any'
    _custom_access: '\Drupal\webform\Access\WebformAccess:checkResultsAccess'

entity.webform.results_log:
  path: '/admin/structure/webform/manage/{webform}/results/log'
  defaults:
    _controller: '\Drupal\webform\Controller\WebformSubmissionLogController::overview'
    _title_callback: 'Drupal\webform\Controller\WebformController::title'
  options:
    parameters:
      webform:
        type: 'entity:webform'
  requirements:
    _permission: 'access webform submission log'
    _entity_access: 'webform.submission_view_any'
    _custom_access: '\Drupal\webform\Access\WebformAccess:checkLogAccess'

# Webform options

entity.webform_options.collection:
  path: '/admin/structure/webform/settings/options/manage'
  defaults:
    _entity_list: 'webform_options'
    _title: 'Webforms: Options'
  requirements:
    _permission: 'administer webform'

entity.webform_options.add_form:
  path: '/admin/structure/webform/settings/options/manage/add'
  defaults:
    _entity_form: 'webform_options.default'
    _title: 'Add webform options'
  requirements:
    _entity_create_access: 'webform_options'

entity.webform_options.edit_form:
  path: '/admin/structure/webform/settings/options/manage/{webform_options}/edit'
  defaults:
    _entity_form: 'webform_options.default'
    _title_callback: '\Drupal\webform\Controller\WebformOptionsController::title'
  requirements:
    _entity_access: 'webform_options.update'

entity.webform_options.duplicate_form:
  path: '/admin/structure/webform/settings/options/{webform_options}/duplicate'
  defaults:
    _entity_form: 'webform_options.duplicate'
    _title: 'Duplicate webform options'
  requirements:
    _entity_access: 'webform_options.duplicate'

entity.webform_options.delete_form:
  path: '/admin/structure/webform/settings/options/{webform_options}/delete'
  defaults:
    _entity_form: 'webform_options.delete'
    _title: 'Delete webform options'
  requirements:
    _entity_access: 'webform_options.delete'

# Webform results (submissions)

entity.webform_submission.collection:
  path: '/admin/structure/webform/results/manage'
  defaults:
    _entity_list: 'webform_submission'
    _title: 'Webforms'
  requirements:
    _custom_access: '\Drupal\webform\Access\WebformAccess:checkSubmissionAccess'

entity.webform_submission.results_purge:
  path: '/admin/structure/webform/results/purge'
  defaults:
    _form: 'Drupal\webform\Form\WebformSubmissionsPurgeForm'
    _title: 'Webforms: Results purge'
  requirements:
    _permission: 'administer webform'

# Webform log (submissions)

entity.webform_submission.results_log:
  path: '/admin/structure/webform/log'
  defaults:
    _controller: '\Drupal\webform\Controller\WebformSubmissionLogController::overview'
    _title: 'Webforms'
  requirements:
    _permission: 'access webform submission log'
    _custom_access: '\Drupal\webform\Access\WebformAccess:checkSubmissionAccess'

# Webform submissions

entity.webform_submission.canonical:
  path: '/admin/structure/webform/manage/{webform}/submission/{webform_submission}'
  defaults:
    _controller: '\Drupal\webform\Controller\WebformSubmissionController::index'
    _title_callback: 'Drupal\webform\Controller\WebformSubmissionController::title'
    type: 'default'
  requirements:
    _entity_access: 'webform_submission.view'

entity.webform_submission.table:
  path: '/admin/structure/webform/manage/{webform}/submission/{webform_submission}/table'
  defaults:
    _controller: '\Drupal\webform\Controller\WebformSubmissionController::index'
    _title_callback: 'Drupal\webform\Controller\WebformSubmissionController::title'
    type: 'table'
  requirements:
    _entity_access: 'webform_submission.view'

entity.webform_submission.text:
  path: '/admin/structure/webform/manage/{webform}/submission/{webform_submission}/text'
  defaults:
    _controller: '\Drupal\webform\Controller\WebformSubmissionController::index'
    _title_callback: 'Drupal\webform\Controller\WebformSubmissionController::title'
    type: 'text'
  requirements:
    _entity_access: 'webform_submission.view_any'

entity.webform_submission.yaml:
  path: '/admin/structure/webform/manage/{webform}/submission/{webform_submission}/yaml'
  defaults:
    _controller: '\Drupal\webform\Controller\WebformSubmissionController::index'
    _title_callback: 'Drupal\webform\Controller\WebformSubmissionController::title'
    type: 'yaml'
  requirements:
    _entity_access: 'webform_submission.view_any'

entity.webform_submission.log:
  path: '/admin/structure/webform/manage/{webform}/submission/{webform_submission}/log'
  defaults:
    _controller: '\Drupal\webform\Controller\WebformSubmissionLogController::overview'
    _title_callback: 'Drupal\webform\Controller\WebformSubmissionController::title'
  requirements:
    _permission: 'access webform submission log'
    _entity_access: 'webform_submission.view_any'
    _custom_access: '\Drupal\webform\Access\WebformAccess::checkLogAccess'

entity.webform_submission.edit_form:
  path: '/admin/structure/webform/manage/{webform}/submission/{webform_submission}/edit'
  defaults:
    _entity_form: 'webform_submission.default'
    _title_callback: 'Drupal\webform\Controller\WebformSubmissionController::title'
  requirements:
    _entity_access: 'webform_submission.update'

entity.webform_submission.edit_form.all:
  path: '/admin/structure/webform/manage/{webform}/submission/{webform_submission}/edit/all'
  defaults:
    _entity_form: 'webform_submission.default'
    _title_callback: 'Drupal\webform\Controller\WebformSubmissionController::title'
    mode: disable_pages
  requirements:
    _entity_access: 'webform_submission.update'
    _custom_access: '\Drupal\webform\Access\WebformAccess::checkWebformWizardPagesAccess'
  options:
    parameters:
      webform:
        type: 'entity:webform'

entity.webform_submission.notes_form:
  path: '/admin/structure/webform/manage/{webform}/submission/{webform_submission}/notes'
  defaults:
    _entity_form: 'webform_submission.notes'
    _title_callback: 'Drupal\webform\Controller\WebformSubmissionController::title'
  requirements:
    _entity_access: 'webform_submission.update_any'

entity.webform_submission.resend_form:
  path: '/admin/structure/webform/manage/{webform}/submission/{webform_submission}/resend'
  defaults:
    _form: 'Drupal\webform\Form\WebformSubmissionResendForm'
    _title_callback: 'Drupal\webform\Controller\WebformSubmissionController::title'
  requirements:
    _custom_access: '\Drupal\webform\Access\WebformAccess::checkEmailAccess'

entity.webform_submission.duplicate_form:
  path: '/admin/structure/webform/manage/{webform}/submission/{webform_submission}/duplicate'
  defaults:
    _entity_form: 'webform_submission.duplicate'
    _title_callback: 'Drupal\webform\Controller\WebformSubmissionController::title'
    duplicate: TRUE
  requirements:
    _entity_access: 'webform_submission.update_any'

entity.webform_submission.delete_form:
  path: '/admin/structure/webform/manage/{webform}/submission/{webform_submission}/delete'
  defaults:
    _entity_form: 'webform_submission.delete'
    _title: 'Delete webform submission'
  requirements:
    _entity_access: 'webform_submission.delete'

entity.webform_submission.sticky_toggle:
  path: '/admin/structure/webform/manage/{webform}/submission/{webform_submission}/sticky'
  defaults:
    _controller: '\Drupal\webform\Controller\WebformSubmissionController::sticky'
  requirements:
    _entity_access: 'webform_submission.update'
    _csrf_token: 'TRUE'

webform_submission.multiple_delete_confirm:
  path: '/admin/structure/webform/results/delete'
  defaults:
    _form: '\Drupal\webform\Form\WebformSubmissionDeleteMultiple'
  requirements:
    _permission: 'administer webform submission'

# Handlers

entity.webform.handlers_form:
  path: '/admin/structure/webform/manage/{webform}/handlers'
  defaults:
    _entity_form: 'webform.handlers'
    _title_callback: '\Drupal\webform\Controller\WebformController::title'
  requirements:
    _entity_access: 'webform.update'

entity.webform.handlers:
  path: '/admin/structure/webform/manage/{webform}/handlers/add'
  defaults:
    _controller: '\Drupal\webform\Controller\WebformPluginHandlerController::listHandlers'
    _title: 'Select a handler'
  requirements:
    _entity_access: 'webform.update'

entity.webform.handler.add_form:
  path: '/admin/structure/webform/manage/{webform}/handlers/add/{webform_handler}'
  defaults:
    _form: '\Drupal\webform\Form\WebformHandlerAddForm'
    _title: 'Add webform handler'
  requirements:
    _entity_access: 'webform.update'

entity.webform.handler.edit_form:
  path: '/admin/structure/webform/manage/{webform}/handlers/{webform_handler}/edit'
  defaults:
    _form: '\Drupal\webform\Form\WebformHandlerEditForm'
    _title: 'Edit webform handler'
  requirements:
    _entity_access: 'webform.update'

entity.webform.handler.duplicate_form:
  path: '/admin/structure/webform/manage/{webform}/handlers/{webform_handler}/duplicate'
  defaults:
    _form: '\Drupal\webform\Form\WebformHandlerDuplicateForm'
    _title: 'Duplicate webform handler'
  requirements:
    _entity_access: 'webform.update'

entity.webform.handler.delete_form:
  path: '/admin/structure/webform/manage/{webform}/handlers/{webform_handler}/delete'
  defaults:
    _form: '\Drupal\webform\Form\WebformHandlerDeleteForm'
    _title: 'Delete webform handler'
  requirements:
    _entity_access: 'webform.update'

# Plugins

webform.element_plugins:
  path: '/admin/structure/webform/plugins/elements'
  defaults:
    _controller: '\Drupal\webform\Controller\WebformPluginElementController::index'
    _title: 'Webforms: Elements'
  requirements:
    _permission: 'administer webform'

webform.handler_plugins:
  path: '/admin/structure/webform/plugins/handlers'
  defaults:
    _controller: '\Drupal\webform\Controller\WebformPluginHandlerController::index'
    _title: 'Webforms: Handlers'
  requirements:
    _permission: 'administer webform'

webform.exporter_plugins:
  path: '/admin/structure/webform/plugins/exporters'
  defaults:
    _controller: '\Drupal\webform\Controller\WebformPluginExporterController::index'
    _title: 'Webforms: Exports'
  requirements:
    _permission: 'administer webform'

# Autocomplete

webform.element.autocomplete:
  path: '/webform/{webform}/autocomplete/{key}'
  defaults:
    _controller: '\Drupal\webform\Controller\WebformElementController::autocomplete'
  options:
    parameters:
      webform:
        type: 'entity:webform'
  requirements:
    _entity_access: 'webform.submission_page'

# Message

webform.element.message.close:
  path: '/webform/message/close/{storage}/{id}'
  defaults:
    _controller: '\Drupal\webform\Controller\WebformElementController::close'
    _storage: user
  requirements:
    _user_is_logged_in: 'TRUE'
    _csrf_token: 'TRUE'
