   .map(id => decodeURIComponent(id).replace(/_/g, ' '))
        .filter(id => idset.has(id)))
    if (selected.size === 0) { selected = new Set(preset.selected) }
  } else {
    selected = new Set(preset.selected)
  }
}

// This need to be done independently before parseURL()
function parseURLdatabse () {
  const q = new URL(document.location.href).searchParams
  const d = q.get('d')
  database = d ? d.split(',') : preset.database
}

function updateStateFromURL () {
  parseURL()
  updateTitle()
  updateExp